#development
1 messages · Page 1805 of 1
and this is for discord-button-pages
?
pog im in the docs for discord-button-pages https://i.woo.pics/67c39818e7.webp

this butt
you may need to try their support server.
https://discord.gg/u9gFdnu
i dont know the pages package.
Bro disbut sucked the last time I checked
its easy enough
why not use djs@dev or implement ur own
just use detritus instead then


Is that another detritus advertisement I see there
pls bal
pls youtried
When will the messageCreate event been triggered?
What are you using
me?
Yes
modules, tools, libary?
Library works
discord.js v13dev
create new socket
it is messageCreate in v13
when bot receives a message
Oh wow, they changed it
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);
}
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?

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).
Pls pos
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 ".
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.
i can see the column in pgadmin.
Well how does it look in pgadmin and how are you using it in your source code (aka provide more details).
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)
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).
oh god, didnt notice i was only using 1 place holder
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
Yeah, but the real question is why you're running 15 separate bots.
Tickers
They all have the exact same function par their token and one variable in a link
So cryptocurrency
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
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
This is it atm, just barebones, no functions are built in. It just simply logs in and waits for a response
They would all run the same code without dealing with any of that shitty copying and pasting
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
So get it to grab the things from the .env file, and then use it for the function inside of the index.js?
Thanks. I was thinking of an universal bot but the purpose of the bots are to have dedicated tickers, so i can't do that as of now :(. Thanks for the insight, I'll look at abstraction now :)
Thank you :)
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
@crimson vapor how do i post a thinking thiing again?
you the one who was fucking around slash commands before
aight
No worries, thank you for the example :D
Line 120 @opal plank https://github.com/Million900o/slash-command-bot/blob/master/src/utils/index.ts
@sudden geyser nvm my column had a space in it lol, thanks though.
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] });
}
Look up the error?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_constructor
they should search for it in the discord.js docs
text
how can i use this text format in my bot response?
Use it the same way you use it on discord
does not work
you do not work
but i want to send something like:
${message.author}
\`\`\`${message.author}\`\`\`
ok
pain
thanks
Progress of recent project I've undertaken to remake LavaLink in NodeJS.
I got worker <-> parent <-> socket communication working perfectly. Just need to figure out why no audio is coming through.
https://cdn.discordapp.com/attachments/497161350934560778/861692509263626250/unknown.png
If anyone uses @discordjs/voice and might know the issue, hmu
interaction.message.delete()``` why doesn't this work?
when someone interacts with a button, i want the message containing the button to be deleted
is the message ephemeral
Define "doesn't work", do you get any errors? What's exactly the issue?
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?
You should check if it's not equal to true, as it's nullable.
So like this?
if (message.guild.me.voice.speaking !== true)
is there a way to send a custom server count amount?
because the one on top.gg is always 2 behind

or just do client.guilds.cache.size + 2
Maybe just because the update interval is less than the guild add rate?
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
maybe two guilds are unavailable because of an outage
How do you know it’s 2 off?
but for that long?
the invite says 400 but the bot says 398
Btw what lib?
djs
So i assume you are using node sdk with it
Well you should rely on the amount being send in the READY event
ye
i can send source code if ya want in dms
its on git
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
ready event doesn't send anything, it's completely independent from the properties of the client
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
Stop talking trash…
The event includes all guilds
Yeah with the ready event
take a chill pill. what im saying is complete fact. you can write a listener that takes advantage of the client's properties UPON the emission of the ready event, but the ready event does not have ANY parameters or provide any information on its own.
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.
hey does anyone know how i can export the data as columns instead of rows?
what kind of data
as a row
just txt to xlsx
plaintext
um excel does have some built-in methods to format plaintext data
you'd have to play with it
yeah it used to be json but i changed it to txt form
because i cannot just export json data to excel
it is saying failed but it is switching pages and i added button.defer
Just read the docs. Can’t be so hard
i am using sheet.js once again
yeah i got it working, but it saves as rows but i need columns.
you can convert it to csv or something
a format that excel supports natively
it doesn't only support spreadsheet files, it does other things too including csv
i am saving it to xlsx.
Wasn’t for you lmao
Please read this message before answering the question. No hate btw.
if you want to rotate your data im p sure excel offers a way to do that too
i am using js and want to automatically change rows to columns
no as you can see in the snippet
so yes.
i am looping over the json object and saving it in a global var
in that code, you're starting with plaintext and parsing it into a json object.
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
np
yeah but please look at my code i am escaping my json
i will log the contents just for you okay
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
that doesn't make any literal sense lol
it does
what don't you understand
can someone explain this to me, i am so confused
you don't "escape" json, that doesn't make sense
you're logging the contents of the object, that i can see
i first get fucking json and i am looping over the objects to eventually get all the contents individually.
no need to get aggressive but that literally is not what "escaping" means and that's what im telling you
alright well throw f bombs at someone else cause im done
Man this is ugly

Does anyone know any safe random image api for anime?
No nsfw
Ahhhh cheers
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
If newUserChannel is undefined, then newMember probably is too.
how can I do it :'(
Change it
Like what you do on a normal document. Remove one word. And replace it with another

okay guys i am still stuck with converting my sheet.js from exporting rows to columns
their documentation is giving me headache
just way working fine yesterday
An error encountered: Error: play(ncs) encountered:
Status code: 429
aka. Too many requests
does anyone understand how to trasform this to columns
wait
and don't spam requests to discord
once you're ratelimited the only thing you can do is wait
stop using var
That’s why you check the existence before blindly returning anything
or use typescript and let it screech at you for returning an unasigned variable
i gotta question
anyone know why this.client is undefined?
lemme get the code, one sec
I used Shiro API before and it didn't have that much images. You can also try SRA https://some-random-api.ml
^^ fixed my issue
@lament meteor nice ads
hi
i've got a probleme with plasma bot says it cannot join any server im tryin to invite for
you cant invite it since it's been unverified
and how to make it so ?
you...don't?
discord is the only one who verifies bots
plasma used to be verified but they reverted it for some reason
since when
idk, people came here asking about it a long time ago
a year ago ?
as I said, idk
without plasma bot there is no other bot for knowing whois been invited right ?
know who's been invited?
like, as in welcome messages?
ye kinda
pretty much all bots have welcome messages
like this
that's like, the most common feature a bot can have
only behind ping, 8ball and choice
what other bots u suggest 2 use?
how many bytes of memory different number types use, including some special ones for storing numbers in binary data
Well then never let a number grow beyond 128 I guess 
and never use int64 for small numbers :^)
This or download more RAM 
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
What are u developing if that’s important for u?
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
Imagine when you meet int128
alias Jeff Bezos bank balance
does djs only use int64?

ram go brrr
til BigInt is int64
is this how u link a .css file 
<link rel="stylesheet" href="./styles.css">
…more like how you would include it
??? 
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?
Hi, do you know how to make this select option thing?
choices
you add options or something
ayo shut the fuck up

uh but how
vicious creature
i didn't find it here
git: 'gud' is not a git command. See 'git --help'.
and it IS in the docs
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
you just didnt look far enough
bruh it's just right above of what i was looking
object object means that you put an array into there
it turned into [object Object]
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
because you wrote message.member so it sends the message to the author of the message
y e s
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
what does it fully say
hmm
want me to send the whole cmd code?
ok why not
irdc if you take my ban cmd, its open source bot anyway
i already have a ban code i don't need urs
not talking abt u
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
try and catch it
the error says the bot cant dm the user
yes, but i dm the user b4 the embed is sent
and no
who r u banning and do they have dms closed/blocked the bot
its my second acc running in a vm, and no

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
but they dont await the ban 
Member is being dmed b4 ban so idk how
Javscript is weird
ill try await
You never know the true sequence of promises
@earnest phoenix remove the ban action
then lets see if it does dms
no dont
if so then the ban method is the prob
ok
i may have an idea 
Add a .final(_ => { rest of your code }) to the member.send()
nvm it wont work
It's one callback and handling errors in async functions is very hard
It worked when removing the ban part
or just comment it
then its the ban 
toldya
.final will ignore if you were able to message the user or not
js promises weird 
It will still fail id the user deliberately turns off dms
im just listening to them
cant u just do try and catch then finally?
oh ye
Good point
Await will still throw the error if dms were actually off

*promise rejection error
try {
member.send(....)
} catch(e) {
message.channel.send("cannot send a dm to the user")
} finally {
member.ban()
}
wouldn't this work 
That works for synchronous code
or im dumb 
await <member>.user.send('Banned for reason X').catch(() => undefined);
await <member>.ban({reason: x}).catch(() => {})```
if you guys REALLY want sync code tho
Wouldnt final be cleaner
.final(_ => { member.ban( { reason: banReason } })
That?
<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
member.user.send("Banned for creating an abomination known as Promises").finally(_ => { rest of your code });
Catch isnt necessary because of finally
Why will js have an identical version of then
Yeah you can ignore the error in finally and handle the error in catch
Tysm
It worked
Np
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
Ive mostly been learning js through trial and error
That was the first error Ive had in the entier bot
its slow and will likely teach you a LOT of bad habits
and it has been working for 2 weeks
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
yea
Im just not patient enough to organize everything
As long as it works im happy
The only thing organized is my files and execute system
you get the error right away
typescript will screech at you like theres no tomorrow
I did decent on the execution part
that giveaways.json really scares me
its not working
i hope u aint using a json database
json.sqlite 
better sqlite than json
Do you know how to make a infinite clear cmd
So not only 100 msgs
bulk del is ass
Infinite clear? Clone and delete the channel
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
alr, is this how it works tho?
bc i completely guessed on that
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
100 messages as limit
some bot DO delete more than that, like dyno n shit, but discor clearly gives bigger bots more leeway
yea
kinda bs
even my bot is absolutely nothing compared to the big bots out there
we are ants compared to them
Neither is mine LMAO
Mine is ass
41ms average is kinda ass
30ms is the lowest i had
dont bother with ms
it sucks
i mean you dont want 5000ms
uhh @opal plank
?
sdk
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
same stuff we use for gaming
Is there a zoom plugin to force your teacher's camera to stop moving
lmao
i have a spin script for osu
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
minute
no, im just running a process
the button is part of the payload it sends to discord
its a little .exe i made
vs or what did you use
vs yeah
damn
I havent worked with vs yet
you should send it to me and let me edit it 
ik im jk
best u can scrape of is my screenshots in chat
my bot isnt open source either
I just said that so no one would feel like they should steal it when i sent ss
good luck manually copying 25k lines worth of code tho
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
What are you gonna host
My bot
if its no cpu intensive
just get a small contabo vps
if it is
get something else
there are decently cheap hosts everywhere
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
buttons
buttons are a thing now?
damn
u can use the djs master branch to use buttons 
thats first time i have heard of someone buying boosted repl
where
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
cpu doesnt really matter
bots are more ram heavy
tbh
ye
Da
net 
Да
нет 
halp stop speaking russian 
Wonder what would happen if you googled that same thing
@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)
wtf is this
whole code is error 😂 sorry i just noticed it now that i will need edit message not send new
xD
what
nothiing
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
Try using the new string literal types in ts 4.4
free bans
throw new Trade("scam") lmao
\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 !
Its litterally is telling you to update your node.
Delete node_modules, then reinstall
ok
still!
Run node -v in the console
ok
ayo they installed it globally
v14.17.3
The directory is C:\node_modules
Verified on discord or on topgg?
upload your bot on www.top.gg
i did
when your bot will be verified you will get your role
You need to wait a few days
Then @gilded plank will dm you if it was approved or rejected
@earnest phoenix i did node -v and got v14.17.3
do all bots get accepted?
some got rejected!
are you using quick.db
yes
why
Run npm uninstall -g quick.db
i made a music bot
They didnt follow rules
done
online timing!
nope
wut?
npm uninstall -g quick.db
up to date in 0.038s
it is online 24/7
it will be accepted
@prime glacier install it again
for topgg page?
yep
want a github for it?
sure
thz\x
np
ok
it uses html but its good for custom page
How will you add custom CSS without HTML
shush

i mean the code is in html
not like in css
if that makes sense
look at it ya self
thanks it worked
hey
hey
dblapi.js is steel Woking ?
@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
@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?
@fringe badge @fringe badge @fringe badge wtf I'd happening
Arigato
In 10mins my bot got added in 10 more servers
have fun getting flagged
time to host a public "LavaLink" server once I figure out why configureResuming packets are dropped and also proper resuming
Bruh it's not me

цнь
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
Yea I know it sent
The servers where bots are more than users that I have to leave?
Means the bot have to leave?
нуз
yep
well where its like
70% bots 30% users
or even more bots
if its like 5 bots 5 users dont leave it
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
nah you better not
as I said you can stay in servers if its like 6 bots 5 users
just compare percentage
count it yourself
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
thats unreliable since some members wouldn't be in the bots cache
Hello, i need a idya for create a new bot
how hard did you want it to be?
Welcome to the top.gg Discord server where bot developers tell you to stop making bots 
than give ideas for APIs
So hard
image API
wow like the other 20k of them that already exist
Stop making image API's there are already too many of them.
fair. Was just an idea
Build a new bot development framework / library.
I don't know hiw i can make api
you know some Machine learning?
Stop making Discord wrappers. There are too many

Yup
Managed libs suck
then make a Bot that Can use Voice commands to execute stuff
Can you explain
You could build a package for it so people can build a voice chat command thing themselves.
By voice
This is a good idya thank you
Good luck!
use voice to text, then just handle it like normal commands
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
Slowly this is becoming the next siri
How if i create a translate
well this you have to figure out
why does low level audio processing suck
cause it's hard
hm i cant seem to figure it out how can i access if someone voted for my bot and get their id from it?
Painful. I got everything to work except for resuming a session and player filters
It's cool to see that the lavalink lib I'm using is 100% compatible with my recreation
nice
i c i c
wish there was an animated amandacomfy emote so i could change my os loading screen to that LMAO

hmm not rlly a loading emote lol
gn papi
13h of work beats me
:amandacomfy:

slowdown a channel needs MANAGE_CHANNELS or MANAGE_GUILD perms??
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?
manage channel
No
It just requires the event emitter that you already set up
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
works for me
@rustic nova
Thabks
Heyo.
What's the different between .displayAvatarURL() and .avatarURL()
They do the same, but any side difference?
<User>.avatarURL() returns null if the user has a default avatar, while <User>.displayAvatarURL() returns the URL of the default avatar if the user has a default avatar
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
<User>.displayAvatarURL({
dynamic: true,
size: <some size here>,
format: 'png'
});
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
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! 😊 🙈
Guys why am I getting an error cannot send an empty message when trying to edit an embed to another embed?
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?
How can you do multiple id's on if(message.author.id != 92974521048392)
if(message.author.id !== "ID" || message.author.id !== "ID");```
Oh ty
That's impossible to pass
Ah
to achieve this in the most efficient way:
- declare array of all owners in some kind of config file
- use
Array.prototype.includes(...)- docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
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
god i love variable-length based arguments in PHP
it's like the living embodiment of *args
Any one tell me some free host not replit, heroku, glitch
I am poor
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)
Which host
I am verify bot dev
OK?
There's no free hosting
Repl and Heroku are allowed for Discord bots, more or less
Heroku not good
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
I use aws but now it expire time
It host py bots
It allows them, but it's still not the best idea
Yup
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
If you host in repit you need hacker plan
Do you really?
"good" in terms of what?
It crash
If you have money to spend, just rent a VPS
Something tells me it's your codebase that's a disaster and not repl
Nop my card decline
Where you deploy
I use SkySIlk personally. Not sure about their prices anymore
I use one of their plans for just $2.5/month, but I'm not sure if they allow those anymore
Oh
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' });
});
}
});
#yay for datacenter downtime
Machine didnt boot docker back up correctly so now stuck being completely offline till i get home 
No
well im using my raspberry for hosting my bot, at least its a one time buy
and i wanted a pie
either way so 
depends how big your bot is i guess
Would love to eat a raspberry pie ngl
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 
Mostly it comes up to your Code(Language) and Bot Purpose.So it would be possible to host a 100k bot on a pi
yeah true
free
heroku, repl.it
"free"
google cloud
there are also those sketchy hosting sites, but I won't list 'em
how do i edit the vote button on my bot page using css to make it blue?
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
(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?
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"?
how can i send the errors to dc??
Whatever before the user property is null, make sure to check the nullability of a value before accessing it's properties
@earnest phoenix sir plz
dc?
discord














