#development
1 messages · Page 1572 of 1
So u want me to add args?
in there?
make sure you do it client side or your dedi cpu will go brrrrr
you showed this remeber?
you already have a variable named "args"
Yes. I know.
@umbral zealot we are in need of the learnjs copy pasta please
Today's trick: use search and look for learnjs or jsfirst to find it 😉
BS, I wrote that line of code you copied up there 
learnjs™️
fine
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
My friend wrote the kick command, and also ban command with the wcp command... But its not copy paste.
your friend copy/pasted it
im gonna be honest evie's js site is the best
From?
you explain everything well
From literally my guide 
https://anidiots.guide/first-bot/command-with-arguments boop, there it is
So anyways the point is : you need to learn javascript
but then..
when i asked if you already had args in your index.js
oh god
means that you probably already had the line that defines args as well
meaning you dont need to create args again in the command file
you're literally just shoveling code around, without knowing what it does, and without even the slightest of the basics. You need to take the time to learn javascript.
const prefix = require('./config.json').prefix
module.exports = {
name: 'kick',
execute: async(client, message) => {
const args = message.content.slice(prefix.length).trim().split(/ +/);
if(!message.member.roles.cache.some(r=>["👻・Trail Moderator", "🧨・Moderator", "🛠️・Director Team", "👽・Director of Partners", "🛠️・Director of Staff", "🔰・Management Team", "🎓・Chief Operating Officer", "Administrator", "director", "👑・Chief Executive Officer", "🔰 Owner", "Moderator" || "founder" || "Founder" || "FOUNDER" || "owner" || "Owner" || "OWNER" || "M.S.T owner" || "-👑- Owner" || "ADMINISTRATORS" || "Administrators" || "administrators", "boss", "boss crew", "bosses", "bosss", "founders", "mod", "moderaters", "moderater", "Moderaters", "Moderater"].includes(r.name)))
return message.reply("Sorry, you don't have permissions to use this! (is you do hava permissions, but this command still doesnt work, check if you have role named exacly **Administrator, or admin.**) If you have your own roles that you would like to add, so you didnt needed to have that role, or if you have your own role, just join our support server and message it in the help section.");
let member = message.mentions.members.first() || message.guild.members.get(args[0]);
if(!member)
return message.reply("Please mention a valid member of this server");
if(!member.kickable)
return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided.";
await member.kick(reason)
return message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
}
}```
oh god
dont you have this const args = message.content.slice(prefix.length).trim().split(/ +/); in your index.js?
what the-
Its the code.
Yes.
then use it
lol
put args in the function
and delete that line from kick.js
else you're doing the same work again
repeating something your code already did before
Alright. It worked. 🙂
uhh
Can someone teach me how to make stuff like (prefix)prefix !
and then bots prefix would change..
the way person wants it to be.
I. Know. Basics.
stop thinking im a dum dum who just started coding please..
ok then, if you know the basics, how do i get 5 from [1, 2, 3, 4, 5]
smartass
anyway
Thanks.
I need to npm that?
you could also use mongodb https://npmjs.com/package/mongodb or https://npmjs.com/package/mongoose
mongoose is poggers
yes
Ill use.... Which one is better?
quick.db is easier
mongoose is generally the best
Alright ill use that quick.db
sql's good too
yeah, but you gotta learn another language tho
but mongo is one of the better options for discord bots imo
npm i
I hate onedrive
mood
My storage of 13,200 G is almost out... 😦
done.
Now I create something like quick.db file?
i think quick.db makes it four you
I once accidentally deleted my desktop on onedrive. had to reinstall windows after it remotely deleted my actual desktop folder
all?
clearly its one or another
probably 13 mb
. . .
dot dot dot™️
very much
why?
( ͡° ͜ʖ ͡°)
Is this a joke?
I was already banned i dont feel like getting banned again FOR EVER.
😐
😦
||(Banned for a year now comeing back and getting banned on the first day for sending 3 dots ...)||
banned from this server?
user id?
Is it really iligal to send 3 dots?
oh ok
But just if u need it for some reason and cant get it your self here: 717526789882380338
hm
appeal at appeals@top.gg
wait why did you ban him?
🔓 Unbanned SmugTheKiler#6034 (@quaint wasp)

maybe actually read chat before moderating someone 
lol
check modlogs next time kid
i smell 
wait why did you ban him again 
he did
Cause parm didnt read chat correctly
Im back!
lmao jeez
Uhh

pretty bad.
Lmao
I was banned for almost a year
and told if I get banned again its forever
This sure looks like development lol
yes
ofc
like anyone ever codes their own stuff now days
the development of parms brain xD
pffft imagine actually coding
hes trolling
it was a joke
Knew it.
PARM YOU TWAT
nah we all use botghost
ofc
ofc like who doesnt?
yes. Really true.
some say... i am a botghost bot
Will be*
no mee6 uses bdfd
whoa
and rhythm uses dbm
oh right..
i think groovy uses bot ghost though
Samee
They just pay like $60 and then get milions from it. What a deal. I really now wish I thught of it first.
hi whats is my error
your readdirSync is undefined, did you import the library?
ammm
or define the function correctly
whats message traslate?
pretty sure readdirSync is meant to be used as whatever.readdirSync()
is my library

WOW... servers on top? mine are on the side...
your commands folder is not a library, you must either import the library that the function is defined in, or define the function yourself
How do I do that?
const { readdirSync } = require("fs");
it's bandage something like that
probably what flazepe suggested, i dont code in node ;-; sorry
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
FUCK
ok
:c
I modified it but it comes out the same in cmd
https://nodejs.org/api/fs.html
https://adrianmejia.com/getting-started-with-node-js-modules-require-exports-imports-npm-and-beyond/
uh... type npm i node or something in the power shell.
its dirname not diraname
I am stupid that nothing comes out :c
for what?
ahhhhh
learn.
oki
LMAO that //PUTA
xd
lol
sorry, nothing else occurred to me in mind
que se PFP?
wtf
It is the first time that I make a bot on pc, sorry if I take your time: c
no
¿?
dont do npm i node lmao
that doesnt do anything, and its stupid to do
its __dirname
They told me to do it ._.
not __diraname
ahhhhhh
they dont know what they're talking about
How stupid am I for God's sake
sorry if i take your time thanks i appreciate your help
UwU

ur gonna need to change ur pfp as it is basically NSFW <_<
lmao I guess shes right..

what..
@quaint wasp
BR?
Kkkkk
Yes?
oh
I kinda dont know spanish
I know Russian tho.
but we cant speak it here so... its useless.
pfp is this?
// PUTA
pfp is profile picture
ah but I like it>: C
its NSFW
yes change it
oh, thats better.
I mean there's no nudity
nvm
but I don't like anime I don't like anything else I liked that photo and well
it's definitely on the line
Hey here!
Would you agree that it's hot though
whats line?
but on the verge of it
The NSFW line
not at all it dont matter
yes
Then just do a picter of WATER.
it is still against #rules-and-info i velieve
😆 XD
but I don't like water, I put it on because I liked the girl>: u
You produce water?
you are made out of water..
bro i like my gf but i dont put her as my pfp because 1 its privcy invasion 2 its againt rules in every server.... well most of them
true.
ye we should go there.
does anyone know if videos can be embeded
not sure
Only by og tags
what does that mean
I meant discord embeds lol
Og tags are well, og tags
Not with bot embeds
But possible with og embeds
Like YouTube
If you post a link it'll appear the video, right?
Yeah
That's og tags
i just remembered why i hated so much runtime errors while testing a minecraft plugin
oh god
Basically data sent from an external site
That's a gif
right
wonderful choice of gif
<meta property="og:video" content="https://tryitands.ee/tias.mp4" />
<meta property="og:video:secure_url" content="https://tryitands.ee/tias.mp4">
<meta property="og:video:width" content="896" />
<meta property="og:video:height" content="504" />
<meta property="og:video:type" content="video/mp4" />
these are it
hm
Those metadatas will be in the page's head
I appreciate you guys helping but I am not going to be able to follow along thx though
ill just have it post link
Basically you need a website
Then put og tags in the website's head section
Then whenever someone post its link discord will catch the tags and build the embed
okay

What would be the best way to handle a large X amount of server raiders using a discord bot
Kick 'em
Make an AI that detects when someone is raiding and kick them
easy
depends on what you're storing
for tokens and private stuff use .env
OR you can use config.json and .gitignore it
i use both 
ah yes i see
Hey i need a help with a code.
I gave code like this
message.react(":thumbsup:")```
It is reacting to user commands.But its not reacting to itself
i think you would have to do embed.react(":thumbsup:")
Oh
because you have the message it sends as embed
Let me try
Oh
and message is when someone does the command
do this
Ok thanks
because when you do message.channel.send(embed) you have the message the bot sends defined as embed so to have it react you would use that instead
Oh ok Ty
embed doesn't have a react method
wdym
you can't do embed.react
Then how?
im smart lol
message.channel.send returns a message Promise
use a .then i guess then?
message.channel.send(embed).then((message) => message.react("\👍"))
Ok
you'll have the message then
.then?
yeah that works
Ok
It should not react like this
message.guild.channel.create
undefined Why?
you can also
message.channel.send(embed).then((message) => {
message.react("👍");
message.react("👎");
});
.then should be in another line know
.-.
wait i will give you src
client.on('message', message => {
if(message.content === prefix + 'vr') {
message.guild.channel.create (`Role Count: ${message.guild.roles.cache.size}`, {
type: 'voice'
});
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setTitle('**Done create Voice Room With Server Roles Number **');
message.channel.send(embed)
}
});
message.guild.channels.create(name);
uhhh
is it cuz u have a space?
well also channel isn't a property of guild
nope
so channel should be channels
so therefore
message.guild.channels.create (`Role Count: ${message.guild.roles.cache.size}`, {
type: 'voice'
});```
ty
Can help someone how to put random color in python?
for d bot?
can i see src
idk
what output you expect?
random.randint(0, 0xffffff) if you need it in int
[random.randint(0, 255) for _ in range(3)] for rgb ig
Any ideas why a message collector could just stop working? A restart of my bot fixes it. The collector detects channel mentions after the command is run, but sometimes users run the command, mention their channel and there's no response from the bot and nothing in my error logs. I have all the catch handlers set up properly and I've tested this command to oblivion. The proof it works is when I restart the bot it works perfectly, just sometimes the message handler doesn't seem to work and without errors in the logs I don't know what the problem is.
It's not a channel perms problem
How many you can have in one channel? Or on a shard ?
If you're using d.py 1.6+, there's a random classmethod for the color class
Well I'm not sure that's the issue because it doesn't get used really often. Also, the collector times out after 15s of inactivity in the channel if there's no channel mentioned.
Use htop and see what's using it up. Probably database requests
so if i have a module that returns a function and dont want to set a variable for it, how would i do that?javascript const moduleExample = require("./module.js"); console.log( moduleExample() ); // so could i just turn that into this or something? console.log( require("./module.js")() );
or maybejavascript eval( require('./module.js') + '();');
moduleExample()
A) Don't do this eval( require('./module.js') + '();'); smh
B) require("thing.js")() works
Anyone who knows anything about discord bots sharding/shards dm me please
just a heads up, most of the more experienced dev's here don't provide support in DM's. by asking for DM's you shut off your chance of response by a lot.
So what do you recommend
Aye
asking in here 👀
if(message.content === prefix + 'vc') {
message.guild.channels.create(`Channels Count: ${message.guild.channel.cache.size}`, {
type: 'voice'
channel.overwritePermissions([
{
id: message.guild.id,
deny: ['CONNECT'],
},
],
});
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setTitle('**Done create Voice Room With Server Channels Number **');
message.channel.send(embed)
}
})
where is problem?
whats the error/issue?
Really? He show us the code, ask what's wrong and then just leave ?
its a common thing 🤷♂️
ya ikr
his code isn't exactly the easiest to read either
where is channel defined
like
thats what i was going to say the problem was lmao
im 99% sure his issue here is the way he's using the create function
.-.
At the bottom he's closing something that seems it's never opened
channel.overwritePermissions([
^^^^^^^
SyntaxError: Unexpected identifier
its not the full snippet
Did you define channel?
dude
@earnest phoenix you need to read the docs and understand how the function works
you can find out more here: https://discord.js.org/#/docs/main/stable/class/GuildChannelManager?scrollTo=create
I wanna use an Sql db
gives you an example directly on the docs too https://img.pyrocdn.com/SZm00rnY
@earnest phoenix ^^
i already read it here
Use the official documentation
@earnest phoenix like I showed in the screenshot of the example, you need to use the given example from the official documentation and it should work
It's the unique hosting service that i have to keep my bot online 24/7
repl.it wont last long
Like if you ever plan on getting big
you cant rely on free hosting
I don't have money
no, free host isn't technically bad
do you have hacker plan?
Nope
doesn't matter. Calling it instantly bad is wrong
its just not sustainable
its ok for small applications
Nepp, it isn't that easy
wait how old?
thats not helping :/
15
10yrs a card??? O.o
when are you able to get your own card
At 18 years
welp
ah yea, it's fairly understandable why you rely on free hosting then
im in France
yea, its not that easy for others
it doesnt work ehere lmao
you're repeating already mentioned issues nepp
My friend just gave me acces to a VPS that had 31gb of ram, 3 days later the vps host got discontinued
31gb ram?
because it's a support channel. You should be professional. It's what support is supposed to be
Ya
31g bram
i saw the settings of the vps and used a command of my bot to analyze the ram
30GB of ram is a lot for a VPS
and its kinda big
after depends
if you have music commands
you will need a lot of ram
i have a gift for you
?
Repl.it is a simple yet powerful online IDE, Editor, Compiler, Interpreter, and REPL. Code, compile, run, and host in 50+ programming languages: Clojure, Haskell, Kotlin, QBasic, Forth, LOLCODE, BrainF, Emoticon, Bloop, Unlambda, JavaScript, CoffeeScript, Scheme, APL, Lua, Python 2.7, Ruby, Roy, Python, Node.js, Deno (beta), Go, C++, C, C#, F#, ...
and you can access to this
np
A fivem server dosent need that much
now you can make it 24/7 without uptimerobot
Ok, now it's not necesary
yes
Thx!
you get this perks
what does offline repls do?
they are offline 👀
Oh i don’t know about minecraft but fivem is not really that heavy loaded if you don’t have soo many scripts
Ideally, we want to be helpful and point issues out instead of outright telling them to do X
(Personal advice: if you want to be a BR, you'll have higher chance if you actually focus on the issue and don't condescend to people)
what people mean to say is that repl.it is not ideal, however if it's your only option, use it.
You should never use repl.it to host your bot
its not really ideal for that and also all repls are public by default and you can't make them private if you don't have the hacker plan
and if you use a config.json that will be shown then
unless you use a .env file
It hosts like a proper vps so you pay to keep your bot online and private
its still better to get a vps
but it's better that you can actually code and host your bot for free even though it won't be public
i agree im just heading over stuff why is repl.it better
@marble juniper I did mention that its ok for small applications / private bots
than idk something else
its not ok for a bot of my scale lol
but if you plan on going medium / large then generally you shouldnt rely on free hosting
yes
its more of a "not recommended"
kek
lol
hey i was wondering how to add defined permissions to roles that are created?
I tried this but it doesn't seem to work :
message.guild.roles.create({
data: {
name: 'Muted',
color: 'BLACK',
SEND_MESSAGES: false
}
})```
hey
so
i think the djs causes event block while sending an embed
i put some timers
the embed was created in 4ms
but it took 3 secs to send the embed
during this 3 saecs
i wasn't able to execute any other commands
ah nvm i found it in the docs thanks anyways
really weird
im quite certain you simply do ‘permissions: []’
SEND_MESSAGES: false
doesnt seem to work
Unexpected token ':'
yeah but the false thins is not there in the docs
any idea?
oh shoot. you cant set the permission to false for the role
that is done in the channels
yeah
@umbral zealot
ive seen mee6 do it for all channels
sorry for the pings
how would i do that?
so you oughta edit every channel every time it created the role
hmmm
im not sure exactly how to do it as i use another system. but i recommend going to the docs or stacks and see how they edit every channel
i found how to edit the channel perms
is there any way to select all channels when specifying the perms
thanks for the help anyways
yw
nobody knows?
check your code
you keep referring to event blocks but no such thing exists
you can block the event loop
hey can someone help me with the slash commands?
well this waht i mean everytime i tlk about eveny blocks
also yeah i put timers
when that embed is being sent
and i type ping
it doesnt work
until the embed is sent
other commands dont work
see waht im talking about?
you acn ignore the ping
but waht im tryna say is, until that embed was sent those pings didnt show up
by sent i mean literally
i put timers in my code
up until that embed gets created
ooof
Yeah it's kinda weird. Tested it 8-10 times to make sure
When the embed is about to be sent or edited it doesn't allow other commands to run
is there a way of fetching every role in array all at once?
arrray
for(const role of roles)
const fetchRole = await message.guild.roles.fetch(role)``` tried this but nothing
const roles = ['797070395777220620', '796881888836845589']```
just fetch then filter
let roles = await guild.roles.fetch();
let filtered = roles.filter(role => array.includes(role.id))
how do i filter the leaderboard so it doesn't return the nasty undefined at the end
const lb = leaderboard.map(
(e) =>
`${e.position}. ${e.username}#${e.discriminator}\nLevel: ${e.level}\nXP: ${e.xp.toLocaleString()}`
);
const embed = new MessageEmbed()
.setAuthor(`Leaderboard for ${message.guild.name}`)
.setThumbnail(message.guild.iconURL())
.setTitle(`Top 5`)
.setColor(`BLUE`)
.addField(`${lb.join("\n\n")}`)
.setFooter(`Want to get here? Keep on chating!`)
here is the code
if i want claim auto role, what is the code for this
fields have a title field and a text field. you only add the title field
what does is mean this????
Lmao
hi, is it possible to host discord bot in more than 1 server? (discord.py)
uh well
what's the use case here
i mean it is
but if you handle commands on both servers on the same shard, you're going to have duplicated responses
technically couldn't you start shard 0 somewhere and shard 1 somewhere else without any issues?
until commands
well no since different shards
quick question
when an embed is being sent, the other messages wont be sent in the message.channel.send?
because thats what im observing rn
i can see the command being registered, but when the embed is being sent the other messages dont get sent
also just wondering if i should be doing await message.channel.send() instead of message.channel.send()
on the await part, it really only matters if you want code to run after the message is recieved
it is the same thing as doing .then(msg => { codeHere() })
here's a sample screen shot, after the embed is ready its being sent in the message.channel.send() so when the ping is being called the command is actually executing but not being sent in the message.send() its seen after the embed shows up
yeah hango n
so the ping command will just return that message
you see the 2 pings that didnt get a respnse?
that response came after the embed showed up
but the commands were called before the embed
as you can see here i put some timers and logs in the otehr command "ping" which is actually pinging but no response from the message.send
ping: ({ message, client }) => {
console.log("pinging-------")
message.channel.send(
:ping_pong: Ping: **\`${Date.now() - message.createdTimestamp}ms``** WS: ``${Math.round(client.ws.ping)}ms```
);
return;
},
The ping command
you get the point
try looking at await/async for executing the code after the embed is sent
well i can see the logs being generated where that command exists
but message.send() isnt sending it
is it throwing an error at all 
in short words the message send are synchronous
no errors
its jsut that there's a huge delay
when 2 commands are invoked
especially embeds
the embed is taking a lot of time to get sent is what im saying
maybe the data is too large?
there are like 2 attachments
What do the missing access and missing permissions errors in the log mean? and how can I prevent them
they mean you don't have access or permissions
you should always do permissions checks before attempting to create/delete/edit things
but my bot 3.600 server how can I understand this
i don't think that'd be the issue, otherwise i'd think that it would be timing out and would throw a 408. when debugging is it even hitting the code?
you would want to use an if statement to check if the bot has certain permissions in the server. like if you have a kick command you would want to check for if it has kick_members permission
then probably a server didnt give ur bot the correct permissions
nop there are no timeouts
what i just sent read that
the message gets sent trust me but there's a delay
noob
okay guys thanks let's not continue
show us your code?
ah, then you might be hitting the rate limit if you are using discord.js, it takes into account rate limits already. ex sending 5 messages in a burst per 3 seconds
this is the ping command code
ok
so waht if there are 3k users
it's done on a guild/channel basis (i think), this is what i'm looking at: https://github.com/discordjs/discord.js/blob/stable/src/rest/RequestHandler.js#L53
it won't error if it's guild/channel basis, instead it delays those messages
but im saying is, if message 1 is being sent (embed) and it takes 5secs, and message 2 is invoked which takes 1sec, message 2 shows up after message 1
well in that case
there's a 3 sec gap
when the commands are called
Push rejected, failed to compile Node.js app. ! Push failed
heroku error pls helppp
nice
we can't help without any logs

log 4000 letter
lmao
lmao
I am from Turkey. I just started coding. and I want help. Your reaction made me sad. I hope we will not meet again. 
imagine going to a pharmacist and saying "Need medication."
the pharmacist doesn't know what medication, what quantity or anything
the same is applicable here
you need to provide context when asking your question
otherwise don't get mad when people don't understand you
nobody can read your mind
also, don't try to guilt trick people into spoon-feeding
its bad practice and will only hurt you
ok what happened here
what's that for
my friend Try it but the Discord API latency about 100ms and reaches 130ms
vps specifications
thats about what you'd expect for a EU location
contabo is european
they do US now
oh i forgot to say for
if you want low ping, you need the US location
I pay $3 extra for US location so i get about 30ms
you have to pay extra for US?
Discord API latency ?
well tbh they're still cheaper than pretty much every other US location but yes
imagine because costs are higher than their normal system
yes 1 €
but i dont really mind cuz still dirt cheap for a US location
I dont think thats possible to get 16ms being in frankfut to the discord gateway
Yes, I was amazed at it, but the person from who I bought it said it was in Frankfurt
No i mean
its litterally impossible
you would have to be breaking the speed of light to achieve that even going as the crow flys
I understand from you that to get low ping with Discord I have to buy one in America
the ABSOLUTE MINIMUM you could possibly get assuming you ran a cable straight from NY to frankfut in a single straight line would be 20.6ms
The ping ranged from 16 to 32
again thats not possible without breaking the speed of light lol
bruh
REST ping definitely can't be it
cry ngl thats one of the dumbest things you've said here lmao
xD
headers = {'Authorization': "Bot " + token}
idd = "123"
messagesend = requests.post(f"https://discord.com/api/v8/channels/{idd}/messages",json={'content': "Notification test"}, headers=headers)
print(messagesend.text)
{"message": "Unauthorized", "code": 40001}```
I normally have the token and id there, does anyone know why this won't work?
It's working for other actions, but messaging just won't work
who ghost pinged 
@earnest phoenix my bad, you need to connect to gateway
before that endpoint works
cache.get
is that done with websockets/
@earnest phoenix
@earnest phoenix yup
Yes, which line will I write when I do it?
have you ever connected to the gateaway with the bot?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I have not, I'll look into it now. thanks for the help
just read through this and make sure you have all steps done
{member.guild.channels.cache.size}
You need to connect only once in order to use it
egemen
in total
whereever you have the channels.get, put cache between
@earnest phoenix just try opening the gateway with like discord.js, then you can use your own module
or another framework of your liking
you dont need to speak english in here
Actually yes, there is no exclusion for #development in the rules for english only
yes which command and which line should I write it on
there have been many times people have spoken non english in this channel
We can speak turkish this channel ?
here, this can be helpful to you. #development message
I said that too
If you've been following a tutorial or guide that showed you member.guild.channels.get() then that tutorial or guide is out of date and should no longer be followed.
@quartz kindle i was asked to ask you about this here
at ReactionCollector.handleCollect (C:\Users\Outdated Cosplay\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:315:20)
at MessageReactionAdd.handle (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\actions\MessageReactionAdd.js:49:17)
at Object.module.exports [as MESSAGE_REACTION_ADD] (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_REACTION_ADD.js:4:37)
at WebSocketManager.handlePacket (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10) at WebSocket.onMessage (C:\Users\Outdated Cosplay\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\Outdated Cosplay\node_modules\ws\lib\websocket.js:797:20)
(node:17804) 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: 1)
(node:17804) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.``` this is something to do about discord reaction collectors and stuff
im too tired for this
I think this is self explanatory...
then self explain it
You're trying to use apply() on the Client which is an object and not a function
^
is there any way to fetch all channels in a server and store them as a variable?
you mean like a cache of some sort? 
Im not using apply anywhere
ok well as Feud says, your filter is probably not a function. show us your collector code
im trying to create a mute role and i want to change all the channel permissions of the muted role to send messages : false
const collector = reqEmb.createReactionCollector(bot, reqEmb, filter, { time: 60000, max: 1 });
``` this isnt my code its my friends code they asked me to fix
which library are you using
.js
so just appreciate the fact im too tired for this
that's a language, not a library. what specific library are you using?
ok then you already have guild.channels.cache as a collection of all the channels in that guild
no need to fetch them, they're always cached
should i use each() to apply the permissions overwrite?
you can use .forEach , yes
well your friend should learn to read the docs, createReactionCollector doesn't take client as its first argument, or a message as the second one.
they used to use eris
now im trying to convert it into discord.js
so itll take me a while
Hopefully you pay more attention to the docs in the future then? 😛
It'll save you a lot of time
the first argument is the filter
@umbral zealot it doesnt seem to be updating the perms for any channels
message.guild.channels.cache.forEach(
updateOverwrite(channel.guild.roles(mutedrole), { SEND_MESSAGES:false })
)```
forEach needs a function, that's not what you're providing
ah
Bro why are you going from eris to d.js 👀
reject humanity, return to monke (djs)
ease
Does anyone know a good ai service, without dialog flow?
Eris, in some configurations, can have less of a memory footprint. However, discord.js can get very close in terms of memory usage if you modify it to cache only what you need. Such is the case with any lib, though. I'd say the best approach would be modular interfaces which don't provide too many abstraction layers. Working with raw Discord data is actually pretty easy and helps you understand what exactly you need.
Discord.js' biggest downfall is its abstraction layers.
and then they do shit like channel.startTyping()
which goes completely against the what the discord api's version actually does
.addField(`Çekilişi Kazanan`, `<@${message.guild.members.cache.random().id}>`, true)
How can I block the bots of this code
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzNyIgdmlld0JveD0iMCAwIDMwIDM3Ij4KICAgIDxnIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTIyLjAxIDcuODg2VjUuNDUyYy45Ny0uNTExIDEuNDc4LTEuNDYgMS40NzgtMi41MzFDMjMuNDg4IDEuMzE0IDIyLjE4IDAgMjAuNTgxIDBjLTEuNTk4IDAtMi45MDYgMS4zMTQtMi45MDYgMi45MiAwIDEuMDcxLjQ2IDEuOTk2IDEuNDI5IDIuNTA3djIuNDU5aC04LjcyVjUuNDI3YTIuOTI3IDIuOTI3IDAgMCAwIDEuNDMtMi41MDZDMTEuODEzIDEuMzE0IDEwLjUwNCAwIDguOTA2IDAgNy4zMDggMCA2IDEuMzE0IDYgMi45MmEyLjkgMi45IDAgMCAwIDEuNDc4IDIuNTMydjIuNDM0SDIyLjAxeiIvPgogICAgICAgIDxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTI2LjM4OSAxMGMxLjk0NCAwIDMuNTE4IDEuNTYzIDMuNjExIDMuNDAxVjM3bC0zLjYxMS0zLjg2SDMuNTE5QzEuNTc0IDMzLjE0IDAgMzEuNjY4IDAgMjkuNzM3VjEzLjQwMUMwIDExLjU2MyAxLjU3NCAxMCAzLjUxOSAxMGgyMi44N3pNMTEuNSAxOGgtM2MtLjgyNSAwLTEuNS42NzUtMS41IDEuNXYzYzAgLjgyNS42NzUgMS41IDEuNSAxLjVoM2MuODI1IDAgMS41LS42NzUgMS41LTEuNXYtM2MwLS44MjUtLjY3NS0xLjUtMS41LTEuNXptMTAgMGgtM2MtLjgyNSAwLTEuNS42NzUtMS41IDEuNXYzYzAgLjgyNS42NzUgMS41IDEuNSAxLjVoM2MuODI1IDAgMS41LS42NzUgMS41LTEuNXYtM2MwLS44MjUtLjY3NS0xLjUtMS41LTEuNXoiLz4KICAgIDwvZz4KPC9zdmc+Cg==" alt="Discord Bots" title="Discord Bots">
How can I convert this image data directly to an svg?
wait
.addField(`Çekilişi Kazanan`, `<@${message.guild.users.cache.random().id}>`, true)
i dont know if have any differents
try with users too
Open the source directly in your browser and press Ctrl + S
Thanks
hi, is it possible to host discord bot in more than 1 physical machine?
Through sharding, yes
php ?
Let me get the docs
https://docs.top.gg actually has a pre-built webhook in each of four major languages.
Check in the libraries section.
members = ctx.guild.members <- why does this only get me the bot and nothing else?
Im not sure what that is sorry
You need to have intents enabled.
So in your code, you're going to need to add intents.
This is what I'd do:
intents = discord.Intents(members=True)
Then find your line where you define client/bot, and add the intents part.
client/bot = commands.Bot(command_prefix = "prefix",intents=intents)
Make sure to enable the members intent on https://discord.com/developers for your bot.
tysm
No problem
Just post your problem and someone will surely help
hi
its about my bots biography
i want it to show how many servers my bot in
hey? @fervent hornet
help me pls :(
its top.gg not discordbots.org
idk seems like a backend issue
yes
I have seen
seems like a server side issue
lol
It's been moved to https://docs.top.gg/
Use the API.
That's the API docs.
Since the docs is now on GitHub
you can't get your tokens from there anymore
So wait ig
you can find your bots api token you can find it by going to your bots page, clicking edit and going to webhooks
yeah
link pls
they should make it redirect to the new docs page lol
what did I just say
"that sign can't stop me because I can't read"
smh link
nothing
go away
bruh
ahah funny boy
@marble juniper hows google for the past 3 hours
im not using google rn im just on mobile lol
my pc just has discord open as well



