#development
1 messages ยท Page 1728 of 1
a json db is a gateway drug to corruption
actually, no, it doesnt
json db is a squirrel on cocaine
didnt spot that it was a basic command handler
ok
jack
want an honest cruse truth?
before you go too deep into that?
wanna try something new and kinky?
i mean something that WILL require a little bit of a curve, but will save you on code
the stuff you trying to do is literally 2 lines in detritus
k
check this
actually
yeah read the whole thing, if you arent satisfied by the end of it, i'll give you a hand the way you want it rn
its just that this is a lot simplier
kk
thats what i mean
the stuff you want to do is supported by the library
so no need to code it yourself
@crimson vapor shush
come on not again
always again
im not letting another poor sheep going into discord.js and getting bent over cuz of their shit code
detritus has literally everything they would want in a bot
reaction collectors
i already talked to cake about that
@opal plank anyways I don't really know how bots on twitch works but isn't it kind of unfair to compare latency for two bots that run completely differently? and by that I mean for example those bots could be running on many more channels (if that's how bots work)
i didnt reeally understand
imagine this:
you have one wheel and some metal scraps
you need to go uphill somehow, but you can't use your legs
good luck
ok
that sounds horrible
it's worse than it sounds
ok so
twitch chat isn't even that sophisticated at all
just a text-based irc chat
no fancy stuff
hell you can't even delete or edit messages
It's funny how in perspective of Discord, everything else seems so.... primitive.
not really since my scale is the same on theirs
at the time of testing, i was running at 97% of twitch's GLOBAL traffic, looking at around 3.4 MILLION viewrs
then have remorse afterwards for not choosing organization on the beginning
I just assumed it wasn't based off the repo stats my bad
./onefolder/anotherfolder/afolder/ohafolder/file.js
omg
}
exports.help = {
name: 'recent'
}```
see this
fs.readdir('./commands', (err, files) => {
if(err) return console.log(err);
let jsfile = files.filter(f => f.split(".").pop() == 'js')
if(jsfile.length == 0) {return console.log("Could not find any commands!")}
jsfile.forEach(f => {
let props = require(`./commands/${f}`)
bot.commands.set(props.help.name, props)
})
})
see this
/commands is the folder name
yes
which gets inside the folder any code\
i dont know how to do that for 2 folders
i dont know how to dup the code
i tried it doedsnt owkr
you don't need to dup the code
const fs = require("fs")
bot.commands = new Discord.Collection();```
THOUGH there are some variables that i was called out for in the forums, that includes server proxmity
readdir will also return the folders inside /commands
then what do i do
but even accounting for that mine would've still gone ontop
all you need to do is open those too
the same way you did there
just add a check to see if it's a file or a folder
if it's a folder readdir it
i dont know how
this is indeed true, we dont give discord enough praise for everything it has done for us devs, we like to complain a lot 
oh I wasn't really talking about dev-wise
all you need to do is check if the file is a folder or an actual file
just... y'know... feature-wise, period.
oh i see
i dont know how man
i can teach you no problem
Ok
good night mr. salesman
wht do you have so far?
nothing as in what u sent me
i assume an index.js and a bunch of commands in folder with module.exports
i eman, sure, why not, im already buzzed
@opal plank made just for you

Currently failing to find out why FindRole is undefined even when I test it with "MyTestRole" with a role named "MyTestRole" in discord... ```js
for(i = 0; i<args.length; i++) {
let FindRole = message.guild.roles.cache.find(r => r.Name === args[i])
if(typeof FindRole === undefined)
{
guild.roles.create({
data: {
name: args[i],
color: 'GREY',
mentionable: true
},
reason: 'creating roles for WaffleBot reaction roles.'
})
} else {
}
}
console.log(FindRole)
node:1948) UnhandledPromiseRejectionWarning: ReferenceError: FindRole is not defined
Nvm, I didn't wrap my undefined in quotes
mmm little nightmares 2
This just started happening whenever I open the VScode integrated terminal, not sure why. It makes me restart the pty host every time I want to use the terminal. Anyone know a solution for this?
if i use this code to shard will it auto create shards when they are needed?
const manager = new ShardingManager('./bot.js', { token: 'your-token-goes-here' });
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();```
const guildConfig = await GuildConfig.findOne( { guildID: message.guild.id });
const prefix = guildConfig.get('prefix');```
hey is this mongo spamming?
because ts sending a request to find one every time a message is sent. so is that spamming? or spamming doesnt exist and you can request as fast as flash?
probably a good idea to cache results in memory.
assuming you are using a local install of mongodb, you can spam it all you want, but its generally going to be a waste of resources if you can just cache it.
๐คจ
a=b means make a's value equal to b. a===b means is a's value and type the same as b's value and type
If there is no specific user in a server, then How to return;
Or channel topic
@steep drum @solemn latch
Help please
please dont ping users for help.
if (message.channel.topic === "welcome") return;
this will return from the current function if the topic is welcome.
Is there an event, when the bot joins a server [for the first time]?
Like. if you want to send a message to the server when the bot joins the server
djs?
Defaultchannel
Or guild owner
?
I'm probably in the wrong channel, but does anyone maybe know how to send server count to top.gg like some of the other bots? i want to make my bot's server count appear on the page but i'm not really sure where i can do that and what's the process...
you can use our api.
https://docs.top.gg/
theres a few libraries that can make it easier.
Oh okay! But where would i search in the API? like, do you know what the action is called?
i mean theres only like 4 features on the api, but yeah.
https://docs.top.gg/api/bot/#post-stats
ooh sorry i'm a bit braindead lol
i'm a bit new to bot development still, even though i've been working on bots since 2019... okay, i will try this thank you very much!
HI
I want the bot to remove the role from the person who received the role
how do i create an uptime command?
Use database then on join check if the server is newly registered
And If I want to send a message everytime my bot is added on a server. Not only the first time?
Oh then just use the guildJoin event
Someone told me, its the 'guildCreate' event
Nvm it's guildCreate I'm an idiot
If you just want it for the first time then db is a go but otherwise just use guildCreate
oh ok,
client.on('guildCreate', async (msg) => {
msg.channel.send("test")
})
Does this work when I do it with (msg)?
so the bot sends a message to the channel, where he was invited to
It can't detect the channel I believe but I may be wrong
I would just get the default channel if it exists
Idk though I don't do that
when i execute c!uptime it doesnt send an uptime response
How can I do when I reply to my bot then he send message?
is it possible for a bot to set themselves as a speaker in stage channel automatically on join?
Are you familiar with HTML and CSS?
cn yoi explain
Do you know HTML and/or CSS?
You'll need to get familiar with both to be able to do it without any problem
some example bro
i need like this @slender thistle
thats CSS mate
how i need that type background
CSS
also this type
pls give some example
dude learn CSS yourself
wait
dude just learn css
0k
theres tons of videos on youtube
P.S. the selector you will need is .entity-wrapper
this
Which one is better when bot goes bigger, MongoDB or SQL?
no difference, what matters is how you design your database structures
OK, Thanks! ๐๐ป
sometimes my bot crashes with no errors
Iโm not a very experienced Discord bot dev, but a lot of web devs move to PostgresSQL when deploying on production due to the performance it offers. Itโs a lot less flexible though.
Hey all, so I am having this leaderboard command and in line 68, I have this code:
embed.addField(`${i + 1}. ${res[i].name}`, `$${Math.floor((res[i].money + res[i].bank)).toLocaleString()}`);
.. unfortunately, when someone is having money 0 and bank example 1000, he goes at the end of the leaderboard.
I tried playing with the sort like:
.sort([
['money', 'descending'],
['bank', 'descending']
]);
.. but got kind-of lost, any help?
https://srcb.in/9SAmgLV7If
you can still sort it... res is your array right? Instead of sorting it via mongodb, use the array.sort method. res.sort((a, b) => (a.money + a.bank) - (a.money + a.bank))
b
oop
What can I do with this then?
embed.addField(`${i + 1}. ${res[i].name}`, `$${Math.floor((res[i].money + res[i].bank)).toLocaleString()}`);
keep it as it is
you want to sort them by total from money plus bank?
Yes.
then you have to combine the values before sorting
check if mongo can do a combined sort
it can't
That's the same thing as before
you can't...
Yeah, I don't think...
I showed how you can sort them via js though
Ok.. let me try.
๐ฎ

yeah mb
yeah megabits
I'm trying.. momment.
to get the total amount in both I did do let total = amount.bank + amount.hand
That is what I did, but it sorts it descending for money only, that's my problem.
This worked, but upside down.
then switch a with b
Moment.
I dont have a leaderboard command for economy but I have an XP one and it starts with this
let user2 = user.sort(function(b, a){return a.totalXP-b.totalXP})
Yes, same as above.
Wait, I switched the first a.money with b.money.
๐
.. and still worked.
It's the same, I believe so.
a, b.. b-a and b, a.. a-b
same thing
hey!
why can't it read property roles of undefined?
const allItems = fs
.readFileSync("./levels.txt", "utf8")
.split("\n")
.map((x) => x.split(/ +/));
let filtered = allItems.filter((x) => x[0]);
let final = filtered.map((x) => x[1]);
let haha = filtered.map((x) => x[0]);
console.log(haha)
const french = Math.max(...final)
let reverse = allItems.filter((x) => x[1] === `${french}`);
let finalreverse = reverse.map((x) => x[0]);
let m = finalreverse.map(name => client.users.cache.find(({ username }) => username === name))
let z = haha.map(name => client.users.cache.find(({ username }) => username === name))
const vip = await guild.roles.create({
data: {
name: 'MB10',
color: 'BLUE',
},
reason: 'role for the game attenders',
})
for (const names of haha) {
let k = guild.members.cache.find(member => member.user.username === `${names}`)
k.roles.add(vip)
const botrole = await guild.members.fetch('555955826880413696')
const botrole2 = await guild.members.fetch('749820490926784615')
botrole.roles.add(vip)
botrole2.roles.add(vip)
} )```
k is undefined, member is not cached or doesn't exist
hmm strange
jesus these variable names
yup i know
is it maybe because i am checking for usernames
but some member also have nicknames on the server
Show your CSS code
possibly... are you sure names is valid?
I would recommend to fix some of that grammar btw. Attracts more people
yup pretty sure as it did work for me
with no nicknames
ok
then it's not cached, you can fetch it if it's not cached, and also check if the nickname matches too
there are different nicknames in the server
i guess that is why it was erroring
so i can try to fetch it?
wait no
.entity-content {
width: 100%;
hight: 100vh;
overflow: scrool;
overflow-x: hidden;
background: url('https://images-ext-1.discordapp.net/external/KbN4LwJVhqe7dG-Avqf-N13gNAEm_TV8T6caMgpcFlk/https/i.imgur.com/2za7yG7.jpg');
background-repeat: no-repeat;
background-size: cover;
}
it is not using the nicknames
it is just matching the usernames
wrong move there bud. Don't ping.
.entity-content is not the entire page, so, that's why the background is not full width. Did you want to make affect body { instead?
Hey thanks but I can tell people myself if I don't want to get pinged, don't minimod for me, aight? kthx.
sure lol. I was just told to never ping users in this channel. Especially the higher-roled users.
Why are you using ext?
I'm not a high-roled user, and I'm fine with getting pinged, just like you did. To each their own.
its fine if you ping people if you have a real reason
last I heard people said to change from body to entity-wrapper
How do I make the little fake bots like this

this is full
base__Flex-sc-1f9zlm1-0 base__Column-sc-1f9zlm1-2 page__PageContent-iv577v-1 jLvxNO zUNGP llbETX
Idk what they're called ffs
do you mean webhooks?
yeah they're called webhooks
Oh
take away hook, now you are spiderman
though the [bot] part is actually a "pill" usually. or a label.
Dude I'm not even sure I understand what your question is to be honest
I sure as hell don't
wht cnt come in full isn't... I don't know what this means
sounds nasty
I think it says what can't come in full
yeah ok but do you know what that means, then?
So yeah good we're all agreeing no one knows what that means. 
The background doesn't cover the whole page
why does the background not fully cover the bot page ig
y'all are making assumptions
reason why I said ig
pretty sure that's it
when you ASSUME you make an ASS out of U and ME


ok?
ok
really good
cn pls give me html code of image uplod
pls
What
The HTML element represents a document section containing interactive controls for submitting information.
class guild{
constructor(main){
this.main = main;
this.cache = main.cache;
}
static fetchGuild ...
static deleteGuild....
}
module.exports = guild
When I do new Guild() with requiring the upper code, it does not have the functions like deleteGuild....
Bot's can still create their own guilds?
yes
iirc they can if they are in less than like 10 guilds
what are you trying to do?
wdym
create a guild using my bot
it would be cool to test
I have a master file, which has understructures.
But I can paste all functions on the master file, bc it would be to much
Thats why I am doing understructures, but they should have access to the master properties...
doesnt the bot have to be in less that 5 guilds
ten
but what are you trying to do with a guild?
idk if its 10 or 5
oh ffs. im dealing with a mission critical production system atm, where if it goes wrong, someones in LEGAL trouble.
and it has TWO FIELDS in a customer table. a date of birth field, and an AGE FIELD.... that isnt even a calculated field, and get this, its a signed integer...
the class name is guild, ignore it
there arent enough facepalm emojis on discord for this bollocks
just calculate the age ffs
ok then its erroring because if you don't pass main then main.cache isnt a thing
if thats what you mean
I am doing this in my master file static guild = new Guild(this); but it can not acess the functions like fetchGuild...
why are you using static for a declared variable?
your linter should be mad
you can't access this without using the constructor
Editing stuff in my dB so me and my friends can have unlimited money is fun
also you should be linting
where do you work if you don't mind me asking
nsa
*nda
the main file should get all functions of the guild class and the guild class must have access to the main files class.
then stop using static
static isn't what you want if you want to be able to access this in any of the functions
if you make static functions you might as well just export an object
anyone know how to change the color of embed.set_author
uhh ill try
i set a color in the discord.Embed parameters but pretty sure thats not the same thing
I'm looking at the API reference and set_color isnt a method
Python or Javascript
hey
channel1.send("Party leader, copy and paste this following line in this channel:")
channel1.send("`"+`${result}`+"`")
fs.writeFileSync("./levels.txt", '')
.setTimeout(() => {
message.channel.send("Use +rep @user to commend other players!")
}, 60000);
client.on('messageReactionAdd', (reaction, user) => {
if (reaction.emoji.name === "\u2620") {
channel1.send(`${user} is ready!`)
}
})
.setTimeout(() => {
vip.delete()
channel1.delete()
return 0;
}, 600000);
why can't it read property settimeout of undefined?
it's the first timeout
uhhhhh writeFileSync doesn't return anything
why is there a dot there
you can't... setTimeout isn't a property of anything...

Also still fucking trying to do a txt/json database, are you
god you're such a stubborn idiot, I don't understand why you're still on this.
Im using python
You cannot change the color of anything in the embed except the left bar.
^
oh so you're allowed to change it in other languages?
no
Discord Embeds do not support changing colors of anything except the bar on the left, period, in all client languages
not sure where you got the idea it was possible
Unless it's slah commands, all langs currently do it differently it seems
That isn't the normal Discord client
someone is hacking/modifying their client which breaks the terms of service
unless tha'ts just... hold up isn't that just a normal link
that blue looked different
look at the URL part of set_author
if you hover it it is a link
yeah ok so it's a url, not a color.
i set a URL in set_author but its just a bolded white
ill try the www.
mine was just https://link.gg basically
I found a great domain name for sale. Check it out!
lol so just like that blue right there in the embed? 
show your code
And also are you 100% sure the screenshot you have, which you're trying to reproduce, is using the author?
because... it could be literally just using a field value
or, even, the description
both of which support markdown links
Could be an emoji with bold link
what do you mean by the author
I mean
The author won't be blue
yeah I don't know these things by heart so probably not the author
it could be just the description or field value
are you allowed to change the set_field colors?
basically all the titles were blue as well
the description, yes, by adding a markdown link
[https://url.blah.com.whatever/](this text will be shown instead)
This only works in the field values (not the title) or the embed description, though
I guess it's the other way around
you got it backwards

[this text](https://the.url)
yes... actually that looks better, absolutely.
haven't finished my first coffee yet
Last time they somehow made it supported in messages on mobile
It was a bug they said later. Though it was fun to nuke ppl to rickrolls
aight ill try it for the descriptions
pls give code
what code
don't ping people then delete the ping. that is ghost pinging and it's really really fucking annoying
thx
it's useless btw
bruh
so there are no init command for python?
liek init is just a lib
I meant a built-in
Python only needs 2 files
main.py
requirements.py
and sometimes you don't even need the second
hmmm lemme google the req.py
@near stratus btw how I can check does d.py is installed?
cuz there are no folders like libraries
or something like that to store the files of that lib
.entity-wrapper {
background-image: url("https://the url");
}
this
oh python installs them globally
bro
this image
codes
put the fucking image link in that ccs I gave you
lol
Well it's not easy to say.
Like you don't have to install them at every project so it's efficient
But it's hard to set up a perfect sandbox since you need all the modules pre installed
see not full
so yeah a lots of diffrents
background-repeat: no-repeat;
^^^
And I moved from Py to JS
Also background-size: cover; maybe
no size full
Hi
@earnest phoenix
I cant see my bot s avatar on top gg what should i do
thx
I'm currently doing some research on how Discord bot developers get insights on basic statistics of their bots. Do you guys use any tools for this or build custom panels / systems for this?
@earnest phoenix You could try background-attachment: fixed;
mean
you really gotta check that grammar tho
my english is not good
sevrver
modration
fetures
use google translate. All those grammar mistakes won't attract members.
ok
how transper description
in top.gg
"go to google translate"
"ok"
instantly replies with "transper"
did you really get what they were saying?
๐
yup
aight

This guy died yesterday
really
Yes really hahhaa
he was meme king
He was
rip
for some reason its not getting the 50
I wish that when a role is added it would be removed, but it would be removed for other things
const { MessageEmbed } = require('discord.js');
const message = require('./message');
module.exports = async (client, member) => {
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('./db.json')
const db = low(adapter)
const entry = await member.guild.fetchAuditLogs({type: 'guildMemberUpdate'}).then(audit => audit.entries.first())
let guild = member.guild.id;
if (db.get("antiroleadd").find({ guild_id: guild }).value()) {
if (db.get("owner").find({ user_id: entry.executor.id }).value()) return;
if (db.get("wl").find({ user_id: entry.executor.id }).value()) return;
let role = member.roles.highest
member.roles.remove(role.id).catch(e => console.log(e.message))
const embed = new MessageEmbed()
.setDescription(`A role was added\nI removed it because the antiaddrole is activated!`)
.setTitle(`:warning: Rรดle added`)
.addField(`:dagger: Moderator:`,"```" + entry.executor.tag + "```")
.addField(`:inbox_tray: Receiver:`,"```" + member.user.tag + "```")
.addField(`:information_source: Rรดle name:`,"```" + role.name + "```")
let wlogs = role.guild.channels.cache.find(channel => channel.name === "protect-logs")
if(!wlogs) return
wlogs.send(embed)
}
}```
@earnest phoenix I don't understand the explanation of what you are trying to do
Itโs a security bot to prevent a person from adding a role to someone without being in the bot whitelist
Okay so what is the issue with the script you just posted? Any error messages or anything?
goal is that it withdraws the role when it is added, but in this event (memberguildupdate) I think it detects something else
How did you change backgroun wallpaper ?
Hello I have a problem with ytdl when I use my play command downloader he only half a song?
async def player_loop(self):
"""Our main player loop."""
await self.bot.wait_until_ready()
while not self.bot.is_closed():
self.next.clear()
try:
async with timeout(300):
source = await self.queue.get()
except asyncio.TimeoutError:
return self.destroy(self._guild)
if not isinstance(source, YTDLSource):
try:
source = await YTDLSource.regather_stream(source, loop=self.bot.loop)
except Exception as e:
await self._channel.send(f'There was an error processing your song.\n'
f'css\n[{e}]\n')
continue
source.volume = self.volume
self.current = source
self._guild.voice_client.play(source, after=lambda _: self.bot.loop.call_soon_threadsafe(self.next.set))
self.np = await self._channel.send(f'**Now Playing:** `{source.title}` requested by '
f'`{source.requester}`')
await self.next.wait()
source.cleanup()
self.current = None
try:
await self.np.delete()
except discord.HTTPException:
pass
def destroy(self, guild):
"""Disconnect and cleanup the player."""
return self.bot.loop.create_task(self._cog.cleanup(guild))
hey guys: ```js
if(message.content.startsWith('+rc')){
let reputation = JSON.parse(fs.readFileSync("./reps.json", "utf8"));
let target = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
if(!target){
let userInfo = reputation[message.author.id].reps;
message.channel.send(**You have: ${userInfo} reps!**)
}
if (!reputation[target.id]){
message.channel.send("This user has no reps yet!");
} else{
let userInfo = reputation[target.id].reps;
message.channel.send('**The user you pinged: **' +"<@" + target.id+ ">"+`** has: ${userInfo} reps!**`)
}
}
I know it is because of the startsWith, but i know no alternative.
no response from the bot when you do @ user ?
that should absolutely work fine though
please help me ๐
it does
but there is no response when i use +rc
with no user behind it
to check my own reps
no I mean '+rc'.startsWith('+rc') definitely returns true though
how change text color in discord
I dont see how its not responding
so you're saying it's not running this part? ```
let userInfo = reputation[message.author.id].reps;
message.channel.send(**You have: ${userInfo} reps!**)
and you don't get any errors in console???
Do you know if it's running that code?
yup exactly
impossible. Literally impossible
yeah i can do +rc @ user and it will work fine
Like actually physically not possible for this specific code to not do something
So either you:
- didn't save the code
- didn't reboot the bot
- are looking at the wrong file
- are globally catching and silencing all errors
That doesnt make sense
I wish that when a role is added it would be removed, but it would be removed for other things
const { MessageEmbed } = require('discord.js');
const message = require('./message');
module.exports = async (client, member) => {
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('./db.json')
const db = low(adapter)
const entry = await member.guild.fetchAuditLogs({type: 'guildMemberUpdate'}).then(audit => audit.entries.first())
let guild = member.guild.id;
if (db.get("antiroleadd").find({ guild_id: guild }).value()) {
if (db.get("owner").find({ user_id: entry.executor.id }).value()) return;
if (db.get("wl").find({ user_id: entry.executor.id }).value()) return;
let role = member.roles.highest
member.roles.remove(role.id).catch(e => console.log(e.message))
const embed = new MessageEmbed()
.setDescription(`A role was added\nI removed it because the antiaddrole is activated!`)
.setTitle(`:warning: Rรดle added`)
.addField(`:dagger: Moderator:`,"```" + entry.executor.tag + "```")
.addField(`:inbox_tray: Receiver:`,"```" + member.user.tag + "```")
.addField(`:information_source: Rรดle name:`,"```" + role.name + "```")
let wlogs = role.guild.channels.cache.find(channel => channel.name === "protect-logs")
if(!wlogs) return
wlogs.send(embed)
}
}```
not sure why, but after a pm2 restart the code worked.
hey nice
eventhough i restarted it before too
you hadn't restarted. lol
@earnest phoenix you need to explain what your issue is too. Just posting the code won't do much
strange, idk what happened maybe i made changes to it before that messed with it
anyways, thank you once again.
@earnest phoenix guildMemberUpdate provides two members. oldMember and newMember . compare both member's roles to know if a role was added (newMember.roles.cache.size is larger than the old member's) or the contrary
guildMemberUpdate also includes nickname changes
true. so if they're identical in size, roles haven't changed
Also, and I'll say this again and again and again until you finally break down and change your code:
STOP USING TXT AND JSON FILES AS DATABASES
stop. please. I beg of you.
on my knees
It hurts
nah let them do it :^)

They won't 
Ah! Do anyone know why it shows invalid-user?
It hurts my soul
because Discord cache sucks
They're already a lost cause
I used webhook to send the message
Yep
Let them be
Or, if it's not because of cache, it could be because the user isn't even in the guild
I have no idea how to do that 
It will only 100% if user is in that chanbel
No no both time it was me
Otherwise it's hit or miss
most times embeds on mobile dont show the actual user
you don't know how to compare 2 numbers?
I guess they never miss huh
I used webhook to send the message
๐ฅด
webhooks or no doesn't make any difference tbh
oh ok
embed mentions in mobile have historically always crapped out
So if it's something related to Discord cache how do I prevent it?
Damn! That hurts in my korokoro
Or, don't try to mention users in embeds. Use tags, or mention them in the message content instead.
I'll just use full name
how can we make more then 2 clients online with 1 code
But then again I used webhook
ยฏ_(ใ)_/ยฏ
Make 2 clients?
What I simply did was `!@597664623780691978
use worker or child
2 tokens/bot online
Yes?
Then?
It's safer to use <@! since <@ is being deprecated
yes or a client array
Oh?
Isn't it the other way around
I think so
@worn sonnet
@worn sonnet
I have no clue, it's one way or another
So two ways
discord is still inconsistent with their client
One <@> other <@!>
I think <@! is being deprecated
Umm... The question was..
I get the userID from Top.gg webhook
Any way to get the user without bot?
I use python
They use <@id> in their docs
And lib i use to execute webhook is discord-webhooks
<@! then I guess
I mean I wanna send the username+discriminator in embed
user.tag?
h4ck3r_x#7541
on_message for discord.py just stopped working, anyone else?
no changes or anything
I don't run bot in that code
๐ค
I use a webhook lib which sends it to the server
The only option I see RN is run the two instances of bot
you don't even need a bot running
you just need the bot token and fetch the user object through REST
Yeah that's what I meant
Where is this from
How do I do that if a video weighs more than 5 MB it is not sent?
how remove this line
I believe you will receive Entity Too Large error
@pale vessel
puppeteer?
Yes
go all the way
and Selenium for Python iirc
actually GO
GO away
golang is great for microservices for scrapping
and pretty much shit for anything else
Any language really
@sudden geyser Happy birthday ๐ฐ
A bit late but ty
Was just looking at your status oof
if(message.content.startsWith(`${config.prefix}ATC`)){
const args = message.content.split("\n")
.map((x) => x.split(/ +/));
console.log(args)
if(!args[1]){
message.channel.send("**Please atleast input a name for your collection!**")
return 0;
}
if(!args[2]){
message.channel.send("**Please input one link to add to your collection!**")
return 0;
}``` uhhm why does it keep saying please atleast input a name for your collection?
why do you split with a \n?
to remove blank spots
y not just do if(!args[1]) return message.channel.send();
You have an array of arrays
doesn't even know \n means "line return" .... 
i know what it does
no I mean Awsome doesn't
oh
args[0][*] is what you need to inspect
no because they do not filter out the command or prefix look at the ss
its args[1]
no i am checking for the name args[1]
wai
t
i reread
he is right
because u have 2 arrays
1 array inside another
so if you want to check for args[1] it has to be args[0][1]
Is you don't care about new lines, you should just replace new line with space. Then split on space
No need to replace them
I currently have this code: ```js
FindRole = message.guild.roles.cache.find(r => r.name === args[i])
If you do care to preserve information about new lines. Then you need to adjust your inspection anyways to look through the entire array, you can't just look at args[0]
You don't need to. Use r.name === foo || r.id === foo || r.toString() === foo
is it look good
oh, thanks!
rather try to fix that grammar than the background mate.
use google translate
sir cn you help me
with what
cn you write my description in good grammer
wtf
?
never heard of translate.google
De gratis service van Google kan woorden, zinnen en webpagina's onmiddellijk vertalen tussen het Engels en meer dan honderd andere talen.
it cnt help because my language cnt retan in text
The text is barely visible in some places
I suggest adding a gray background to the description
your bot name
well translate has that language
so you can easily choose that
Why do you need my bot's name?
are you google translater owner
then you leave your bot description full with grammatical problems
This isn't the place to fight about language. Leave it
idgaf. i was just giving a tip.
i want see your bot profile
i am not man.
read the text above
thx
you didn't get the message i guess
i only how it looks
not say see my language mistakes
De gratis service van Google kan woorden, zinnen en webpagina's onmiddellijk vertalen tussen het Engels en meer dan honderd andere talen.
use this please
I don't have any customized style on my bot
I don't even have a listed bot that would need styling
meanwhile me waiting for approval
hello guys
i want the bot give the member's role's when they authorizing the bot
You wanna give a role ?
Or show his role ?
When he authorize the bot
and added him at any server
the bot check if he do it or no
if he do it
he give him a special role
I guess you'll need oauth2 to check who authorized the bot
And trust me That's not explainable in a chat
In oauth2 check the username thing.
Redirect to your domain / ip:port
When redirected
Get the token
Use the token to get name#discriminator
Then find user with that
U could add their id to a database when they authenticate and when they join your server give them the role
yup
but how could the bot now ?
who has authorized ?
Know what
py
Follow this
In oauth2 check the username-avatar thing.
Redirect to your domain / ip:port
When redirected
In the request
Get the token
Use the token to get name#discriminator
Give role with that
okay, i'll try it
now should i copy all the code's and paste it into a new project ?
const ReactToMenu = await message.channel.send(MessageMenu)
let ParsedReactions
for(i = 0; i<args.length; i++) {
ParsedReactions = message.guild.emojis.cache.find(emoji => emoji.name === Reactions[i])
await ReactToMenu.react(ParsedReactions)
}
``` Reactions is defined as ```js
let Reactions = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight']
``` but it keeps throwing an error `(node:15664) UnhandledPromiseRejectionWarning: TypeError [EMOJI_TYPE]: Emoji must be a string or GuildEmoji/ReactionEmoji`, anyone know why?
For some reason, ParsedReactions is getting logged as undefined. Are these emojis considered unusable? (1๏ธโฃ 2๏ธโฃ 3๏ธโฃ etc)
huh
I'm not exactly sure what you are saying, but it looks like you are returning a promise object. You have to look into using asynchronous functions with async and await.
yall know why my bot code wont work
What's it doing? Error?
yeah python error crap
looks like you didn't pip install discord
or whatever it is you do to install stuff in python
ok? that's your editor, and it doesn't change the fact that to use an external module, you need to install it
seems like you missed https://discordpy.readthedocs.io/en/stable/intro.html#installing
node.js?
it's right there on the page
do u use node.js?
Why does it matter right now
You seem to be extremely easily distracted by irrelevant things.
i have ADHD
One message removed from a suspended account.
That's not an excuse
One message removed from a suspended account.
Don't lose your braincells over this evie
i get distracted easily
One message removed from a suspended account.
One message removed from a suspended account.
Run that in cmd
How
that's literally what I said earlier ๐
Okay show
Did you?
how about
https://discordpy.readthedocs.io/en/stable/intro.html#installing what's written here
Cmd
i used cmd
Thats powershell
One message removed from a suspended account.
Powershell isn't even close to cmd
yes
That's like comparing a car to a bicycle because "they have wheels"
One message removed from a suspended account.
One message removed from a suspended account.
Lol
ok show us
One message removed from a suspended account.
I feel like he doesn't have python installed

One message removed from a suspended account.
One message removed from a suspended account.
shutup
One message removed from a suspended account.
I'm sorry you really should start with learning the language before you attempt to write bots for the first time
One message removed from a suspended account.
nope
seeing as though you clearly don't know any python, you need to take the time to at least get the basics first
One message removed from a suspended account.
One message removed from a suspended account.
just got the wooden spoon
One message removed from a suspended account.
One message removed from a suspended account.
"Don't bite the hand that feeds you"
if i disrespected parents i got wooden spoon
One message removed from a suspended account.
One message removed from a suspended account.
๐ฅ
my english isnt good so sorry if bad english
go learn python
One message removed from a suspended account.
Anyone able to help out with this?
const ReactToMenu = await message.channel.send(MessageMenu)
let ParsedReactions
for(i = 0; i<args.length; i++) {
console.log(Reactions)
ParsedReactions = message.guild.emojis.cache.find(emoji => emoji.name === Reactions[i])
console.log(ParsedReactions)
}
``` My Reactions array is defined earlier in the code as ```js
let Reactions = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight']
``` My problem is that `ParsedReactions` keeps logging as `undefined`. Am I using a deprecated method or something?
so making fun of people with a diff language when there trying to communicate with people who speak english
One message removed from a suspended account.
stop telling me what to do
You asked for what to do?
You came in here acting arrogant and told people to shut up
can a discord bot be made in xcode (imac)?
One message removed from a suspended account.
oh ok. thanks faith!
One message removed from a suspended account.
ok
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
the only thing worse than coding on mobile is oreo with beans
Could anyone try making my discord bot go online so i can test whether it works or not?
One message removed from a suspended account.
One message removed from a suspended account.
dont have access to pc atm
One message removed from a suspended account.
that'll be a while lmao
if i use this code to shard will it auto create shards when they are needed?
const { ShardingManager } = require('discord.js-light');
const manager = new ShardingManager('./bot.js', { token: 'your-token-goes-here' });
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();```
looks like the default sharding manager code. it should make a shard for every 1000 guilds automatically yes.
How do I find an emoji by name? ```js
message.guild.emojis.cache.find(emoji => emoji.name === 'one')
that only works for custom emojis
oh
\1๏ธโฃ
ain't discord's recommended value 1500?
it might be
not only for mobile platforms and it supports C, C++, Swift, OBJC and others
Is it still possible to find a default emoji by name? Or do I have to use the ID?
Just copy paste the unicode character
The emoji search engine. A fast emoji search experience with options to browse every emoji by name, category, or platform.
wrong url
alright, thanks
Is there a way i can make a command that will give a random number from 1 to 100 with discord.js cus in the docs i cant find anything about making a random thing like that. Thanks
discord.js is a library for making bots - you don't need discord.js to generate a random number
k thanks
Math.random() will give you a random number between 0 and 1 - multiply that by 100, round it and you have a ranom number between 1 and 100
incorrect. the best way to learn a language is actually doing something productive in the said language, so he could easily take a look at the example bots and start off by playing with that and understand. i dont believe in "go to w3schools and learn what is x=y"
Thank you
I typically dont tell people to multiply it, because youd expect them to know basic math and know to just multiply it.
kinda fun when they come back asking how to make the number bigger ๐
One message removed from a suspended account.
most people start off by editing something premade
also, theres like a million things easier than a discord bot, which is also useful.
One message removed from a suspended account.
discord bots are a great learning thing, just not one of your first like 3+ projects.
One message removed from a suspended account.
One message removed from a suspended account.
i said discord bots as example cuz at his level hes mostly doing it for fun
and when youre doing something actually like and want to accomplish
One message removed from a suspended account.
it makes it easier to learn
One message removed from a suspended account.
its actually harder to learn when your starting off with projects above your skill level.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
if you do a few projects before hand you can get a decent bot, with proper error handling and stuff in the first few hours.
not copy pasted code, or stolen code, or modifying code. but actually writing a bot.
there are people who did their first project as a bot here, and they have been programming bots for many months, and they still come on here and ask very basic questions sometimes because they tried to "skip" the basics.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
maybe im wrong but im speaking based off personal experience and my personal experience was with cpp

One message removed from a suspended account.
its lot harder
One message removed from a suspended account.
maybe ur right
i started python with dpy bot
but i knew programming in other languages before which helps a lot obv
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Most people just start off with what they want to build
But get too tied to it and don't learn new things
speaking of learning new things. learning how to use s3 ๐
One message removed from a suspended account.


meant to send this
