#development

1 messages · Page 1805 of 1

vivid fulcrum
#

unrelated to es versions

fallen holly
#

same thing

#

same eror

#

failed

solemn latch
#

and this is for discord-button-pages

#

?

quartz kindle
#

this butt

solemn latch
crimson vapor
#

Bro disbut sucked the last time I checked

solemn latch
#

its easy enough

restive furnace
#

why not use djs@dev or implement ur own

opal plank
crimson vapor
clear marlin
#

Is that another detritus advertisement I see there

shadow dove
#

pls bal

clear marlin
#

pls youtried

signal estuary
#

When will the messageCreate event been triggered?

clear marlin
#

What are you using

signal estuary
clear marlin
#

Yes

signal estuary
#

modules, tools, libary?

clear marlin
#

Library works

signal estuary
#

discord.js v13dev

clear marlin
#

isn't it supposed to be message event?

#
<Client>.on('message', async(message)=>{})
restive furnace
#

create new socket

summer torrent
summer torrent
clear marlin
signal estuary
# summer torrent when bot receives a message

does anybody know why command is undefined?

        if (!client.application?.owner) await client.application?.fetch();

        if (message.content.toLowerCase() === '!deploy') {
            const data = {
                name: 'ping',
                description: 'Replies with Pong!',
            };

            const command = await client.application?.commands.create(data);
            console.log(command);
        }
clear marlin
#

Oh wait

#

Nvm

clever agate
#

how do you change the font size

#

in Jimp

#

Custom font too

last tapir
#

hey, there is a file type where it shows animated for animated pfps and normal for normal ones, what is it called? should i use gif at this case?

pale vessel
last tapir
#

what do you mean

#

.setThumbnail({ type: , size: 2048 })

sudden geyser
#

If you have the User instance, you can just call .displayAvatarURL({ ... }) with the dynamic option set to true. If the avatar is a gif, it'll display as a gif.

#

.setThumbnail only takes a URL as a string.

#

Alex was referring to how avatar URLs will be prefixed with a_ to represent an animated avatar (gif).

earnest phoenix
#

Pls pos

solemn latch
austere zealot
#

im getting an error saying my column name is not defined in postgresql. Im trying to connect to 2 databases with one loop. i dont think thats the problem tho.

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UndefinedColumnError: column "pc" does not exist
HINT:  Perhaps you meant to reference the column "pokesetspc.pc ".
sudden geyser
#

The column from the table you're referencing probably does not exist. Though, we don't know how that table looks nor how you reference it in your source code.

austere zealot
sudden geyser
#

Well how does it look in pgadmin and how are you using it in your source code (aka provide more details).

austere zealot
#

heres how the pool looks like:

async def create_pokesets_pool():
    client.pg_db = await asyncpg.create_pool(database="pokesets",user="postgres",password="")
    client.pg_dbb = await asyncpg.create_pool(database="pokesetspc",user="postgres",password="")

the code:

results = await client.pg_dbb.fetchrow("SELECT pc FROM pokesetspc WHERE user_id = $1 AND pc = $1",ctx.author.id,pc)
sudden geyser
#

And can you show how it looks in pgadmin? I'd assume there would be a table called pokesetspc in the pokesetspc database with a pc and user_id column. Though, it's quite concerning that you seem to be passing two arguments yet only using one placeholder ($1 vs. ctx.author.id, pc).

austere zealot
ruby lion
#

I'm trying to find a way to control multiple bots via one 'project' folder

So as of now, I have a file that logs into 15 bots and can listen for a command and send a response. Let's just say its a bitch to work with and the program is quite faulty.

Is there any way that I could run each bot on a seperate file inside of a folder, but have all of them update their status seperately after a certain time period? I'm on about having an index.js that controls all the bots in a folder if that makes sense?

I was told to " make files for each client and then export the client, import the client to one index.js file and login each client in that file" although I'm not sure how to: do this in the first place, but then I dont know how I would get the status to update every 60seconds - do I need a controller in the index.js or in the actual bot file itself?

Any help/insight would help loads! Thanks in advance! DiscordJS V13

sudden geyser
#

Yeah, but the real question is why you're running 15 separate bots.

ruby lion
#

Tickers

ruby lion
#

They all have the exact same function par their token and one variable in a link

sudden geyser
#

So cryptocurrency

ruby lion
#

for this project, yea

#

Providing i can get this one going - or atleast the controlling the bots part - I have a few more projects lined up

crimson vapor
#

I would do this a bit differently from you

#

I would have a function that creates your bot client and have it take a token, prefix, and crypto

ruby lion
#

This is it atm, just barebones, no functions are built in. It just simply logs in and waits for a response

crimson vapor
#

They would all run the same code without dealing with any of that shitty copying and pasting

sudden geyser
#

That's quite suspicious, but I'll still answer the question.

Let's say your project directory looked like this:

src
|_ main
|   |_ index.js
|_ bot1
|_ bot2
|_ bot3
|_ ...

What you're looking to do is require each botx's index.js file, which should export a Client instance. Inside your main/index.js file, you'd do the requiring. For example, you could have an array of names for each file and require them over a loop ([1, 2, 3].map((name) => require(name))).

With all the client instances, you'd then iterate over the map again all performing the same functionality. For example, calling .start() on each one of them.

However, I believe your approach is flawed. You're relicating the same functionality with minor differences across 15 bots when one universal bot could handle it. But that's your choice. The real issue you have at your hands is designing abstraction. You may want to spend more time researching that in JavaScript, as it'll make your life much easier. @ruby lion

ruby lion
crimson vapor
#

yes

#

Gimme a few seconds to type a small example

ruby lion
ruby lion
crimson vapor
#

function createClient (token, crypto, prefix) {
// return a client or something
}
const someBot = createClient(process.env.BOT1_TOKEN, process.env.BOT1_CRYPTO, process.env.BOT1_PREFIX)

#

sorry for lack of code blocks

#

Im on my phone

opal plank
#

@crimson vapor how do i post a thinking thiing again?

#

you the one who was fucking around slash commands before

crimson vapor
#

uhh

#

Sec

opal plank
#

aight

ruby lion
crimson vapor
opal plank
#

sankyu

#

@crimson vapor

#

AH

#

im retarded

#

1 sec

crimson vapor
#

kekw

#

man I hate phone keyboards

austere zealot
#

@sudden geyser nvm my column had a space in it lol, thanks though.

signal estuary
#

How can I fix this error:

TypeError: MessageSelectMenu is not a constructor
const { MessageActionRow, MessageSelectMenu } = require('discord.js');
exports.run = async (client, msg, args) => {
    const row = new MessageActionRow()
        .addComponents(
            new MessageSelectMenu()
                .setCustomId('select')
                .setPlaceholder('Nothing selected')
                .addOptions([
                    {
                        label: 'Select me',
                        description: 'This is a description',
                        value: 'first_option',
                    },
                    {
                        label: 'You can select me too',
                        description: 'This is also a description',
                        value: 'second_option',
                    },
                ]),
        );

    await interaction.reply({ content: 'Pong!', components: [row] });
}

tacit sequoia
quartz kindle
#

they should search for it in the discord.js docs

thorny flume
#

text
how can i use this text format in my bot response?

pale vessel
#

Use it the same way you use it on discord

thorny flume
#

does not work

restive furnace
#

you do not work

thorny flume
crimson vapor
#

\`\`\`${message.author}\`\`\`

thorny flume
#

ok

crimson vapor
thorny flume
#

thanks

lament rock
distant cobalt
#
interaction.message.delete()``` why doesn't this work?

when someone interacts with a button, i want the message containing the button to be deleted
lament rock
#

is the message ephemeral

earnest phoenix
heavy marsh
#

In d.js v12.5.3

if (message.guild.me.voice.speaking === false)

Is this the correct way to find if the bot is not speaking in a voice channel?

sudden geyser
heavy marsh
earnest phoenix
#

Just use the logical NOT operator

#

!mesaage.guild.me.voice.speaking

quiet pawn
#

is there a way to send a custom server count amount?

#

because the one on top.gg is always 2 behind

sudden geyser
#

You just send a number

#

You could even send 500 million

quiet pawn
boreal iron
#

Maybe just because the update interval is less than the guild add rate?

quiet pawn
#

no ide

#

its always been like that

#

on every website

#

even if i just do client.guilds.cache.size

#

its 2 off

#

i dont mind just doing + 2

proven lantern
#

maybe two guilds are unavailable because of an outage

boreal iron
#

How do you know it’s 2 off?

quiet pawn
#

but for that long?

quiet pawn
sick agate
#

Btw what lib?

quiet pawn
#

djs

sick agate
#

So i assume you are using node sdk with it

boreal iron
#

Well you should rely on the amount being send in the READY event

quiet pawn
#

i can send source code if ya want in dms

#

its on git

boreal iron
#

As I said I wouldn’t trust the cache fully but the READY event will include the correct amount
Just check that once to make sure there’s no issue on your side

untold token
#

ready event doesn't send anything, it's completely independent from the properties of the client

eternal osprey
#

hey guys,c an i get some help with sheet.js: ```js
datajson = await JSON.parse(body)
console.log(datajson)
const test = datajson.profiles
for (const names of test){
naming += names.name+'\n'
email += names.teaser.emails+'\n'
urlsys += names.linkedin_url+'\n'

}

})
setTimeout(() => {
wb.Props = {
Title: "Test",
Subject: "Test2",
Author: "Test3",
CreatedDate: Date.now()
};

wb.SheetNames.push("Names");
wb.SheetNames.push("Emails");
wb.SheetNames.push("Linkedins");
const ws_data1 = [[${naming}\n]];
const ws1 = xlsx.utils.aoa_to_sheet(ws_data1);
const ws_data2 = [[${email}\n]];
const ws2 = xlsx.utils.aoa_to_sheet(ws_data2);
const ws_data3 = [[${urlsys}\n]];
const ws3 = xlsx.utils.aoa_to_sheet(ws_data3);
wb.Sheets["Names"] = ws1;
wb.Sheets["Emails"] = ws2;
wb.Sheets["Linkedins"] = ws3;
xlsx.writeFile(wb, 'results.xlsx');
console.log("Check the output folder, the migration and scraping is successful.")
}, 5000)``` why is this only saving the first like 10 names (while there are 100) and not saving any other type of data?

#

Also how do i export the data as columns and not as rows

boreal iron
#

Yeah with the ready event

untold token
#

you're wrong. get down from that high horse before you hurt yourself.

#

i've had enough of arrogant people for today

#

now don't ping me again.

eternal osprey
#

hey does anyone know how i can export the data as columns instead of rows?

eternal osprey
#

just plain data

#

right now it saves as a long line

untold token
#

im saying what format

#

SQL?

eternal osprey
#

as a row

untold token
#

CSV?

#

JSON?

#

you have to provide context

eternal osprey
untold token
#

plaintext

#

um excel does have some built-in methods to format plaintext data

#

you'd have to play with it

eternal osprey
#

yeah it used to be json but i changed it to txt form

untold token
#

ouch

#

why would you do that

eternal osprey
#

because i cannot just export json data to excel

fallen holly
#

it is saying failed but it is switching pages and i added button.defer

boreal iron
#

Just read the docs. Can’t be so hard

eternal osprey
#

i am using sheet.js once again

eternal osprey
untold token
#

a format that excel supports natively

#

it doesn't only support spreadsheet files, it does other things too including csv

eternal osprey
#

i am saving it to xlsx.

boreal iron
eternal osprey
untold token
#

if you want to rotate your data im p sure excel offers a way to do that too

eternal osprey
#

i am using js and want to automatically change rows to columns

untold token
#

and in what format is your data in the code

#

a json oobject?

eternal osprey
#

no as you can see in the snippet

untold token
#

so yes.

eternal osprey
#

i am looping over the json object and saving it in a global var

untold token
#

in that code, you're starting with plaintext and parsing it into a json object.

eternal osprey
#

no i am escaping the json

#

``for (const names of test){
naming += names.name+'\n'
email += names.teaser.emails+'\n'
urlsys += names.linkedin_url+'\n'

}`` i am starting with json and changing it to just plain text divided by a space

untold token
#
datajson =  await JSON.parse(body)
#

oops wrong lines

eternal osprey
#

np

untold token
#

well not really

#

but that line right there

#

is you parsing that into a json object

eternal osprey
#

yeah but please look at my code i am escaping my json

#

i will log the contents just for you okay

digital ibex
#

so im trying to receive data from discord (ws). i've connected to their gateway but i am having trouble actually receivin the packets. I've looked on how to receive packets but

untold token
digital ibex
#

i am seein 10 line pseudocode if u like, then lookin at libraries with uh

#

loads

eternal osprey
#

what don't you understand

digital ibex
#

can someone explain this to me, i am so confused

untold token
#

you don't "escape" json, that doesn't make sense

#

you're logging the contents of the object, that i can see

eternal osprey
#

i first get fucking json and i am looping over the objects to eventually get all the contents individually.

untold token
#

no need to get aggressive but that literally is not what "escaping" means and that's what im telling you

eternal osprey
#

I am not aggressive.

#

I am just like this when i am trying to explain.

untold token
#

alright well throw f bombs at someone else cause im done

modest maple
#

pithink Man this is ugly

slender thistle
#

нуфр

#

yea

modest maple
zinc wharf
#

Does anyone know any safe random image api for anime?

modest maple
#

as in nsfw

#

orrrrrrrrrr

#

no nsfw

zinc wharf
#

No nsfw

modest maple
#

mmm not really

#

havent setup anything for that yet other than nsfw bloblul

zinc wharf
#

Ahhhh cheers

digital ibex
#

does anyone know the answer to my problem

#

?

sage citrus
#

how i can fix this

#
client.on('voiceStateUpdate', (oldMember, newMember) => {
  
 
  
  if (db.has(`logs${oldMember.guild.id}`) === false) return;
  
  var kanal = oldMember.guild.channels.cache.get(db.fetch(`logs${oldMember.guild.id}`).replace("<#", "").replace(">", ""))
  if (!kanal) return;
  
  let newUserChannel = newMember.voiceChannel
  let oldUserChannel = oldMember.voiceChannel

  if(oldUserChannel === undefined && newUserChannel !== undefined) {

    const embed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setDescription(`${newMember.user} adlı kullanıcı \`${newUserChannel.name}\` isimli sesli kanala giriş yaptı!`)
    kanal.send(embed);
    
  } else if(newUserChannel === undefined){

    const embed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setDescription(`${newMember.user} adlı kullanıcı sesli kanaldan çıkış yaptı!`)
    kanal.send(embed);
    
  }
});
 

I don't know much code but I couldn't find a bug

prime mist
#

If newUserChannel is undefined, then newMember probably is too.

sage citrus
zinc wharf
#

Change it

#

Like what you do on a normal document. Remove one word. And replace it with another

eternal osprey
#

okay guys i am still stuck with converting my sheet.js from exporting rows to columns

#

their documentation is giving me headache

fallen holly
#

just way working fine yesterday

An error encountered: Error: play(ncs) encountered:
Status code: 429
boreal iron
#

aka. Too many requests

eternal osprey
fallen holly
#

How I fix it never did a music bot

#

First time

eternal osprey
vivid fulcrum
#

and don't spam requests to discord

#

once you're ratelimited the only thing you can do is wait

fallen holly
#

Ok

#

Thx

boreal iron
#

That’s why you check the existence before blindly returning anything

opal plank
#

or use typescript and let it screech at you for returning an unasigned variable

pale vessel
digital ibex
#

^^ fixed my issue

earnest phoenix
#

hi

#

i've got a probleme with plasma bot says it cannot join any server im tryin to invite for

lyric mountain
#

you cant invite it since it's been unverified

earnest phoenix
#

and how to make it so ?

lyric mountain
#

you...don't?

#

discord is the only one who verifies bots

#

plasma used to be verified but they reverted it for some reason

earnest phoenix
#

since when

lyric mountain
#

idk, people came here asking about it a long time ago

earnest phoenix
#

a year ago ?

lyric mountain
#

as I said, idk

earnest phoenix
#

without plasma bot there is no other bot for knowing whois been invited right ?

lyric mountain
#

probably earlier, as I said idk

lyric mountain
#

like, as in welcome messages?

earnest phoenix
#

ye kinda

lyric mountain
#

pretty much all bots have welcome messages

earnest phoenix
#

like this

lyric mountain
#

that's like, the most common feature a bot can have

#

only behind ping, 8ball and choice

earnest phoenix
#

what other bots u suggest 2 use?

lyric mountain
#

I don't know, there's a plenty of them

#

go to top.gg and click "moderation" tag

earnest phoenix
#

thats a supportive advice

#

have a good day

quartz kindle
#

how many bytes of memory different number types use, including some special ones for storing numbers in binary data

boreal iron
#

Well then never let a number grow beyond 128 I guess KEKW

quartz kindle
#

and never use int64 for small numbers :^)

boreal iron
quiet pawn
#

i downloaded a new cpu

quartz kindle
#

its interesting tho, the most important tradeoff is between 1 and 2 bytes, for stuff like serializing messages

#

you can chose for example between 1 byte up to 127 and 2 bytes up to 16k, or 1 byte up to 64 and 2 bytes up to 32k

boreal iron
#

What are u developing if that’s important for u?

quartz kindle
#

its not that important, but it was fun to think about it

#

but im using these types for binary serialization

#

and also for pointer tagging

lyric mountain
#

Imagine when you meet int128

boreal iron
#

alias Jeff Bezos bank balance

opal plank
#

ram go brrr

lament rock
#

til BigInt is int64

errant flax
#

is this how u link a .css file cat_code

    <link rel="stylesheet" href="./styles.css">
boreal iron
#

…more like how you would include it

errant flax
#

wdym..?

errant flax
#

??? sad

earnest phoenix
#

message.member.send(`You have been banned from <server> for <{ reason: banReason }> `);

"member", "server" and "banReason" have all been defined

Im trying to make the server and banreason turn into the server name and banreason, but it just sends them as plain text instead of the const.

Can anyone help with this?

opal plank
tribal siren
#

Hi, do you know how to make this select option thing?

opal plank
#

choices

crimson vapor
#

you add options or something

opal plank
#

choices*

#

thats the name of the property

#

its an array of choices

crimson vapor
#

ayo shut the fuck up

opal plank
#

noob

#

git gud

crimson vapor
tribal siren
#

uh but how

opal plank
#

vicious creature

tribal siren
#

i didn't find it here

opal plank
#

its in options

crimson vapor
opal plank
#

@tribal siren

tribal siren
#

oh

#

i see

#

lemme try

opal plank
#

you just didnt look far enough

tribal siren
#

bruh it's just right above of what i was looking

earnest phoenix
#

new issue lol

#

Why tf does it say object object

#

instead of the ban reason

crimson vapor
#

because you put an object not a string in the literal

#

and when it was stringified

tribal siren
#

object object means that you put an array into there

crimson vapor
#

it turned into [object Object]

earnest phoenix
crimson vapor
#

remove the object and just do the reason

#

${banReason}

earnest phoenix
#

ohh

#

ok

#

thank you]

#

one more issue

#

Instead of dming the mentioned user in the ban cmd, it dms me

#

ik this is shit code

#

But this is a quick project

tribal siren
#

because you wrote message.member so it sends the message to the author of the message

earnest phoenix
#

but member is defined as first mentioned

#

so i should only use member?

tribal siren
#

y e s

earnest phoenix
#

ok thank you

#

Last issue i promise

#

Now it says cant send message to this user

#

And its a brand new acc and dms are open

tribal siren
#

what does it fully say

earnest phoenix
tribal siren
#

hmm

earnest phoenix
#

want me to send the whole cmd code?

tribal siren
#

ok why not

earnest phoenix
#

irdc if you take my ban cmd, its open source bot anyway

tribal siren
#

i already have a ban code i don't need urs

earnest phoenix
#

not talking abt u

tribal siren
#

i don't see anything wrong here

#

try again

earnest phoenix
#

thats what im saying

#

Same error

#

@earnest phoenix Found the error

#

?

#

.addField("User banned", member);

#

Member is an object

#

uhh

#

Do you understand the error im having?

#

Its saying it cant dm the user i mention b4 banning them

#

I have no problem sending the embed

errant flax
#

try and catch it

earnest phoenix
#

No issue with embed

errant flax
#

the error says the bot cant dm the user

earnest phoenix
#

Just dming the user b4 being banned

#

do you have dms off

earnest phoenix
#

and no

errant flax
#

who r u banning and do they have dms closed/blocked the bot

earnest phoenix
#

its my second acc running in a vm, and no

errant flax
earnest phoenix
#

Does it need these?

#

no

errant flax
#

i dont think so

#

since its for events etc

earnest phoenix
#

If the member was banned before the message was sent (which is entirely possible with async code) then you share no servers with the user and cant send them messages

errant flax
#

but they dont await the ban hmm

earnest phoenix
#

Member is being dmed b4 ban so idk how

#

Javscript is weird

#

ill try await

#

You never know the true sequence of promises

errant flax
#

@earnest phoenix remove the ban action

earnest phoenix
#

1 sec

#

ok

errant flax
#

then lets see if it does dms

earnest phoenix
errant flax
#

if so then the ban method is the prob

earnest phoenix
errant flax
#

i may have an idea noobthonk

earnest phoenix
#

Add a .final(_ => { rest of your code }) to the member.send()

errant flax
earnest phoenix
#

It's one callback and handling errors in async functions is very hard

#

It worked when removing the ban part

errant flax
#

then its the ban hmm

earnest phoenix
#

.final will ignore if you were able to message the user or not

errant flax
#

js promises weird bonk

earnest phoenix
#

what if i just add .then

#

so it has to run the message part first

opal plank
#

so, why arent you guys just awaiting ur promises?

earnest phoenix
#

It will still fail id the user deliberately turns off dms

#

im just listening to them

errant flax
#

cant u just do try and catch then finally?

earnest phoenix
#

Good point

earnest phoenix
errant flax
opal plank
#

what?

#

no it wont

earnest phoenix
#

*promise rejection error

errant flax
#
try {
member.send(....)
} catch(e) {
message.channel.send("cannot send a dm to the user")
} finally {
member.ban()
}
#

wouldn't this work hmm

earnest phoenix
#

That works for synchronous code

errant flax
#

or im dumb dog_kek

opal plank
#

await <member>.user.send('Banned for reason X').catch(() => undefined);
await <member>.ban({reason: x}).catch(() => {})```
#

if you guys REALLY want sync code tho

earnest phoenix
#

Wouldnt final be cleaner

#

.final(_ => { member.ban( { reason: banReason } })

That?

opal plank
#
<member>.user.send('Banned for reason X').catch(() => undefined).finally(() => {
 <member>.ban({reason: x}).catch(() => {})
});```
#

if you guys REALLY need sync code

#

which i would not recommend

earnest phoenix
#

member.user.send("Banned for creating an abomination known as Promises").finally(_ => { rest of your code });

#

Catch isnt necessary because of finally

opal plank
#

is it not tho/

#

i thought it'd still throw the error

errant flax
#

we do be confused on promises

opal plank
earnest phoenix
#

Why will js have an identical version of then

opal plank
#

ts tells me its fine

#

might be shit code

earnest phoenix
#

Yeah you can ignore the error in finally and handle the error in catch

#

Tysm

#

It worked

#

Np

opal plank
#

people gotta understand the whole premise of a bot IS working with promises, its waiting for responses between the API and ur bot. YOU NEED to know promises

#

make sure you got thru a bit of docs and play around with it a bit more

#

its important

#

like, REALLY important

earnest phoenix
#

Ive mostly been learning js through trial and error

opal plank
#

well, for each their own

#

i'd personally not recommend that

earnest phoenix
#

That was the first error Ive had in the entier bot

opal plank
#

its slow and will likely teach you a LOT of bad habits

earnest phoenix
#

and it has been working for 2 weeks

opal plank
#

bad coding practices happens exactly like that

#

mushy code filled with patches

#

usually theres almost aways a better solution

#

you only see those mainly in full re-writes

earnest phoenix
#

yea

#

Im just not patient enough to organize everything

#

As long as it works im happy

opal plank
#

fair

#

i'd recommend ts for you

#

so rather than trial and error

earnest phoenix
#

The only thing organized is my files and execute system

opal plank
#

you get the error right away

earnest phoenix
opal plank
#

typescript will screech at you like theres no tomorrow

earnest phoenix
#

I did decent on the execution part

opal plank
#

that giveaways.json really scares me

earnest phoenix
#

its not working

opal plank
#

i hope u aint using a json database

earnest phoenix
#

I couldnt get giveaways to work

#

I was until it broke

pale vessel
#

json.sqlite thonkku

earnest phoenix
#

?

#

whats wrong with it

#

I was suggested to make it that way by a friend

opal plank
#

better sqlite than json

earnest phoenix
#

Its a decent bot for 2 week development

#

not 2 weeks straight

#

But off and on

earnest phoenix
#

So not only 100 msgs

#

bulk del is ass

opal plank
#

dont

#

API abuse

#

delete the channel and re-create it

pale vessel
#

Infinite clear? Clone and delete the channel

opal plank
#

also this is my setup

earnest phoenix
#

i mean technically its just see the next slice, and use that as a var to copy the cmd and rerun it the amnt of time requested

opal plank
#

like i said

#

dont

#

api abuse

earnest phoenix
opal plank
#

eh

#

kinda

earnest phoenix
#

bc i completely guessed on that

opal plank
#

you'd need to make more reuqests

#

and use lastId

#

its basically a loop using the previous messageId

#

but like i said, dont do that

earnest phoenix
#

i wont

#

I dont want discord up my ass

opal plank
#

100 messages as limit

#

some bot DO delete more than that, like dyno n shit, but discor clearly gives bigger bots more leeway

opal plank
#

not really

#

big bots have more priviledges

earnest phoenix
#

I mean i understand

#

yea

opal plank
#

even my bot is absolutely nothing compared to the big bots out there

#

we are ants compared to them

earnest phoenix
#

Neither is mine LMAO

#

Mine is ass

#

41ms average is kinda ass

#

30ms is the lowest i had

opal plank
#

dont bother with ms

earnest phoenix
#

it sucks

opal plank
#

doesnt mean jack shit

#

a bots quality doesnt come from its latency

earnest phoenix
#

i mean you dont want 5000ms

opal plank
#

comes from its quality

#

well yeah

#

but anything to 300ms is acceptable

earnest phoenix
#

uhh @opal plank

opal plank
#

?

earnest phoenix
#

How did you make ur status like that

#

wtf

opal plank
#

sdk

#

same stuff we use for gaming

earnest phoenix
#

Is there a zoom plugin to force your teacher's camera to stop moving

#

lmao

#

i have a spin script for osu

opal plank
#

if u keep watching my presence you should see it update every minute with reatime

#

i think it updates every 15/30 secs

#

let me check

earnest phoenix
#

So your running a process that has the button integrated?

#

weebus status

opal plank
#

minute

opal plank
#

the button is part of the payload it sends to discord

#

its a little .exe i made

earnest phoenix
#

vs or what did you use

opal plank
#

vs yeah

earnest phoenix
#

damn

opal plank
#

i made 2 versions

#

one using n-api

#

and one with the .exe

earnest phoenix
#

I havent worked with vs yet

opal plank
#

not fun

#

and heavy as fuck

earnest phoenix
#

well, ive used it, made a program or 2

#

just not actually learnt it

earnest phoenix
opal plank
#

private repo

#

i dont share my code

earnest phoenix
#

ik im jk

opal plank
#

best u can scrape of is my screenshots in chat

earnest phoenix
#

my bot isnt open source either

#

I just said that so no one would feel like they should steal it when i sent ss

opal plank
#

good luck manually copying 25k lines worth of code tho

earnest phoenix
#

I wonder
Since Promises are added to the microtask queue in order and executed before the next event loop how was the user banned before the message sent

#

ikr

#

It really doesnt make sense

#

it runs top to bottom (obv) so wtf

#

I may pay for my bot to be on a vps soon

#

Rn it on a boosted repl

opal plank
#

eh...

#

if u gonna pay, might as well get an ACTUAL vps

earnest phoenix
#

ik

#

I just didnt know what to buy atm

#

So i just boosted my repl

delicate zephyr
#

What are you gonna host

earnest phoenix
#

My bot

delicate zephyr
#

if its no cpu intensive

#

just get a small contabo vps

#

if it is

#

get something else

#

there are decently cheap hosts everywhere

earnest phoenix
#

it plays music and shit

#

I think it uses cpu

#

This is the cmd i was using for giveaways]

#

But is was ass

#

shit, thats the index

#

it was based off that

#

@earnest phoenix See these Promises are executing in order

#

I wonder what happens when one does smth cpu intensive

#

yooo, how did you do the trash thing

#

thats sick asf

errant flax
#

buttons

earnest phoenix
#

buttons are a thing now?

errant flax
#

yes its been there for days? now

earnest phoenix
#

damn

errant flax
#

u can use the djs master branch to use buttons hmm

earnest phoenix
quiet pawn
earnest phoenix
#

$8 only

#

Not bad

quiet pawn
#

i pay 8$ and get like 4x the amount then repl

#

wait no

#

10x

#

i think

earnest phoenix
#

where

quiet pawn
#

galaxygate

#

3$ one is what repl gives

#

(cheapest)

earnest phoenix
#

nvm im paying $7

#

i got 2gb ram, and 2vcpu

#

$10 for a shit ton more on galaxygate

#

wtf

#

Im changing once my month runs out on repl

#

But you also get the following with repl: non working typescript, a packager which keeps bothering you until you jsfuck your imports (saying from experience) and node v12

#

and outdated j

#

java*

#

java or javascript?

#

java

#

Its outdated on repl

#

pog

#

i suppose it cannot run minecraft

quiet pawn
#

bots are more ram heavy

#

tbh

earnest phoenix
#

ye

quiet pawn
#

i use like 5% of my cpu

#

barely

#

with a bit over 400 servers

#

1core

quiet pawn
#

playing mincraft on repl

round cove
#

Da

quiet pawn
round cove
#

Да

quiet pawn
errant flax
#

how2link
a .css file in html :bonk:

quiet pawn
#

я вышвырну тебя в окноrage

#

oki no mroe russian

#

in dev caht

errant flax
round cove
lament rock
#

@earnest phoenix it is done

#

Everything works flawlessly

#

currently only supports youtube, soundcloud and http sources, but it works

#

even supports listen.moe

#

:)

#

only 1 player active, but still ridiculously optimized

(cpu is an i7 7700K)

low river
#

error?

earnest phoenix
#

wtf is this

prime glacier
# low river error?

whole code is error 😂 sorry i just noticed it now that i will need edit message not send new

#

xD

low river
#

what

prime glacier
#

nothiing

rocky hearth
#

I'hv some number of child classes of class A and B.
when the instances child classes of both parent class interact with each other, it gives a unique behaviour
for example, lets say, <A> has 4 child classes and <B> has 5 child classes. Than there will be 4 x 5 = 20 different behaviours.
Is there any design pattern to accomplish this case?

Right now, I hv to use switch to tackle this in each method.

#

Actually I'm making a board game which have some squares of different zones and some unique pieces. And each piece behaves differently in each zone

earnest phoenix
#

Try using the new string literal types in ts 4.4

wary flame
#

free bans

earnest phoenix
#

throw new Trade("scam") lmao

prime glacier
#
\node_modules\bindings\bindings.js:121
        throw e;
        ^

Error: The module '\\?\C:\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).```
#

can someone help !

craggy pine
#

Its litterally is telling you to update your node.

prime glacier
#

i did

#

but same error

long crow
#

Delete node_modules, then reinstall

prime glacier
#

ok

prime glacier
earnest phoenix
#

Run node -v in the console

prime glacier
#

ok

earnest phoenix
prime glacier
earnest phoenix
#

The directory is C:\node_modules

arctic solar
#

hey

#

how to i get verified?

earnest phoenix
#

Verified on discord or on topgg?

prime glacier
arctic solar
prime glacier
#

when your bot will be verified you will get your role

earnest phoenix
#

You need to wait a few days

#

Then @gilded plank will dm you if it was approved or rejected

prime glacier
#

@earnest phoenix i did node -v and got v14.17.3

earnest phoenix
#

Your sqlite was installed globally

#

Run npm uninstall -g whateverstuffyoureusing

arctic solar
#

do all bots get accepted?

prime glacier
earnest phoenix
#

are you using quick.db

prime glacier
arctic solar
earnest phoenix
#

Run npm uninstall -g quick.db

arctic solar
#

i made a music bot

earnest phoenix
prime glacier
arctic solar
#

that works

#

will it get rejected?

prime glacier
prime glacier
arctic solar
prime glacier
arctic solar
#

it is online 24/7

prime glacier
arctic solar
#

i need custom css

earnest phoenix
#

@prime glacier install it again

quiet pawn
arctic solar
quiet pawn
#

want a github for it?

arctic solar
quiet pawn
arctic solar
#

thz\x

quiet pawn
#

np

prime glacier
quiet pawn
earnest phoenix
#

How will you add custom CSS without HTML

quiet pawn
#

shush

#

i mean the code is in html

#

not like in css

#

if that makes sense

#

look at it ya self

prime glacier
arctic solar
#

hey

earnest phoenix
#

hey

earnest phoenix
#

dblapi.js is steel Woking ?

lament rock
#

No

fringe badge
#

@hidden coral

  let partition = guild.members.cache.partition((member) => member.user.bot);

  return `${guild.name} (${guild.id}): ${guild.memberCount} (bots: ${partition[0].size} | members: ${partition[1].size})`
}).join("\n");
msg.channel.send({
  files: [{
    name: "botcount.txt",
    attachment: Buffer.from(test)
  }]
})```
#

you need intents to be enabled

hidden coral
#

@fringe badge okay

#

@fringe badge uh so the total members of all the servers where my bot is there is 30k non bots

#

Is this okay?

earnest phoenix
hidden coral
#

@fringe badge @fringe badge @fringe badge wtf I'd happening

lament rock
#

Arigato

hidden coral
#

In 10mins my bot got added in 10 more servers

lusty quest
#

have fun getting flagged

lament rock
#

time to host a public "LavaLink" server once I figure out why configureResuming packets are dropped and also proper resuming

hidden coral
#

Bruh it's not me

hidden coral
#

Why will I get flagged

lusty quest
#

for inorganical growth

#

bcs discord is retarted with the verification

earnest phoenix
fringe badge
#

wym

#

this thing sends file in format

server_name (server_id) bots: NaN users: NaN

#

like that Church Of Senko (659863277383450654): 1008 (bots: 20 | members: 988)

#

those servers where bots > members are poo and you need to quit them

hidden coral
#

The servers where bots are more than users that I have to leave?

#

Means the bot have to leave?

fringe badge
#

yep

#

well where its like

#

70% bots 30% users

#

or even more bots

#

if its like 5 bots 5 users dont leave it

hidden coral
#

Oh

#

I can do that automatically easily

#

Like this

#
client.guilds.cache.forEach((g) => {
let bots = g.members.cache.filter(member => member.user.bot)
let users = g.members.cache.filter(member => !member.user.bot)
if(bots > users){
g.leave()
}
})
#

@fringe badge

fringe badge
#

nah you better not

#

as I said you can stay in servers if its like 6 bots 5 users

#

just compare percentage

hidden coral
#

How to get percentage

#

Ohh

fringe badge
#

count it yourself

hidden coral
#

It's gonna be hard

#

Cuz it's in 85 servers

fringe badge
#

not really

#

var money = 100000;
var tallage = 35;
var result = money / 100 * tallage;

result = 35000

#

try to rewrite it and make it so you get percent (tallage if we're talking about example) instead of number

#

or google it lol

errant flax
solemn jolt
#

Hello, i need a idya for create a new bot

lusty quest
#

how hard did you want it to be?

lament rock
#

stop making bots. Make an API or something

#

hot take: there are too many bots

spare badger
#

Welcome to the top.gg Discord server where bot developers tell you to stop making bots Kappa

lusty quest
#

than give ideas for APIs

solemn jolt
lament rock
#

image API

lusty quest
#

wow like the other 20k of them that already exist

spare badger
#

Stop making image API's there are already too many of them.

lament rock
#

fair. Was just an idea

spare badger
#

Build a new bot development framework / library.

solemn jolt
#

I don't know hiw i can make api

lusty quest
lament rock
#

Stop making Discord wrappers. There are too many

spare badger
solemn jolt
lament rock
#

Managed libs suck

lusty quest
#

then make a Bot that Can use Voice commands to execute stuff

spare badger
#

Useless though in my opinion

#

Good practice but useless

solemn jolt
lusty quest
#

Bot joins a VC, you yell at the bot what to do

#

and the bot does it

spare badger
#

You could build a package for it so people can build a voice chat command thing themselves.

solemn jolt
#

By voice

lusty quest
#

yes

#

you asked for something hard

solemn jolt
#

This is a good idya thank you

spare badger
#

Good luck!

solemn jolt
#

But

#

How bot now mention channel or member by voice

lusty quest
#

use voice to text, then just handle it like normal commands

lament rock
#

only thing I'd find interesting if a bot would be a bot than analyses voices to try and learn natural voice language.
Or perhaps analyze messages and learn natural language from that and make a text contextual AI API

spare badger
#

Slowly this is becoming the next siri

solemn jolt
#

How if i create a translate

lusty quest
#

well this you have to figure out

solemn jolt
#

Ok

#

Goodbye i have to work 💪

lament rock
#

why does low level audio processing suck

cinder patio
#

cause it's hard

lament rock
#

I don't wanna add filter support to my lavalink rewrite, but I do at the same time

next tapir
#

hm i cant seem to figure it out how can i access if someone voted for my bot and get their id from it?

earnest phoenix
lament meteor
#

hi @lament rock

#

rare to see u here

lament rock
#

Hi telk

#

and I sometimes come here

lament meteor
#

how has the lavalink rewrite been

#

waiting for amandaos to release

lament rock
#

Painful. I got everything to work except for resuming a session and player filters

lament meteor
#

oof

#

one is quite major the other is whatever

lament rock
#

It's cool to see that the lavalink lib I'm using is 100% compatible with my recreation

lament meteor
#

nice

lament rock
#

remaking the protocols was a pain in the ass tho

#

might open source the repo soon

lament meteor
#

i c i c

#

wish there was an animated amandacomfy emote so i could change my os loading screen to that LMAO

lament rock
lament meteor
#

hmm not rlly a loading emote lol

lament rock
#

bed o clock now

lament meteor
#

gn papi

lament rock
#

13h of work beats me

lament meteor
#

:amandacomfy:

lament rock
jovial nexus
#

slowdown a channel needs MANAGE_CHANNELS or MANAGE_GUILD perms??

errant flax
#
const {EventEmitter} = require("events")
const events = new EventEmitter()

events.on("makeRequest",(key)=>{
  console.log(`${key} has made a request!`)
})
module.exports = events

if i required this file wouldn't that listen for multiple events?

errant flax
#

oh ok gud hmm

#

oh wait just realized why lmaoCry

pale vessel
#

It just requires the event emitter that you already set up

errant flax
#

i wonder what
foo.bar means when showing an example of "of undefined" error :hmm:

silver karma
#

How do i fix this? this came up when trying to use the voting bot testing webhook as you need to do this to finish the setup.

I clicked send test

long crow
#

npm gone apeshit or what (╯°□°)╯︵ ┻━┻

lusty quest
#

works for me

long crow
#

try this, what it say

#

it saying 404 for me

#

finally restored

lusty quest
#

@rustic nova

rustic nova
#

Thabks

feral aspen
#

Heyo.

#

What's the different between .displayAvatarURL() and .avatarURL()

#

They do the same, but any side difference?

earnest phoenix
feral aspen
#

Ohh... alright!! 👍

#

Last thing...

#

There are some users who has gif pfps and some users who has normal.

#

What type should I put that puts any in each case.. meaning if gif, it puts gif, else png

earnest phoenix
feral aspen
#

Ohh... there's a property for dynamic?

#

I forgot that...

earnest phoenix
#

If the user's avatar is animated, it'll return the animated avatar URL as a gif, if not; the static avatar URL will be returned as a png

feral aspen
#

Oh.. now that's amazing.

#

I've tried setting 4096..

#

Not all works..

#

Used to have issues with it in the past.

#

I'll try again though

#

My bad... it worked, thanks! 😊 🙈

hidden coral
#

Guys why am I getting an error cannot send an empty message when trying to edit an embed to another embed?

earnest phoenix
#

owo

#

Hi how to make a user automatically join my support server after inviting my bot? I know the scope is guild.join. But how to make it?

earnest phoenix
#

Oh ty

pale vessel
earnest phoenix
restive furnace
solemn jolt
#
voiceChannel.join().then(voice => {
      const receiver = voice.receiver;
      voice.on('speaking', (user, speaking) => {
        if (speaking) {
          console.log(`${user.username} started speaking`);
          const audioStream = receiver.createStream(user, { mode: 'pcm' });
          audioStream.on('end', () => {
            console.log(`${user.username} stopped speaking`);
            voice.play(audioStream, { type: 'opus' });

          });
        }
      });

Why the connection don't stop and just start again

latent heron
#

god i love variable-length based arguments in PHP

#

it's like the living embodiment of *args

earnest phoenix
#

Any one tell me some free host not replit, heroku, glitch

clever agate
#

replit, heroku, glitch

earnest phoenix
#

Lol

#

Pls any one say

clever agate
#

buy a VPS

#

$999/month

#

lie lol

earnest phoenix
#

I am poor

clever agate
#

wuat

#

buy a VPS

#

is better than a host

#

(But still I use Host for free/ because I don't have money to buy Vps)

earnest phoenix
#

Which host

clever agate
#

IS V P S

#

Virtual
Private
Server

earnest phoenix
#

weirdsip I am verify bot dev

clever agate
#

OK?

slender thistle
#

Repl and Heroku are allowed for Discord bots, more or less

earnest phoenix
#

Heroku not good

slender thistle
#

And they're the most popular and respected out of all free hosting services

#

If you don't know what you're doing, sure

#

Heroku is decent for web applications, not Discord bots

earnest phoenix
#

I use aws but now it expire time

earnest phoenix
slender thistle
#

It allows them, but it's still not the best idea

earnest phoenix
#

Yup

slender thistle
#

Replit.com is the most decent out of all of those, I'd say

#

Simple + officially allow using pinging services to keep your repls running

earnest phoenix
#

If you host in repit you need hacker plan

slender thistle
#

Do you really?

earnest phoenix
#

I buy hacker plan

#

But it can't good

#

And aws is to costly

slender thistle
#

"good" in terms of what?

earnest phoenix
#

It crash

slender thistle
#

If you have money to spend, just rent a VPS

#

Something tells me it's your codebase that's a disaster and not repl

earnest phoenix
#

Nop my card decline

earnest phoenix
slender thistle
#

I use SkySIlk personally. Not sure about their prices anymore

earnest phoenix
#

How much you spend

#

On skysllk

slender thistle
#

I use one of their plans for just $2.5/month, but I'm not sure if they allow those anymore

solemn jolt
#

Why the connection don't stop and just start again

voiceChannel.join().then(voice => {
      const receiver = voice.receiver;
      voice.on('speaking', (user, speaking) => {
        if (speaking) {
          console.log(`${user.username} started speaking`);
          const audioStream = receiver.createStream(user, { mode: 'pcm' });
          audioStream.on('end', () => {
            console.log(`${user.username} stopped speaking`);
            voice.play(audioStream, { type: 'opus' });

          });
        }
      });
modest maple
#

#yay for datacenter downtime

#

Machine didnt boot docker back up correctly so now stuck being completely offline till i get home PainPeko

inner fulcrum
#

does anyone know a free bot hosting (not heroku, Repl.it)

slender thistle
#

No

small tangle
#

well im using my raspberry for hosting my bot, at least its a one time buy FeelsSmartMan and i wanted a pie birthdaycake either way so Shrug

#

depends how big your bot is i guess

pale vessel
#

You wanted a pie but ended up getting a Pi instead

small tangle
#

oh did i write...

#

im hungry :c

pale vessel
#

Would love to eat a raspberry pie ngl

small tangle
#

that would be a great dad joke ngl "family, i made a raspberry pie!" everyone comes to get a slice and he just holds a pi KEKLEO

earnest phoenix
small tangle
#

yeah true

lyric mountain
#

there are also those sketchy hosting sites, but I won't list 'em

hidden coral
#

how do i edit the vote button on my bot page using css to make it blue?

lyric mountain
#

use the long description to inject css

#
<style>
  your css here
</style>
signal estuary
#

How can I check how old a message is?
If it is older than 14 days it should return instead of deleting the message, because that causes an error

wide wharf
#
(node:36) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of null
    at Client.<anonymous> (/home/container/index.js:124:204)
    at Client.emit (events.js:326:22)
    at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:314:20)
    at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:834:20)
(node:36) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 560)
``` Uh what does this error mean?
zinc wharf
#

It means "user" is null

#

As in, nothing came back to it

signal estuary
#

how do I get the days the message is away from Date.Now?
Like if the message was sent 15 days before, age will be "15"?

rapid wharf
#

how can i send the errors to dc??

earnest phoenix
rapid wharf
earnest phoenix
rapid wharf