#development
1 messages · Page 1458 of 1
const str = `\`gay\``;
what is your code
ok
Let me paste on hastebin bruh
https://hastebin.com/xuhunopopu.js @earnest phoenix here
what
Its 2k+ char cant
Or send ScreenShot
Oh
Uh
people prefer using bin services
Ok
@delicate shore is that your own collector
why not just use the official one
wait what
lol
Probably easier to use awaitMessages for your use case
that too
It's not official
yes it is
it's native to the library, so yes, it's official
awaitMessages ?
Are you high?
He's talking about the class
the context here is discord.js, not multiple libraries
we understand it's discord.js that's being talked about
saying "use the official one" is equivalent of saying "use the official discord.js MessageCollector"
but that would be pleonasm
because we're aware of the context and our subject
Oh
Ok
start a petition to get a new english teacher
xD
I learn by myself
Wait
I'm the most advanced of my class
🤔
Hey
Is there a way to sort Collections
I want the keys in bot.commands to be sorted in alphabetical order
@pale vessel uwu
collection.sort();
does it work in the same way as Array.sort
Yes
🆗
Why my bot is not sending any message after asking a question?
@edgy tapir you're sending the embed wrongly
wdym ?
it's message.channel.send({ embed: p}); not message.channel.send({ p });
oh
See line 41
i haven't code since v11, lot's of things changed
but other commands work with just message.channel.send(embed)
@edgy tapir because there are no braces
..
or message.channel.send(p)
@edgy tapir
this:
let result = Math.floor((Math.random() * raspunsuri.length));
It literally just returns a number not a random element from the array
(Doesn't have anything to do with the embed not working)
Ok, but why the bot is not sending any message?
@pale vessel
no error
My code is
let channel = reply.mentions.channels.first().id || client.guilds.cache.get(reply.content).id || reply.channel.id
Bruh
Screenshot cropped wrong way
Here
uhh how da fuk is client.guilds.cache undefined
Idk
@delicate shore u sure that's discord.js v12
Yes mate

12.5.1
are you sure that's where the error came from
Yes
What happened to guildMemberAdd it doesnt work for me but it worked before and I didnt touch the code
You need the guild members intent to receive that event
ty
if(message.content.includes("@feral aspen")) {
if(message.guild.id !== "721372685275234436") return;
const muterole = message.guild.roles.cache.find(role => role.name === "Muted")
const mutee = message.author;
mutee.roles.add(muterole)
const embed = new Discord.MessageEmbed()
.setColor(colors.cyan)
.setDescription("You have been muted for pinging the owner.")
return message.channel.send(embed)
}
```Im trying to make something where if someone pings me on my server, it returns.. didn't work.
I sorted my commands by basically cheating
bot.commands.sort((a, b) => {
let arr = [a.name, b.name];
arr.sort();
return arr.indexOf(a.name) - arr.indexOf(b.name);
});
@feral aspen use message.mentions.users.first()
aaaaaaa I know how to type what does guild members intent mean
Go to your bot developer portal
@feral aspen rude you're muting people for pinging you
No, I'm not making a mute command, I'm making a message event where if someone random goes to ping me on my server, it would mute him by adding him the mute role, but it doesn't work...
Mind helping?
@pale vessel wat do you think of this

Why would I need args?
This is mine
I'm not trying to do something like !mute <user>
client.commands.sort((x, y) => sortAZ(x.name, y.name))
code913, you can help please?
I don't need args for the message, man.
I want to do something like if someone random pings me, he will get muted.
it is not an args
it is message's mentions collection
you can find your id in this collection
:slap:
slap moot kek
I'll try above.
It yet didn't work to mute.
if(mentions.has("@feral aspen")) {
if(message.guild.id !== "721372685275234436") return;
const muterole = message.guild.roles.cache.find(role => role.name === "Muted")
const mutee = message.mentions.users.first()
mutee.roles.add(muterole)
const embed = new Discord.MessageEmbed()
.setColor(colors.cyan)
.setDescription("You have been muted for pinging the owner.")
return message.channel.send(embed)
}
I don't get the point why you want to mute people for pinging
You're the bot dev of course people will ping you for help
Replace mentions with message.mentions
and use your ID, not your mention
Just 528256079101034506
@pale vessel message.mentions.users bruh
smh
I wonder if you can throw it from the v12 help menu special?
@feral aspen did you read dis
And I'm not only wanting to do mute, I want it to make send a message example don't ping owner or somthing
even the team members and mods here of this 140k members server have ping notifs enabled
Can someone explain the new "slash commands"
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Yes they are pretty easy
DM a mod
how to refresh cache?
which cache
how would i be able to get discord.js to send a message to a specific channel via its id when a user joins the server?
use this event https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildMemberAdd
to get the channel
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=channels
https://discord.js.org/#/docs/main/stable/class/ChannelManager?scrollTo=cache
call get(id) on the cache property
Ok guys
[
{
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
},
"href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
"id": "5a2w2tgpLwv26BYJf2qYwu",
"name": "SOPHIE",
"type": "artist",
"uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
}
],
"duration_ms": 188520,
"episode": false,
"explicit": false,
"external_urls": {
"spotify": "https://open.spotify.com/track/18yTgk0VgjB9XDj8h2q6Td"
},
"href": "https://api.spotify.com/v1/tracks/18yTgk0VgjB9XDj8h2q6Td",
"id": "18yTgk0VgjB9XDj8h2q6Td",
"name": "JUST LIKE WE NEVER SAID GOODBYE",
"popularity": 34,
"preview_url": "https://p.scdn.co/mp3-preview/d5790004de973f83756311075125ffc965e522c8?cid=a46f5c5745a14fbf826186da8da5ecc3",
"type": "track",
"uri": "spotify:track:18yTgk0VgjB9XDj8h2q6Td"
}
]```
I have an array like this
for each song
I want to get Name of each one
Like I don't wanna get artist
var s = require("spotify-url-info")
s.getTracks("https://open.spotify.com/playlist/3Q4cPwMHY95ZHXtmcU2xvH").then(a => {
a.forEach(song => {console.log(song.name)})
})
It gives artist not song
like you want to get this?
"name": "JUST LIKE WE NEVER SAID GOODBYE",
yes
i would use a forEach loop
That's what I am using
It returns me SOPHIE
That is the artist
But i want song's name
oh wait
Nvm
Thanks for answering tho
like guild.roles.cache
why would you want to do that though
djs automatically updates the cache as the events come
Guys how do I push an array in mongoose
I have an array [ url, url ,url , uek]
first I added an object song: array in my schema
error is here:
let money = await db.fetch(`money_${message.author.id}`);```
lol i found problem in index.js
now i have this problem
but its defined here:
let amount = await db.fetch(`money_${difarr[i].id}`);```
amout
How do u make a djs bot show the shards its in on the status
.setActivity("bla", { type "WATCHING", shardID: YOUR SHARDID HERE })
0|index | TypeError: Cannot read property 'replace' of undefined
0|index | at Client.<anonymous> (/root/Black Sheep/bot.js:239:35)
0|index | at runMicrotasks (<anonymous>)
0|index | at processTicksAndRejections (internal/process/task_queues.js:97:5) Unhandled Rejection at Promise Promise {
0|index | <rejected> TypeError: Cannot read property 'replace' of undefined
0|index | at Client.<anonymous> (/root/Black Sheep/bot.js:239:35)
0|index | at runMicrotasks (<anonymous>)
0|index | at processTicksAndRejections (internal/process/task_queues.js:97:5)
0|index | }
client.on('guildMemberAdd', async(member) => {
// mention , usertag , memberCount
const welcome = await welcomeinfo.findOne({
GuildID: member.guild.id
})
if(!welcome) return
if(welcome){
if(welcome.status !== "yes") return
let channel2 = await member.guild.channels.cache.get(welcome.channel)
let message2 = welcome.message
let message3 = await message2.replace("{mention}", member);
let message4 = await message3.replce("{usertag}" , `${member.user.username}#${member.user.discriminator}`)
let finalmsg = await message4.replace("${memberCount}", member.guild.memberCount)
channel2.send(finalmsg)
}
})```
Line 239 is let message3 = await message2.replace("{mention}", member);
message2 is an object?
It's a str
Try logging welcome
ok
@carmine summit
0|index | {
0|index | _id: 5fd9a346c693a6c4900f41ce,
0|index | GuildID: '690557545965813770',
0|index | status: 'yes',
0|index | channel: '783585413406654464',
0|index | __v: 0
0|index | }
It logged this
there is no message
why
But how
I don't get it
replce
replce
lol
That's why you don't use mongoose
I am going back to quick.db
WHY IS THERE NO MESSAGE
const mongoose = require('mongoose');
const setwelcome = new mongoose.Schema({
status: {
type: String
},
channel: {
type: String
},
message: {
type: String
},
GuildID: String
});
const MessageModel = module.exports = mongoose.model('welcome setting', setwelcome);```
This is my welcome.js
let newData = new welcomeinfo({
GuildID: reply2.guild.id,
status: "yes" ,
channel: channel ,
message: welcomemsg
})
newData.save()
How I save my data
Any idea?
Se mongoose socs
specify the database name
^docs
It's probably trying to save it to the welcome settings database
@Nekomaki#0001
yes
???
Hmm
What is the problem? Message not updating?
Whats that cluster thingy ?
so i'm trying to make a slash command with some args. for now, i use this json code but the it returns "invalid form body" because of the options field (works fine w/o), and i dont see where is my error
Interface thingy
the command appears bc i already created so im trying to edit it for it to do smth w/ args
oh wait is options an array or smth
alright figured out how to create a command, imma do the webhook thingy after that
i heard I can use CSS on my bots page but I dont know how lol
I only want to change my BG color Xd
<style>
body {
background-color: hexCode
}
</style>```
@Skipper#4904
@young olive
Should be it
Hopefully
oook thx
@tight plinth It's r.d.id I'm assuming
k
r is the raw data and d is the payload object
apparently nothing sent to the api
only the first console.log works aka after the if
The data needs to be in stringified JSON
you also have to send the content type header
Not sure how it works in axios, I use node fetch
I been keying with this shitty system for the past 3 hours, How on earth do I get a discord.js bot to send a message to a channel specified by an id?
um, maybe you want to rename the data field to body? Never used axios so maybe it's data though
Oh
Pretty sure it's data in axios
I've never used it either
Axios seems like a pain
I made my own wrapper of node's http(s) request that works almost same way as node-fetch
It's so easy to use
I don't understand why people you use it... and node-fetch also comes with discord.js by default
actually?
like why install axios when node-fetch does the same thing and it's already in your node_modules folder
here is the data field content, still errors
that's automatic
yes i did
Axios seems so trash
oh okay i know how to fix it since i use mongoose anyway
Nah axios pretty gud
it's two lines of code and thats it PGamerX
Nah
It was that there were many record with same server id because I forgot to delete than after testing
So it was getting confused
I removed all except one and it worked
And I was using guildID instead of GuildID in my bot code
Fixed that
oh ok
the code to create global slash commands only has to be executed one time, right?
Yes
ok
well time to wait one hour for it to be available ig
and if the app gets added to a new server and that the slash command already exists do i have to redo the creation process or it's created instantly
hey there
i just have coded a faq bot, now i want to add one more feature for our staff
that´s what i want to add
If a player with the roleID 755841728950566994 types !promote, then the player gets a rank and the bot writes an embed in a channel with the ID 762384738270838815 and tells something like: The Player "" has been promoted to Architect
If a player with the roleID 755850280704278581 types !promote, then he has two choises. He can either write !promote Supporter [Player] or even !promote Moderator [Player]. Then the bot writes an embed in a channel with the ID 762384738270838815 and tells something like: The Player "" has been promoted to Supporter or Moderator
If a player with the roleID 755864075623202896 types !promote, then the player gets a rank and the bot writes an embed in a channel with the ID 762384738270838815 and tells something like: The Player "" has been promoted to Developer
If a player with the roleID 755850280704278581 types !promote, then he has several choises. He can either write !promote Supporter [Player], !promote Moderator [Player], !promote Sr.Moderator [Player], !promote Sr.Architekt [Player], !promote Dev [Player] or even !promote Sr.Dev [Player]. Then the bot writes an embed in a channel with the ID 762384738270838815 and tells something like: The Player "" has been promoted to that rank
In all cases the bot even reacts with an emoji at the message he sent in 762384738270838815
I just started coding that but don´t know further, may someone help me?
(that's
you can check the user's roles
really
Gosh I thought this was a copy pasta
complicated
if(message.member.roles.cache.has("role id")){
// smt
} else if(message.member.roles.cache.has("role id")){
} // etc..
if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if () else if ()
sad switch case noises
omg yandev!! please sign my body pillow!!
Typical lol
got banned instantly
They must have a nice ban list
how come that anyone who tried to make something in the direction of yansim is never mentally stable
probably because the idea of yansim wouldn't come to a mentally stable person
and the project fell apart
they were acting superior
but the game had SNES game graphics lol
i did first two days then gave up because i'm too lazy
understandable, have a great day
oh dang
and i lost the feel for time and space
here the second wave is almost there
this is not the second wave, its the third
just gotta wait for some more stupid people to keep partying and drinking
actually, we're starting to enter the 4th wave
ooof
well, more like third wave part 2
you guys are past the first one?
we passed our first one in june, but now we are seeing a spike almost 3 times that of the initial
@commands.command(name='embed-weather-crash')
@commands.has_permissions(manage_guild=True)
@commands.guild_only()
async def _weatherembedcrash(self, ctx):
if self.weatherembed_loop.is_running():
channel = ctx.bot.get_channel(742179037643800596)
embed=discord.Embed(
type='rich',
colour=discord.Color(0xFF0000),
description=f'''
**WEATHER LOOP CRASHED:**
#city-information
**CRASHED BY:**
{ctx.author.mention}
'''
)
embed.set_footer(text=f'ID: {ctx.author.id}')
embed.timestamp=datetime.datetime.utcnow()
embed.set_author(name=ctx.guild.name, icon_url=str(ctx.guild.icon_url))
await channel.send(embed=embed)
if ctx.channel.id == 741735054010482769 or ctx.guild.id == 717441612757729300:
await ctx.send("Loop stopped!")
self.weatherembed_loop.cancel()
elif ctx.channel.id == 771353867694506026:
channel2 = ctx.bot.get_channel(741735054010482769)
await ctx.message.delete()
await channel.send(f'{ctx.author.mention}: Loop Stopped!')
self.weatherembed_loop.cancel()
elif ctx.channel.category_id in [740622346800463974, 741754307216408656, 741750821871550562]:
await ctx.send(':x: | This command can only be used in [#741735054010482769](/guild/264445053596991498/channel/741735054010482769/)')
print(f'Command r!{ctx.command} used in #{ctx.channel} by {ctx.author.name}')
else:
await ctx.message.delete()
await ctx.send('(This command can only be used in [#741735054010482769](/guild/264445053596991498/channel/741735054010482769/))', delete_after=7)
print(f'Command r!{ctx.command} used in #{ctx.channel} by {ctx.author.name}')
print('Loop has been crashed')
pass
pass
If statement doesn’t work in Python
Should't this create a global slash command? It doesn't appear
what does it return?
Nothing yet, but it should still appear
The bots need to be re-invited for slash commands to work
What
Nope, that’s what people are saying
It would make no sense for them to be re invited for them to work
@earnest phoenix
or wait to jan 2021 @earnest phoenix
I been keying with this shitty system for the past 3 hours, How on earth do I get a discord.js bot to send a message to a channel specified by an id?
the bot has a channel cache
Maybe this
you get the channel you want by id and send the message
and you don't need to reinvite the bot every time, only once for the aplications.commands scope
const spesificchannel = bot.channels.cache.get("id gose here");
spesificchannel.send(`what ever you whanna send`)
Well so, somebody know to how get data from a file in a <input type="file">?
A backend
thanks
you don't need a backend for that 🤔
document.getElementById('your-input').files
@earnest phoenix
Yea i already got it
Alright
Do you need to apply for it?
Nope
Ok
Create a slash command
Authorize the bot with theapplications.commandsscope
Listen to theINTERACTION_CREATEevent and send a callback
Pretty loggers
Meh, not worth it for me
slash commands suck anyways lol
they're so restrictive
using them is equivalent of comparing your dick size
you'd only use them to show you can use them
hey
LMAO
what an epic comparison
epic
how can i make my bot DM me when someone made a suggestion?
Bad idea
Calling it right now
Just don't do it
Drop the idea
the suggestion command is for bot suggestions
here's a better idea, remove the command and do that instead ^
ok so
how can i make my bot send a message to a specific channel
lmfao
fetch the channel and send a message
client.channels.cache
I actually have a suggestion command that goes into a suggestion channel in my support server
yike
people are going to abuse things like that
i can make my bot send a message to a specific channel by ID?
Use client.channels.fetch(id)
oh right
It has a cooldown, to prevent spam, and the channel doesnt allow everyone to see the channel history, so I think it's fine
always design your code as if a 4chaner is going to abuse it
never assume the end user has good intentions
yup
wait
the ID must be with ""
?
Yes
ok thx
why when i log the question / responses i get nothing in console
help?
@pale vessel you alive?
yeah
its 10 pm for him
await it
okay
channels.fetch() returns a promise
or use .then but await is cleaner
if you use .then() you must love callbacks
well maybe because the function isn't async
but you can easily make it async
i guess rare use cases
i made it async
flaze what else should I try to store data in? so far we have files and file names
your balls
lol
what he said
why didn't you just reply and say this
YEAH
nice
I think it is
not
wait
also, how can i make it DM someone
after a command
(an specific user)
<Member>.send('shush')
thx
<Member> being the user
but
what about if the command is used on another guild
i want to make it DM me
?
client.users.fetch(id)
oh thx
Fetch the user (you) and send a message
with await, right?
async await btw ^
yeah
I stepped away for 2 minutes and this channel blows up lol

i don't see any explosives
I think the Competing activity type is pretty interesting, especially for bots. You can do interesting things https://velvet.is-ne.at/T7i6ML.png
Speaking of bots
Where do you people get motivation/inspiration for new commands?
i have no idea 
'Cuz I want to make new commands for my bot so it isn't absolutely barebones (and drowned out by more useful bots), but I don't want to copy other bots, either
hence why I'm not gonna ask for 'what commands should I add'
find a niche
I mean
not many bots offer a universal item system that's used across shops, games, and a custom scripting language
But I doubt the average person really cares all that much

the average person is stupid, if the feature is even a little complex, they'll start searching for alternatives
"Think about the stupidest person you know, and then think about the fact that half the world is even stupider"
But I mean, there are some technically inclined people that do care, and those that take interest (or appreciation for the tens of thousands of man hours that're put into development) in relevant features :p
Am I dumb or does this not work?
client.on('guildMemberAdd', (member) => {
const mainChannel = client.channels.cache.get('776209259196711017');
mainChannel.send('Welcome ' + member + '!');
});
maybe the channel is not in cache
how would I be able to send a message to a channel that is not in the cache?
No errors?
No errors
You fetch the channel
Ah, that means that the event didn't trigger
Do you have the guild members intent?
yea maybe that
How do you mean?
Enable that intent under the bot section in your developer portal
aight, ill test it in a sec
@hollow sedge after like half the night figuring this out i learned that quick.db cannot be used for a bl command
It can
just push the user's id to a blacklist array
I wanted to know how I my bot page can have an floating pfp too :)
Use CSS in your bot's edit description to animate the picture.
So, I'm trying to make a server where whenever someone posts something in a specific channel, their message is deleted and reposted as a message from an NPC automatically.
The background is basically just that I want people to make official statements as news outlets without having to change nicknames and shit.
Does anyone know how to do this??? Please help. Thanks.
yeah but what do i have to use Xd
im not really into CSS
no one is
no one is
css hurts my brain
I wonder why.
yes
you think css is bad try html boi
html makes sense
lmao
instant stroke
So, I'm trying to make a server where whenever someone posts something in a specific channel, their message is deleted and reposted as a message from an NPC automatically.
The background is basically just that I want people to make official statements as news outlets without having to change nicknames and shit.
Does anyone know how to do this??? Please help. Thanks.
But it should right?
Yes
First of all, stop repeating it over and over again
webhooks.
what do you mean webhooks
webhooks!
Webhooks are the only way to have messages being sent as someone else, or someone custom,
IPA === Webhook
instead of you making a request, the API does that to you
client.on('guildMemberAdd', (member) => {
const mainChannel = client.channels.cache.get('776209259196711017');
mainChannel.send('Welcome ' + member + '!');
});
idk why this doesnt work though...
try adding a console.log("test") to the first line
console.log('a') inside it
no
a
a > test
b > *
you already have your hand on a
wow geniuses... how about console log the mainChannel var?
nah
would be to easy, aye
How about logging both member and mainChannel
what about delete the fucking bot
🧠
good idea
any kind of logic is forbidden here!
They would have gotten an error otherwise
eval js if (logic) process.exit()
nope, throw error
this.developmentChannel.setForbidden.bind(this)(this.logic)
channel crashed
if i want to make a "enable dark mode" i should change every object propety using object.style.propety = "propety"?
need some feedback on this look, anything else i could include?
is that betterdiscord?
betterdiscord is against tos
aight
better to not post pictures
@crimson vapor we dont moderate for that
you don't but im sure there are kids who do
So, a question about organizing files:
I have a couple of JSON files in the root directory, but commands, iamges, fonts and languages have their own folders. Should I create a folder for the JSON files or keep them at the root directory?
im not using better discord to be malicious lmao, it just looks better
If so, any idea on what the folder's name should be?
src
alright
I am just saying be careful
following common data structures
@pale vessel well, been keying around some more, but it doesn't log anything in the console either when the event is called...
Are you sure you enabled the intent
brb
is there an article about folder structure for nodejs?
yeah, makes your life easier
yo epic pfp
I havn't been able to find common ones
yeah 😅
Did you define intents under clientoptions?
I don't know
that's why I asked by myself here
I don't think so, How would I do that, And how does that work?
btw, should config.json be in src too?
Select the events you need in https://ziad87.net/intents/ and get the number. Put the number in your ClientOptions under ws new Discord.Client({ ws: { intents: <number here> } });
well i put it there
You can give an array too but number is easier
all these are normal discord
ight brb
which are the examples
if we think a little, from the beggining, while starting for the first time, it's always put by bot/index .js' side
wut
config.json has the Token and the Prefix
most of tutorials leave it at the root directory
even though we can all put it in a folder
maybe
so like this?
const Discord = require('discord.js');
new Discord.Client({ ws: { intents: 32767}})
in my case its because typescript
because it also moves the json files to the out folder
i just leave my token as an env variable
yo epic pfp
same for yours, now that I'm thinking xD
I leave tokens and stuff in config.json
indeed 
o
same here except for the token
or like this;
const client = new Discord.Client({ ws: { intents: 32767}})
const Discord = require('discord.js');
I still gotta know the difference between .env and just data as .json
LOL
.env is more secure I want to say
yea
its part of the enviroment itself
that way you can commit config.json without leaking anything important
I commit my bot privately
well k
same but no reason to upload the token
yea true
and its not that hard anyways
you just need dotenv and a .env file with your token
and add .env to .gitignore
but my uploads to heroku are from github
here?
ye
how so?
you can change where you put the token
instead of config.json
in .env
and add it to the heroku env variables
that way you can do process.env.TOKEN
but, couldn't I get the whole data from config to .env?
UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
How imma fix this?
hmm
brb
how and where?
right?
yea
Discord Apps
private stuff
aight chief
Im here, But where do I select what intents i need to use?
on the bot section of your app
what intents do you need
you have to whitelist
preferably all of them, since its only for 1 server...
Yes
Дайте бота
those 2 intents are "open" until u get to 100 servers without whitelist @novel snow
Ауу
i havent been on the page in a while so yea
Ррррпп
lemme try that one again
You speak Russian language
Well if it didn't work then it's something else other than intents
I have those already enabled
UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
ARe you sure you have the right bot token
And your bot isn't verified, right?
just to be sure
They are toggleable so I'd assume no
They'd show the same if they were on in a verified bot though
It isnt verified, But it isnt in 100+ servers
Since the one I am working on now is one thats only on 1
Greyed out for me
Then are you 100% sure you have the right token for the right bot
Yes
i don't know if i should feel sad that that image had to be made
You're mistaken somewhere. Unverified bots would not get that warning with the intents enabled on the portal.
as if the switches weren't intuitive enough
They're not actually intuitive tbh
My dumb fucking ass missspelled the intents
HAH.
so it was calculating the entire permission wrong
xD
Is it possible to give users a role based on their other servers they are in? Like we have a sister server, and we wanted to show support for our sister users by giving them a role based on that server is there any feasible way to do that?
I just find this even funnier.
I am fucking stupid lmfaooo
yes
nice
oh no
but you need their Roles ID @terse finch
You mean the sister servers roles?
and get their Guild onto ya bot
yea
So the bot needs to be in both servers. Gotcha
I figured as much but wasn't sure if any of y'all knew a jank way of doing it instead
like, I made my bot answer only in one language in one single channel
Thanks
yo they finally got rid of those 3 steps on a new server's main channel
let me show you a bit @terse finch:
message.channel.id == '787661396652589077' ? language = 'en' : language = await languages[message.guild.id];
this is an example that u can just get the ID, and do what you need
Why await?
Oh thank god for that.
Accessing an array index is syncronous
about damn time
hmm, so I thought wrong
if (!languages[message.guild.id]) {
const doc = await ref.get();
languages[message.guild.id] = doc.get('language') || config.language;
}
let language;
message.channel.id == '787661396652589077' ? language = 'en' : language = await languages[message.guild.id];
const lang = require(`./languages/${language}.json`);
Also holy crap guys ```
const language = message.channel.id == '787661396652589077' ? 'en' : languages[message.guild.id];
Use ternaries 😛
thought await would actually WAIT for the above code to execute
ternary is pretty cool for certain stuff
uhm, that's what I did, I guess?
unless you start nesting it
it's what you did very wrong though
await only resolves a promise prototype
oh, teach me so 👀
I did that
message.channel.id == '787661396652589077' ? language = 'en' : language = await languages[message.guild.id];
I'll remove await tho
On assigning the value directly to the variable
do you see the difference between the two though
mine's actually using the ternary as it's intended , for variable assignment directly
yours is... a... funky way, at best.
hmmm
let language;
message.channel.id == '787661396652589077' ? language = 'en' : language = await languages[message.guild.id];
vs ```js
const language = message.channel.id == '787661396652589077' ? 'en' : languages[message.guild.id];
Which is cleaner?
Down
Also use strict equality operator instead of non-strict
triple = right?
Yes
can I ask what's the difference, just to make sure
in the context of how you're using it, it won't matter
but Voltrex will never be happy if things aren't like he wants them to be

Non strict one is unsafe and it tries to convert the first given value to compare to the instance of the second value to compare in primitive types, but the strict one only checks for direct value type comparison
it doesn't have it cause it's a strongly typed language
=== in javascript is == in java
👌🏻
Says you
so, when should I use == in JS?
shh... don't start the war again
Never
ah
Whenever you dont need to check if the data type is the same
that's it! great
yeah kinda
i find it confusing so i never use it
it'll save from some problems
i just convert types manually
seriously????
i mean .toString() isn't that much effort

yeah
That makes perfect sense, because [] creates an instance of the Array class. Two instances of the same class can never be the same
isInteger
so i'd say never use == unless its a really strict case lmao
😮
like laziness
perhaps
big case
But if you push elements to it, it can be the same
understandable
Huge brain
Imagine saving any property of an obj as integer and changing that later into a string, using that property value in a statement in strict mode will fail, after being changed into a string
no, two different arrays can never be the same
because they point to different memory addresses or something
even though they have same values
I meant 2 arrays both with the same elements
that's true
[1] === [1] will yield false
thats because arrays are objects 
im pretty sure { 0: 'foo', 1: 'bar'} is technically the same as ['foo', 'bar']
tecnically
not logically
nope
arrays and objects are optimized differently
let array = ['foo', 'bar'];
({...array}); // { 0: 'foo', 1: 'bar' }```

like
const obj1 = {0: '100', 1: '200'};
const obj2 = {0: '200', 1: '300'};
if I do obj1[1] === obj2[0], will be true, right?
of course
Pretty sure it will
depends on the type of the value...
so what if
const obj1 = {0: '100', 1: '200'};
const array1 = ['200', '300'];
then obj1[1] === array1[0]?
Still yes
that's all I need to assure
an array would be an object with that
but also with its push(), pop() methods
etc
const array = {
0: 'foo',
1: 'bar',
length: 2,
push(element) {
this[this.length] = element;
this.length++
}
};
yes
except that the interpreter optimizes arrays and objects differently
yeah
yea
but thats the general idea i guess
each day I come here, I love even more this channel
jeez, this is better than school
indeed
no need to be hasty
this channel can be cancerous quite a few times a day
im not paying attention to online classes rn for this
well yea
ikr, been victim once
kinda
any time I post code
any time million mentions "jason"
yes
yes
it can get pretty chaotic
Welcome to a bunch of JS devs on the internet talk to each other
y
Tim 💯
when will Tim get a Tim role?
tim
tim
tim
timimimim
wait what am i doing on this channel
I think tim doesn't like ts
no he said "fuck ts" once
Tim is contributing but he's gonna be a whitename after seeing all the spaghetti TS
lmao
im getting help from erwin and he said your entire lib is bad so its not my fault
lmao
btw your lib doesnt install on node 15
LMFAO
oh dang
what about that library to just send 5
we should convert it to ts lmao
hahaha
my ourcord
Because we got so many contributors, communism
beautiful
I wanna get in on this
what should I do?
I have no idea how to do much in ts
especially ws and fetches
Just open a PR and get it merged, you'll be a contributor then
but what should I change?
the readme is always the reliable option
https://million.is-a.computer/files/fSa2St65RXAftth.png is this supposed to be this https://million.is-a.computer/files/4mdmdshFFpBXOEo.png
because I can add a few
Just add missing dots 

im kinkshaming every single one of yas btw
whats the repo again?
ourcord/ourcord
ourcord/ourcord
k
ngl, unironically, that lib turning into a meme
Erwin
bad is an understatement
Stop and just contribute smh my head
should I pr that @earnest phoenix
Go ahead
message.channel.bulkDelete(args[0]).then(() => {
const amsters = new Discord.MessageEmbed()
.setColor("#0FDCC9")
.setDescription(`:white_check_mark: **Am sters ${args[0]} mesaje!**`);
message.channel.send(amsters).then(msg => msg.delete({ timeout: 10000 }));
});
Why the bot is not deleting the number i said in args[0] ?
ok
duplicate types, npm v1 and its not working, commit names like this , bruh, this is a troll lib @pure lion @earnest phoenix
yo i made a pr
lmao instantly closed
closed 
response?
I added my name in the colaborators in the readme since that makes me a colaborator

