#development
1 messages · Page 852 of 1
test this @robust moth : ```js
const online = bot.guilds.get(message.guild.id).members.cache.filter(m => m.presence.status != 'offline').size
not every member is cached
replace bot by your client variable
@opal copper ok
@tight plinth maybe it's because he's using the v12, many things changed
I'm on v12
lol
quick question with discordjs v12 : how to get current shard id
and
how can I intergrate discordjs sharding manager with dbl webhook system
coz 1 shard is ok, but if I lau^nch a second one it tries to create another webhook with the same rort, which causes a bot crash
if you already have a sharding manager, dbl.post() will post your shardCount
?
can anyone help me
dbl docs says thos https://lumap.is-inside.me/xuWFGfvL.png
but client.shards in undefined for me
then there is an error in your code
v12 correct
v12 ye
if client.shards is undefined, that meen you don't have a sharding manager
anyone know how to like make a help command with reactions that changes the help when you react to a reaction
client.shard is defined tho
2sec i'm verifing if it's this
wolve
the problem is that creating another shard creates 2 times the dbl webhook and crash one of the shards
and the bot refuses to start
sec
in my bot.js I have this https://lumap.is-inside.me/thrnuvZj.png
it launches once per shard
and it crashes if its been aleready launched one time (aka if there is 2shards or more)
I just want something to avid the crash
what the error is saying ?
what now?
port aleready in use
(node:25159) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
and this too
Oh
Well, you would need the dbl thing where the bot.on("ready") is for when all the shards has launched? or am I wrong?
You're connecting to the port twice then?
it seems
Do you have two shards running?
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: require('./config.json').tokens.bot, totalShards:2 });
manager.spawn();
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
index.js
yes
for now I reverted to 1 to maintain my bot online
But shouldn't you connect to dbl in the ready event when all shards have been launched?
I'm searching how to do that
renaming ur og index.js to bot.js
and this in a new index.js
and thats it
so rename my index file to bot.js, make a new index.js then write whats above
and do some changes to :
-get total users
-get total servers
you will need to eval across all shards to get the guild count or user count and other stuff
and you get an array with the responses
await client.shard.broadcastEval('what you want to eval')
(with the output of each eval)
anyone know how to use client.guilds to list guilds my bot is now, just upgraded to discord.js V12.1.1 and I regret it
@earnest phoenix client.guilds --> client.guilds.cache
same method as v11, just add .cache
oof
better stay with v11 :P jk
so if I got that right your problem is after launching the shards that you get an error that a port is already in use
i need help
i get this error
SyntaxError: Unexpected end of input
←[90m at wrapSafe (internal/modules/cjs/loader.js:1072:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1122:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:1
0)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:1002:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:901:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
in.js:74:12)←[39m
←[90m at internal/main/run_main_module.js:18:47←[39m
in console
when i try to run my program
Well it means you arent doing the syntax correctly and its missing like a }) etc
have fun debugging that one
Are you using VSCode by chance @wet iron ?
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = "token";
const PREFIX = "! ";
const fs = require('fs');
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}
bot.on('ready', () => {
console.log("The bot is active and ready to go!");
if (bot.guilds.cache.size < 2) {
bot.user.setActivity(`${bot.guilds.cache.size} server blyat!`, { type: 'WATCHING'});
}else {
bot.user.setActivity(`${bot.guilds.cache.size} servers blyat!`, { type: 'WATCHING' });
}
});
bot.on('message', message => {
let args = message.content.substring(PREFIX.length).split(" ");
bot.on('messageReactionAdd', (reaction, user) => {
if (reaction.emoji.name !== '⭐') return;
let starmsg = message;
let channel = bot.channel.guild.cache.find(c => c.name === 'starboard')
let starEmbed = new Discord.MessageEmbed()
.setAuthor(message.author.tag)
.setColor("#FFFC00")
.addField(":star:", starmsg);
let limit = 4;
if (channel && reaction.emoji.name == '⭐' && reaction.count >= limit) {
bot.channels.cache.find(channel => channel.name === 'starboard').send(starEmbed)
}
switch (args[0]) {
case "ping":
bot.commands.get('ping').execute(message, args);
break;
case "8ball":
bot.commands.get('8ball').execute(message, args);
break;
case "flip":
bot.commands.get('flip').execute(message, args);
break;
case "roulette":
bot.commands.get('roulette').execute(message,args);
}
};
Youre not closing your message event
solved my problem by removing dbl webhooks
At the end put
}
});
})```
At both events.
You have an event inside the event?
thx!
and I found how to get current shard id : client.options.shards[0]
But yeah you have an event inside an event which isnt the well best thing cause they wont work
move your reaction event out
It will work. But its very in-efficient due to it adding a new listener every single time a message is received.
Which will in turn call the event multiple times.
@earnest phoenix dont forget to add cooldown
idk how to use mongodb, cant hlp
but
I can suggest you a system that works even after bot restart
timestamps
with Date
it still works after th bot restart, it doesnt stop
he does discord.js have like a connection time out for the bot i noticed that my bot
consistently goes offline 6 hours after no one interacts with the bot
Are you hosting on glitch or something?
Your bot might error out and decide to shutdown.
no it’s weird
it still connects with a database
and i can still get stats
only discord no longer gives any events
Hmm
how do i do one line embeds?
just dont new line it?
I'm trying not to have it be multiple lines in the code

Overall its better to just have multiple lines to read it better
^

what
Functions do let you do multiple lines?
how
Huh
Post your code, better for us to understand
if(cmd.conf.ownerOnly && message.author.id !== client.config.owner.id){
return this.client.channels.cache.get(this.client.config.support.unauthStuff).send(message.content)
}
cmd.conf?
yeah
I didnt want to go into every command and define the ownerID, so i just made a simple var to let me do it
I know, every time I try and do a multiple line embed it crashes my bot
.setAuthor('')
.setColor(data.config.embed.color)
.setFooter('')
.setDescription(text);
and then maybe post what error u get
when I try and start it, it pops up with "text is not defined"
post your full code?
cause nothing your showing would be crashing your bot
or show a valid error
wait, I see now, I had a problem with my actual commands
sorry for wasting y'alls time 
How to run the code i messed up
We dont know if you dont supply anything ¯_(ツ)_/¯
How do you mention roles in djs v12?
In v11 I just concatenated the role object with my message but now that isn't a thing
Should work, using .toString() should still work as well
Could however be cache issues.
Oh okay thanks guys
how often should the bots post server count/shard count to the API?
You can post on ready event, and guildCreate event.
Or if you have a large bot with many joins you could post every 10 or 100 or even 1000 bot joins.
Or you could just post on the default 30 minute interval the libs provide 
oh I was posting every hour
is 3 servers per minute probably too much for the guild ready event? lol
my bot kinda hit trending
ah yes another corona bot
could anyone help me with an eval to log all the bots in my server? ive tried
console.log("started")
message.guild.members.cache.map(m => {
if(m.user.bot) console.log(`Bot | ${m.id} ${m.user.tag}`)
})```
the eval doesnt even run
for some reason
Is your eval command setup correctly?
disregard that lol
It worked for me
weird
Well I changed some stuff for it to work with the version before cache
Anyone here who knows how to work with NodeJS on Ubuntu?
Please ping me if you reply, I have this server muted usually
I would recommend node version manager
@slow elk search for nvm node
That's the thing
We tried installing v13 on the system, and process.version keeps returning v10.16.3
We tried NVM, NPM and reinstalling it several times.,
how exactly are u using nvm
you know you have to install the version then actually set it as the default
right
No I didn't know that
We're trying something rn as suggestion from the discord.js community
just use nvm
We're gonna use that
@twilit rapids just a quick question, is it still required to send a physical certification application?
And if yes, is the noted address still the correct one?
Hey I dont understand how to make an app linked with my discord account like some bot's websites
@ionic anchor learn oauth2
Oh okay thanks
maybe Math.floor(Math.random() * 500) + 500?
~~((Math.random() * (max - min) + 1) + min) is the formula for inclusive max and min generation (~~ is just shorthand for Math.floor() but it does some bitwise stuff and floor() is safer for very large numbers, but I've never had an issue)
What language you using?
With code
Bots take work, they don't just come online #502193464054644737 has some stuff
they’ve been recommended a few pages but chose to ignore them
can you have multiple awaitReactions on a message? (discord.js)
I believe just one
How would I debug a NodeJS Heap Dump? I'm trying to see what's causing a memory leak. Also please don't send me a link to some forum that explains how, they don't and only really tell you how to notice you have a memory leak, or if you don't. For example, how would I see which objects/classes use the most memory? For example GuildMembers - 53M or something like that.
you can do that with the chrome dev tools
I've tried that 50x
I don't know how to read memory
All i see is some nonsense text, that's it
I don't think there'll be an easier way
The numbers on the right are the bytes it takes up, though I am not sure what "shallow size" and "retained size" means
Profiling and continuous performance monitoring tools for Java and .NET Professionals.
Though it's for java, still probably the same meaning
How do I take the args from a message and then put it in the bots message?
Thanks for the explanation @cinder patio i'll give it another go, knowing where to somewhat look 
which version are you on, mr.who
@earnest phoenix 12.1.1
the roles property in v12 is now this object https://discord.js.org/#/docs/main/stable/class/RoleManager
can someone tell me a thing
a thing
where did the place you get your repo.git url go?
can i install Discord.js version11
I'm using python 3.8 and I'm trying to access my bot's voting page, but I don't understand how you're supposed to authorize it and it keeps on giving me 401 error
help?
Yes @prime glacier
@hidden bone what?
if you want to clone a github repo, can you only clone the master?
npm install discord.js@(version_name)
@grizzled raven no you can clone other branches iirc
but all the urls are the same
401 means wrong token, @hidden bone
clone with url for both master and a branch are the same, so wouldnt it just clone master?
wait but it says unauthorized for me and I have the token, but i dont know how im supposed to authorize it
does each shard log in to its own instance of the dblapi? I would assume so, correct me if I'm wrong please!
so in my code, there's nothing I really need to change when sharding for dblapi is there (no need to do any extra checks?)
const dbl = new DBL(topggtoken, { webhookPort: process.env.PORT, webhookAuth: process.env.WEBHOOKAUTH }, client);
@hidden bone what is your code?
nvm i can just change the default branch i guess
how do I add the same icon to a message?
set the thumbnail url
thx
@grizzled raven clone the repo then do git checkout branchName
import urllib.request
with urllib.request.urlopen('https://top.gg/api/bots/655157441612349453/votes') as response:
authy = '...'
data = response.read()
print(data)
i don't know what im supposed to do with the authy
I'd argue about using urllib with discord.py
your token is supposed to go in the Authorization header
then wht do i do?
aiohttp is asynchronous
or shiv have u not added an ability to do that with the lib 👀
All possible functionality is there
then use the py dbl lib
ok ill try that thks (:
@elder vine How to type version number
like 11.0.0
anybody know any good Bot names
@charred cargo music?
No music commands
@charred cargo dm
ok
@cinder patio i got it dont worry
I hate the name aiohttp, like, I hate pronouncing it
why do you try to in the first place?
can you not set vars in switch blocks?
why not
like
case 12:
let hello = 3
break;
case 4:
let hello = 2
break;
apparently you cant do that?
Can't you make a new scope in each case
because switch statements are different from ifs and instead they're pointers in memory the code jumps to
case 12:
{
let hello = 2;
break;
}```
if you want to use the same variable name define it outside of the switch statement
that could probably work too
Is there a way for me to make a command that when someone votes on my bot he alerts in a specific chat?
it won't be a command
That be an event
How craft this event?
Idk
@earnest phoenix its best not to think about it
How much memory is usually required when Sharding? I'm assuming resetting the shards once they fall below a certain memory amount is a sustainable solution? I have 8GB of RAM in my vps
and im supposed to know that?
@earnest phoenix
why would i know thats how u get that
yes
yeah ok i didnt know im supposed to use that on canvas
because that's what you learn in maths when you're 9
yeah ok i didnt know im supposed to use that on canvas
@earnest phoenix .
what else would it be
Again, idk
it's a rectangle
bruh
brain exercises
why would i know the canvas on discord.js would use that
api documentation
canvas isn't a part of djs
and any image is a rectangle
im using d.js
idc i never used it lmao

btw i tried that and it didnt work
well, now you know. canvas is a graphics drawing api which uses coordinates to draw on a screen
so everything you want to draw on it, must be drawn using exact coordinates
Honestly, the way canvas does the drawings makes it hard to understand in my opinion
does dblapi automatically post server count from all shards onto your bot page on top.gg?
all canvas objects, such as images and rectangles, start at the corner
if you didnt take geometry or something similar, its harder to understand at least
you know what they say
to center a rectangle inside another rectangle, you need to set the starting point to the canvas center, minus the size of the rectangle you're drawing
const canvas = Canvas.createCanvas(512, 512);```
ctx.drawImage(avatar, 256, 256);
did i do it right? or is there anything else?
well
cause it didnt work
if the canvas size is 200x200 and you want to draw a 10x10 square in the center of it, you need to draw it at 95x95, so then the square will go from 95 to 105 width, and 95 to 105 height
how big is the avatar?
no, I need the x by y
lollll
x = canvas width / 2 - image width / 2
y = canvas height / 2 - image height / 2
i used snekfetch to get it
the displayavatarurl
its hard to get it
how do i know the image width and height ?
displayavatarurl of what?
yes doesnt answer my question
so a user's avatar?
yes
v11 or v12?
can i just load it in google and check or it wont be good ?
v11
you should be able to do that yes
ctx.drawImage allows you to resize the image before drawing
by adding two more parameters
the avatar is also guaranteed to be in the size of a power of 2 so you can scale in 1:1 freely
i dont get it its so weird
if you do ctx.drawImage(image,50,50,200,200)
the image will be resized to 200x200 and drawn starting from coordinate 50x50 until 250x250
yes
and its gonna be in the middle?
256x256 is the center point. but images are drawn from the corner, not from the center
if you put the image at 256x256 and the image size is 100x100, then the image will be drawn from point 256 to point 356
so it wont be centered
the corner of the image will be at the center
is there a way to just make it in middle, no draw
thats why you have to factor in the image size
i told you how
x = canvas width / 2 - image width / 2
y = canvas height / 2 - image height / 2
so if the image is 540, 540
and the canvas is 512, 512
x = 256 - 270 = -14 ?
y = 256 - 270 = -14 ?
how tho
yes, that is correct
really?
yes
the image is bigger than the canvas
so for it to be centered, it will start outside the canvas
so i just use -14 -14? thats it ?
yes
then the image size is wrong
then define your own size for it. as i told you, you can resize the image
still not centered
show the result
can i send the link or the pic itself?
the pic
you want to center the circle?
the image looks centered
but you have something else cutting it
into a circle
so the circle cropping is in the wrong position, not the image
can i send my code?
yes
if(command === "rip") {
const canvas = Canvas.createCanvas(512, 512);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('https://cdn.discordapp.com/attachments/695319481609879585/695635311950037023/png-rip-5.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(message.author.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, -14, -14, 540, 540);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'rip.png');
message.channel.send(attachment);
}```
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
you're clipping at 125x125
with radius 100 pixels
idk whats that tbh
clipping = cutting
ok so should i remove it
that will remove the circle cut and show the full image
will it show it like i wanted tho ?
how do you want to show it?
in the middle
with the circle?
then move this to the middle
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
change 125 to center
256
yes
yes
you set the picture as 540x540
hello
is 1000 good ?
so whats better?
how are you
oh i need less
if your circle size is 100, that means the width is 200, 100 on each side
so if you set your image to 200x200, it will fit the circle perfectly
i used xy again but with 250
its perfect
i just need it under the rip
ctx.drawImage(avatar, 131, 131, 250, 250);```
send u the result
first value is X (left/right) second value is Y (up/down)
if you increase the second value, it will go further down
you need to increase it in both the image and in the circle
sounds complicated
if(command === "rip") {
const canvas = Canvas.createCanvas(512, 512);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('https://cdn.discordapp.com/attachments/695319481609879585/695635311950037023/png-rip-5.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.beginPath();
ctx.arc(256, 256, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(message.author.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 131, 131, 250, 250);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'rip.png');
message.channel.send(attachment);
}```
its just geometry lul
increasing the second 131 will make the image go down. (but not the circle)
increasing the second 256 in ctx.arc will make the circle go down
yes
im going to try a ten
tysm
@quartz kindle
you helped me so much i understand now
you are so patient, appreicated
👍
first time i got this error, my script dont take over 250MB/300MB so i dont know i have it, someone already get it ?
well what do you host on?
it's been more over 1 year i am on it, never got problems
maybe it's the fault of my node version (10.X) ?
how much ram do you get?
3GB, and it's the only on script running
not sure then
ah yeah i see the price thats good
The wrapper for the Discord API you're using.
Discord.js, Eris, Discord.py, JDA, Discord.NET, etc.
Not you, LeeBear.
${message.author.joinedAt} is there a way the bot can show the date when the user has joined
Ergy call that on the guild member.
"boot"?
i used botghoust so what would that be
please do not spam at everyone
A user doesn't have that property.
oh okay
LeeBear botghost is not allowed on DBL.
@slender wagon convert the timestamp to readable hour ( i think its timestamp, i dont remember ) ( https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=joinedAt )
english only @earnest phoenix please
stop being annoying
no need to ping more than one person
I don't
oh my god he's pinging everyone
@twin iron thank you
with what?
please stop spamming try to get your stuff together
I do not understand what you need help with
he doesn't speak english properly
ik
don't spam others in dm
ur gonna have to wait for a long time for someone arabic then
No
its not racist lmao
omg
;D
arabic is just uncommon
its just there arent much that speak it
it's an english server pls try to respect that without call it racism
^
there must be an Arabic discord bot server somewhere
alright lets move to #memes-and-media
omg stop this victimization
have fun



I know that the Arabs find it difficult to assimilate but try to make an effort @earnest phoenix
alright thats enough please take this to #memes-and-media
so make it 🥴
a bot is not an easy thing to do, it requies programming
skills
do you know any programming/coding language @earnest phoenix ?
and good english uwu most of the time
you need to know programming to make a bot
cry he wouldn't understand
lmao yeah
lol
if you dont know programming, you have to learn programming, go to a programming school
he can't copy and paste it
i'm in one uwu
never had one of those
yes, im using primitive english
<- self taught js stupid here
it's easier to translate and understand than programming course
same sammy
self taught is better sometimes
i feel more comfortable doing this

i used codecademy to start out with some langs then just went on with selfteaching
that's nice
I just test shit and learn by it
anyone here code in python?
what?
can i downgrade discord.js by just pushing the numbers down for example from v. 12 to 11.4.1
yes
alright ty
you can remove it and npm i discord.js@11.4.1
noo
oh that works too?
just do npm remove discord.js
and then npm i discord.js@11.4.1
jvm
ohh okay
no
bye
anyone here code in discord.py and know how to make it so your bot will only post nsfw content in nsfw channels?
cuz on glitch i just had to change the numbers then it showed me the tab discord.js update available which means it worked in there
bro anything more random and ima ping a mod
@crude bronze just use an if statement
@crude bronze you have to make a condition for check if the channel is nsfw
i dont really know how python works so dont follow this exactly but you can just put an if for msg.channel.nsfw
i've looked and i don't know how i would use it
okay
So.. if your bot gets to the point of people running commands like constantly, what's the best way to update it without causing too many restarts/disruption to users using it?
depends on what you have to do
you have to restart at low usage and only restart when you must
if its just add a command you can use a load command
to
..load commands
or whatever
keep the old instance running until the new updated instance is ready
Ohhhhhh
that's a good idea
when the new instance is ready, start accepting commands on it and kill the old instance
because I used a separate bot to make large updates on, test them with, and then when I know it's finished I upload it all to the main one
only test on prod
what's "prod"
production
production I assume
my token is changing every time i refresh discordapp.com
yeah
its supposed to do that
like why does it change?
@wide ruin when you run it from google, a new token is generate every time
the token made there is just based on time plus other stuff
but if you do from discord app, it dont change
no the bot token
wtf
not my auth one or whatever
but the one you use isnt invalid unless u click regen
they all work
@earnest phoenix if it doesn't take too much of your time, can you quickly explain how I'd efficiently do that
the first time i see that
yea its supposed to be like that
unless u click regen they work
thats how its supposed to be
check if there are any processes running with the same name, if there are it means an old instance exists.
don't start processing anything on your new instance until everything is ready (bot receives READY event, you're connected to a database etc etc)
once it's ready you can kill that old process and start accepting commands on your new one
Can someone help me figure out why my bot is offline?
I am trying to get it to come back online, but it's not working.
cuz u didnt put it online /s
Any suggestions on what i should do?
check your mails too
I have its's status set to Online, but its not online
No
you need to run the bot
are you actually logging in the bot
logging
no on your computer
@clear wraith that's just your ready event.
are you logging in with what sammy said (client.login)
put it in your main file
yeah does anything get logged. we need to see your mail file with the token excluded
make sure the token you're passing is your actual token
This???
let me check
in your .env file, is there key for TOKEN2 and does it look like the bot token? Make sure it's not the client's secret token.
Hey what kinda hosting can I use? Any free bot hosting software/websites
there are free sites, but it's recommended you get paid hosting
glitch but ur not supposed to actually host stuff like bots on it
if you want a paid host check the pins
define poor
Ill just get my friend to do it he is helping me anyways
you can get a vps good enough for a basic bot for 2.5dollars per month
that is what is in my env fle
replace TOKEN2 for TOKEN
you do realize that its TOKEN and not TOKEN2
then why do you use TOKEN2
Can I remove TOKEN2 if im using TOKEN?
yes
who did you copypaste this from
lul
why would there be a 2 after the token ;D
I'm trying to make a bot that DMs lists of people when classes are going to start. I am having some issues, here is the code.
const discord = require("discord.js");
const bot = new discord.Client();
var mod = null
var embed = new Discord.RichEmbed()
.setDescription("Class Reminder")
.setColor("#0000FF")
.addField(mod, "texthere");
let coreUserList = [
"",
"",
"",
""
]
function send() {
}
function core() {
let date = new Date()
if (date.getDay() === 1) {
setInterval(monday, 60000)
}
}
function monday() {
let date = new Date()
if (date.getHours() === 7 && date.getMinutes() === 40) {
var mod = "Mod 1"
coreUserList.forEach(send)
}
}```
well first of all
the send function is empty
second of all
coreUserList.forEach(send)
thats what im trying to figure out
what to put in the function
to send a message to all the the ids that will be in the coreUserList
also put a function in forEach
@clear wraith where did you copy that code from
i => send(i)
where i would be the id
and in the send function just have it use that id to send
so this?
forEach(u => u.send())
coreUserList.forEach(i => send(i))```
idk what to put in my send function though still
If you don't know what to put in a function you should reevaluate your knowledge of programming 
i dont think you get what i mean
i dont think you get what your code means 
or im not communicating what i mean
send isnt a function
im making a function above it
oh wait true
like a discord embed?
yes
hey @gritty bolt what i would do to make it easier, is test to see if you can do a message reply that will @ everyone
no im not
i just asked
but whatever
i found it
fields: [
{
"name": "thing1",
"value": "yeet"
},
{
"name": "thing2",
"value": "yeetus"
}
]
something like this works
ok
@lucid pasture i can do that
i just literally have never tried using a single array before in js
here let me give you a template
bot.on('message' , msg=>{
if(msg.content == 'whatever'){
msg.reply('whatever @ everyone');
}
})
thats fine
the point of the arrays was to DM people when they have certain classes
otherwise i would've done that
yes, but i think doing the @ everyone would be easier
yeah it would
but i was trying to do something i hadn't before and it seems to be like
really not working
if it shows no errors but its not working, try copy pasting the enire script, make a new file, paste it there, delete the old file, and then move the new file to the folder
no i just dont know how to do it
it should be pretty basic, do you know anything about programming or are you just starting
i havent done it in a bit
so im really rusty
on anything new
im also being really stupid today so idk
also i just realized that i never started the bot
🤦♂️
hi i just wanna ask is there any markdown to add images in website description?
is there what
markdown to add images on website bot description
i would ask someone who is a admin or something
does anyone have any resources that could help with what i was trying to do
send a message to each id in an array?
resolve the id to a user and send a message to them
i have all the user ids
in the array
how do I send a message to each of them at the same time
how
are the users in the same guild?
yes
then you can use guild member manager to find them
what version of discord.js are you on right now?
the latest
i still dont get how do I preform an action though for each id
when i use the guild member manager how do I do it for each id
you use a loop
loop through the array of ids and resolve them to a user
you can use #fetch if the member isn't cached
is there a link on mdn or somewhere else that could help?
a member object that you can send to
or find them
that's not how it works
can I use guild.member?
yes
cool
yes
hey, is there a way to check if a user has a permission by the permissions int you get from the api
?
yes
I'm making a message and reaction collector for my bot, and I'm wondering if it would be smarter to add a listener every time I create a new message collector, then remove it. Or, should I keep it all under one listener and add something like a monitor to check the message in the single message event?
how?
docs
(permission_int & permission) == permission
for example
(permission_int & 8) == 8
bitfields are fun
0x00000020
have fun with bit fields
thats the value of lets say manage server
whats it called
yea
displayAvatar
(permission_int & 0x20) == 0x20
so how do i check if it has the perm by the int i get from discord's api
From my brother....
actually how do i get the client user
read docs
is it just <Client>.user
yes
i dont even have chrome open
it may be already answered there
did discord change the bot system?
i literally have no idea how to invite this bot to an server
scroll down
you'll see the permissions thing
select a permission
and it creates a invite link
there isn’t a down
bot.on("ready", () => {
let guild = bot.guilds.get("id")
const coreClassList = [
"",
"",
"" ,
"",
""
];
coreClassList.forEach(guild.members.fetch(i))```
all the blank spaces and ids are actual ids
am i doing the last line correctly?
no
look at this
thanks
for in is better or just traditional loop
What is databass name
vs js for(const thing in something) {}
@pale vessel
what code are u planning to copy paste @earnest phoenix
traditional = for (let i = 0...
Python
it's faster
probably just a user without nitro
funny how it could use custom emojis
hastebin
Free api uploads?
I need an api tho
that my bot can get to
Can you tell me what I am updating file name
@knotty steeple
no i cant
Ok
Kk
I hate it to make an SQL Database for my Bot
and i hate peanut butter but it still exists
just use mongo
hi guys
do you know why I get this error? (TypeError: msg.client.channels.get is not a function)
what library and version
pff
cuz its not a function

