#development
1 messages · Page 1221 of 1
https://discordjs.guide/#before-you-begin
decent for beginners

😔
i know how create Bot for ban , Kick,and welcome and Music But i dont know the Music on visual i need someone to give me the commands for music
for Visual

u got the resource up there
you didn't create them, you did a frankenstein on a bunch of github and SO code
lmfao thanks cry
yikes
cry, could you take a look at this message and give feedback #development message
yeah of course
making a bot is fun, but also brings responsibility because when it breaks u need to know how to fix it, learn the basic fundamentals of the lang ur using
good job, it's entirely accurate @misty sigil
idk what you want by that
wdym
good job, it's entirely accurate @misty sigil
@earnest phoenix thanks.
you can't kick a user
lol what
you know what i mean
and for it to be a member it must be in the guild
message.guild.members.cache.get()?
ah, thxs
i asked a question here around 2-3 hours ago, but how do u add a role to only bots when they join
i need help!
i asked a question here around 2-3 hours ago, but how do u add a role to only bots when they join
@granite echo guildMemberAdd event
I am working with sqlite3, and I would like to know how I can store the data (jobs, coins etc) by servers
ye, but i only want it to be a bot
then <member>.user.bot returns if the member is bot
ah
does that awnser it?
I am working with sqlite3, and I would like to know how I can store the data (jobs, coins etc) by servers
@earnest phoenix pretty sure you can't
ye ty
you probably can
just have a primary key thats set to the guild id
of course you can, loo
wtf
@earnest phoenix pretty sure you can't
@earnest phoenix and how i show a laderbAnd how I show a leaderboard of the members of a server
leaderboard*
we dunno how your code works
you need to figure it out on your own
well
you didn't create them, you did a frankenstein on a bunch of github and SO code
@earnest phoenix no he didnt create it he just downloaded JMusicBot
really silly question
does this work
client.on("guildMemberAdd", member => {
client.roles.cache.get('752135362947842140').add().member.user.bot
})
No
hhhhhh
if(member.user.bot)
client.on("guildMemberAdd", member => {
if(member.user.bot) return
client.roles.cache.get('752135362947842140').add()
})
yes?, sorry i ask alot i like to make sure i do it right
no
that adds it if the member isn’t a bot
client.roles isn't a thing
ew docs, i will never in my life read docs, i am self taught and always will be,
your code doesn't look like it's fine
have fun
it's totally wrong
Reading docs is precisely what self taught people do
You have to do both
nope
well no one is going to spoonfeed you to the code
Otherwise youll have a hard time
docs are not spoonfeeding
do you want your code to work
Anyway docs is something that will grow on you
You may not read them now but eventually you will learn and enjoy reading them
nice
is there anyway to detect all the members in a voice channel?
library ?
i doubt that tim, im a round a month self taught
have fun
I started reading docs more seriously after like a year
ill only read docs if im extremely stuck
you can not use docs, but like
alot of simple things are in there
like message.author.bot
and like adding a role to a member
and like client.roles isn't a thing
How do you use a random npm library without reading how to use it?
???
That is the same as docs lol
nit really
yes
o*
that is docs
how old r u
old enough
if(member.user.bot)do shit here
Anything that explains how to use it its docs
doesn't seem like it
nice
This really just seems like low quality bait
true
ima put this out there, idc if u help, ill just do it the old way, but that is entirely up to you, i will never in my life i swear on gods words bait someone, but ya'know, thats up to you to believe
ok
why, giving out code isn't going to help them learn
yikes
yikes
lmfao
how do i style my bot page?
css
i-
I told you that like 1k times before
@drifting wedge ^
so you can link docs for other people but can't read them yourself ?
huh that’s
how about u stop trying to cause shit
just asking
I know CSS, but where to do that?
how about you read docs
I know CSS, but where to do that?
@jaunty lichen you can use style tags in the long description
@granite echo You're trying to say this
I'm self thought
I don't read docs because i want to be spoon fed to go through it
Ew spoonfeed?
@misty sigil Ah Thank you!
What in the gods name
no problem
What in the gods name
@earnest phoenix also making a bot list
without reading docs
let embed = new MessageEmbed()
.setTitle('Utilisateur a bien été banni')
.setDescription`> > **Utilisateur banni :**
> Name :
${member.user.tag}
> ID :
${member.user.id}
> Raison du ban :
> ${reason}
> > **Utilisateur qui a executer**
> Name :
${message.author.tag}
> ID :
${message.author.id}`
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL({dynamic: true}))
.setColor(`#dc143c`)
.setTimestamp();
await member.ban({reason : reason + ` (${message.author.tag})`})
return await message.channel.send({ embed: embed })```what ?

Well that's...
with quick.db too
wrong
oh nice
not quick db
what db?
keyv
LOL
j s o n

@wicked pivot Bruh?
for now
bot list => json db
Heard of methods?
I’m gonna cry of laughter
now ima get back to coding
json db is the best db tbh
JSON isn’t a database

Json is only used to store small amount of info
Prone to corruption
json is decent for static data
your bot list will be fucked
not databases

your bot list will be fucked
@misty sigil if you dont read docs it'll be fucked even with a json db
@wicked pivot No parentheses?
json db is so good stop hating
You know that's a method too
i cannot tell if you are being sarcastic @sand condor
i can't either

I never used json db
@earnest phoenix ahhhh sorry ..
i only took the bit to read a json file cause i didnt realize you could just do require("")
Corrupted 2 days later
lol
In 4 servers 🧑🏻🦯
Use json db
Thinking it's the best and works for a few days
Corrupted in 3 days
Now I switched to MySQL databases and APIs made from php, it’s now in 4K servers 😄
let embed = new MessageEmbed()
.setTitle('Utilisateur a bien été banni')
.setDescription`> > **Utilisateur banni :**
> Name :
${member.user.tag}
> ID :
${member.user.id}
> Raison du ban :
> ${reason}
> > **Utilisateur qui a executer**
> Name :
${message.author.tag}
> ID :
${message.author.id}`
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL({dynamic: true}))
.setColor(`#dc143c`)
.setTimestamp();
await member.ban({reason : reason + ` (${message.author.tag})`})
return await message.channel.send({ embed: embed })```what ?
@wicked pivot
is message.author a thing (?)
No i fixed his problem
@thick gull it's settled it's settled

Bruh Momento
https://hastebin.com/ogoseculus.js when I do the search with a channel name it doesn't work (with id it works)
@wicked pivot Use the find() method on the collection not the filter() method
need help with an error
{
NoLevelGuilds = NoLevelGuilds.replace(message.guild.id, "gone");
jsonfile.writeFileSync('NoLevelGuilds.json', NoLevelGuilds);
message.channel.send('Leveling is now on for this guild')
} ```
Hello, I'm getting that error when trying to npm i Can anyone help me ?
https://icero.is-reading-man.ga/YWQJHDZ.png
it says TypeError: NoLevelGuilds.replace is not a function
Its for installing packages from a package.json
@earnest phoenix k
Does your node_modules folder already has a folder called .staging? @woven sundial
So there's one?
nope

I tried to create one manually but
https://icero.is-reading-man.ga/Rami8Pp.png
{
NoLevelGuilds = NoLevelGuilds.replace(message.guild.id, "gone");
jsonfile.writeFileSync('NoLevelGuilds.json', NoLevelGuilds);
message.channel.send('Leveling is now on for this guild')
} ```
`TypeError: NoLevelGuilds.replace is not a function`
help?
Have you tried npm rebuild? @woven sundial
@urban olive noLevelGuilds is not a string
replace() is only available to use on a string
how do you get back the custom status in v12?
You can't set a custom status to bots
I did your command but it didn't changed anything when I try to npm i
Hmm, that's strange
retrieve that of a user *
Oh
but i want to replace a specific guildID within the variable with "gone"
before I used to do that
if(!user.presence.game){
var GameName = "n'a pas de jeux"
}else if(user.presence.game.name === "Custom Status"){
var GameName = user.presence.game.state
}else if(user.presence.game.name !== "Custom Status"){
var GameName = user.presence.game.name
}```
<User>.presence.activities.find(a => a.type === "CUSTOM_STATUS")``` @wicked pivot
@urban olive What's noLevelGuilds defined as?
a var
it holds the guild IDs of servers that have disabled leveling with my bot
hmm Voltrex it seems to be an error on my external disk
I meant is it a object? array? string? boolean? @urban olive
@woven sundial Maybe
maybe an error permission ?
object
@woven sundial Try with root? I mean sudo
I was already in sudo
Hmm
ty for helping anyways 🙂
{"750072798050779136":{},"653568812578373643":{}}
here is whats in noLevelGuilds.json
i want to get one guild id out of it
if (message.guild.id in NoLevelGuilds) {
NoLevelGuilds[message.guild.id] = "gone";
jsonfile.writeFileSync('NoLevelGuilds.json', NoLevelGuilds);
message.channel.send('Leveling is now on for this guild');
}```
@urban olive try this
instead of using pixels
can i center something?
like a text on an image when using PIL?
ok letme see
Big L
{"750072798050779136":"gone","653568812578373643":{}}
i want the guild id replaced with "gone"
just delete that entry?
yes
oh it’s not mongo
trying to get rid of a guild id
trying to get rid of 750072798050779136 from the file
idk I don’t use json “databases”
I know how to do that but if you try to do that to also other guilds in the json, it would screw up
result = noLevelGuilds.json result[guild.id]
@urban olive For example try this
if (message.guild.id in NoLevelGuilds) {
delete NoLevelGuilds[message.guild.id];
jsonfile.writeFileSync('NoLevelGuilds.json', NoLevelGuilds);
message.channel.send('Leveling is now on for this guild');
}```
This doesn't change their name to gone but completely deletes them
Which is better
ok dice lemme guess
addedBots doesn’t show up as you have no queued bots
yes
Np
H m m
:(
addedBotsOnQueue ? addedBotsOnQueue : "You have no queued bots"```
epic
ok so imma construct something
@pure lion Did it work?
Lol
How do I chang the background on my bot page,?
How do I chang the background on my bot page,?
@drifting wedge With CSS
Yes like I said with CSS
How?
[Rust] I already know some Rust, but re-reading the book to gain more knowledge. I've modified the example which features slicing: ```rust
fn first_word(word: &String) -> &str {
for (index, char) in word.char_indices() {
if char == ' ' {
return &word[..index];
}
}
&word
}
fn main() {
println!("{}", first_word(&"Abyss".to_string()))
}```
What confuses me is the return type. &&String is the result of &word at bottom (&str for the early return). How is &&String equal to &str?
How do I save an object to a json file?
fs exists
For a reason, js fs.writeFileSync(<file name as the first parameter>, <content to write in as the second parameter>)
json.stringify it
No
— JSON "databases" and why you shouldn't use them
- You are writing/reading to and from a file, which if not done correctly (including safety checks) can lead to data loss/corruption
a. regular databases have a lot of safety features to prevent and auto-repair corruption, while JSON has none, they also usually have something to roll back to in case of data loss - The file will get larger and larger, and while databases can edit small parts of it at a time, JSON can only edit the full file at once, meaning the entire file has to be rewritten to change a small piece of data, which makes it extremely slow for large files
- The syntax is too strongly typed, one character wrong and your database is gone
- JSON "databases" are way less scalable than even quick.db, and quick.db is arguably easier
— Woah! You’ve went ahead a bit, what even is JSON in the first place
JSON stands for Javascript Object Notation,
JSON is
• a lightweight format for storing and transporting data
• often used when data is sent from a server to a web page
• "self-describing" and easy to understand
— Where can JSON be used though?
JSON can be used to store data that isn't changing often (e.g a simple config file)
{
"token":"token",
"prefix":"!"
}```
— **It may just be a bad practice**
While it may not be the end of the world, put yourself in this scenario
```css
Bob: I just got my bot approved on top.gg, and I am gaining so many servers!
Billy: What DB do you use?
Bob: I use json as a database
Billy: But you know that will eventually corrupt, right?
Bob: Yea, but I do not know any different ways of doing it.
Billy: Come back when everything is broken and corrupted
* 3 days later *
Bob: You were right, I cannot use a json database forever 😢
Billy: Thats why everyone in #development told you to use something other than json
Also see: #development message
jsondbbad
Holy s h i t
shit wrong channel
no right channel
L o l
but ill keep it here because its useful probably
That's the b i g g e s t wall of truthness i have ever seen
Database file(s) can also corrupt, but they're more resistant and/or have something to roll back to.
@sudden geyser thanks i'll add that
Database file(s) can also corrupt, but they're more resistant and/or have something to roll back to.
@sudden geyser Actually, any file can be corrupted if you know how to corrupt them
Yeah I know
Database files have their special flavor in it
To be honest I don't think using JSON as a DB is the end of the world. It's just bad practice.
what the fuck was i about to do
Bad practices are always the end of the world
then you don't know how to use anything other than JSON
Now trying to understand how databases work other than using json database and hurting your Brain is a pain
In this situation
even quick.db would be a better option...
Lets say this, if your bot is on DBL and you expect it to grow. You should abandon json right now. As it wont be able to handle it if your bot grows a ton.
But, if you don't expect much growth then you are fine to stick with json
isnt mongodb just json with extra steps 
Essentially yes, but lets keep this formal please.
<MongoDB won't get corrupted>
Or at least any time soon
lol
quick.db would be a better option than just casual json. But isn't much of an upgrade due to the lack of sharding support. so, if I was you. I'd jump to mongo or postgres as soon as you can. Mongo has a free hosted version which you are able to use, and it works great. I use it myself on a few bots.
Yea in mongodb you can choose a free plan that gives you a free cluster, but it isn't too big of a deal since it doesn't have a big memory size
If the bot grows of course the issues will catch up to you. However, if I'm hosting a small bot that's (for example) is in a few servers and I don't have much plans on making it scale I probably don't care too much about it. You can use JSON in a dumb way and get corruption on day one.
And if the programmer doesn't want to use SQL directly, they can use an ORM or whatever high-level API for managing their database. I think some people here are just quick to point the finger at everyone saying, "No, bad. Do this instead."
But you can choose to upgrade the cluster
you can also download mongodb community
For the most part I use SQL with SQLite.
You can host your own mongodb if you wanna, but the free one is more than enough for most bots
unless its an economy bot. in that case I'd suggest hosting your own version
You aren't gonna store the entire data of the dbl are you
lets see here. lemme log into my mongo compass
lol
"5 mb"
can you give me opinions on the scenario? https://discordapp.com/channels/264445053596991498/272764566411149314/752260260672176221
infact, just the entire message
well, lets say this. 4.3 million documents in mongo at a average size of 217B is using 893MB
mattt, to be honest it makes sense
granted we dont store much
so whats ur opinions
is nice
thanks dice
It's nice
thanks
maybe provide alternatives?
:o
@misty sigil Also you can say, like you can use quick.db in the beginning
Or switch to mongo instead
provide src^^
${body1.data.map(body1 => body1["252490"].data.categories.description)}
TypeError: Cannot read property 'map' of undefined
I like it mr clarkson
thanks
mine wasnt pinned 😧
@earnest phoenix What's body1?
assuming this one is pinned too
fetch(oyunbilgisi).then(results => results.json()).then(body1 => {
if(body1.success === false) return message.channel.send(`**${message.author.tag}**: Oyun bulunamadı.`);
how can i center messages in PIL?
@earnest phoenix console.log() body1 and see it's values
@summer torrent https://throwbin.io/YgjDRHH
Throwbin is a website where you can store text online for a set period of time.
${body1["252490"].data.map(body1 => body1["252490"].data.categories.description)}`,false)
yeah yeah
benim hatam 😄
sorry.

how can i center messages in PIL?
pil?
how do i get the info of uncached users?
in discord.js?
yes
u have to fetch them
use force option on fetch()
how do i do that
how can i center messages in PIL?
anyone help me out with this?
got a schema that im trying to use
monogodb
const { Schema, model } = require("mongoose");
const guildSettingSchema = new Schema({
guildName: { type: String },
guildID: { type: String },
prefix: { type: String, default: "%" },
autoRole: { type: String },
joinMessage: { type: String },
leaveMessage: { type: String }
});
module.exports = model("guild_settings", guildSettingSchema);

bruh
sprry
Text
not imahes
and this is what i get back
@charred geyser this mongo?
so my schema is this:
const { Schema, model } = require("mongoose");
const guildSettingSchema = new Schema({
guildName: { type: String },
guildID: { type: String },
prefix: { type: String, default: "%" },
autoRole: { type: String },
joinMessage: { type: String },
leaveMessage: { type: String }
});
module.exports = model("guild_settings", guildSettingSchema);
and on message event i have it check if there is data that already exists for the server and if it doesn't it will create a new set which should be:
const newGuild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
guildName: message.guild.name,
prefix: process.env.PREFIX,
autoRole: "null",
joinMessage: "null",
leaveMessage: "null"
})
but all i get back is:
yeah its mongodb
im trying to do auto role
ok now im truly stuck
https://voidbin.cc/paste/ajSkcz#
There was an error trying to execute that command because of TypeError: Cannot read property 'id' of undefined
let Discord = require("discord.js")
const { MessageEmbed } = require('discord.js');
let fs = require("fs")
const fetch = require('node-fetch');
module.exports = {
name: 'grab',
category:...
what line
the only line with "id" in it
indexOf(message.author.id) === -1) ?
how can I search the json file by name?
what
lol u were helpin me
i was?
i need help myself 
that code bin doesn’t work on mobile, @granite echo
rip
doesnt let me scroll down
ooooof
just send the line which is erroring
what line?
its pretty simple once u read my error
how can i center text in PIL?
sorry, but i cant be bothered to look through 50 lines of code
its this @digital ibex
PLEASE
lmfao
line 9
its the only line mate
Does any of you know discordeno? Can you recommend it?
@granite echo just be straight up
no need to
people dont have to help you
ok
noobs
what
ur moms fat
i was talking to hunte-
ping command
thats the first command i made
what sort of bot is it
hello command
ghostybot
hello command is uselless
u say hello to it and it says hi back
no its not
someone could be depressed! u cured someones depression!!
a ton of commands does not mean quality
it is to me lol
wow
clean up your current code
rude!
is it weird that i enjoy cleaning up code
idk
but i wanna move my bot to lavalink for music instead of ytdl and ffmpeg
its so satisfying having everything organised and looking nice
lavalink is trash
agree
d.js 11
but i dont really do it much since im not working on any actual projects anymore, only small ones to help with learning python and js
only useful for people who don't know how to utilize ffmpeg and pipe content
idk what to do for d.js v12 lavalink
py?
but the text isnt centred
${body1["252490"].data.genres.description} = undefined
https://throwbin.io/wljpB55
Throwbin is a website where you can store text online for a set period of time.
@charred geyser show ur message event where ur updating the doc
how do i get the create date of an uncached users account
what language?
js
library?
if (message.author.bot) return;
const settings = await Guild.findOne({
guildID: message.guild.id
}, (err, guild) => {
if (err) console.error(err)
if (!guild) {
const newGuild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
guildName: message.guild.name,
prefix: process.env.PREFIX,
autoRole: "null",
joinMessage: "null",
leaveMessage: "null"
})
newGuild.save()
.then(result => console.log(result))
.catch(err => console.error(err));
return message.channel.send('This server was not in my database! I have now added and you should be able to use bot commands.').then(m => m.delete({timeout: 10000}));
}
});
thats whats in message.js event @digital ibex
well the rest is just dealing with commands
that is the relevant content
remove the const newGuild = ... and change that to settings =
and make settings a let, not const
and newGuild.save() = settings.save()
how do i get all values in an object?
ex: body.data.genres
uh, body.data.genres ?
I want to get all the descriptions in this section
does it work?
yea
noice
im just setting that up
so
they will be "null" by default
and people can set them in my dashboard
idk if i should also add a command to set them
i kinda wanna get people to use the dashboard more
@earnest phoenix u need to provide more context
for example ${body1.map(body1 => body1.name)} returns arrays.
yeah?
object instead of array
use Object.assign
@digital ibex with that new data in the db could i then do something like
let role = guild.roles.cache.find(role => role.name === settings.autoRole);
member.addRole()
https://throwbin.io/FRA3ImR here is the genres description. i want to get all
Throwbin is a website where you can store text online for a set period of time.
example: Object.assign({}, [“bob”, “bob”])
bob
yeah, @charred geyser
nice
idk about the member.addrole bit, but it seems right to me
using pil how can i center text on an imahe:
it might have to be member.addRole(role)
or something
iim not sure
ill look it up
member.roles.add()?
how does one specify the role?
@earnest phoenix have an array with objects inside, and map through all of them and then the Object.assign bit
you can use just ID
but considering the codeblock
let role = guild.roles.cache.find(role => role.name === settings.autoRole);
would that give an id?
discord.js is weird sometimes...
TypeError: Cannot read property 'autoRole' of null
this is the way it is defining settings
const settings = await Guild.findOne({
guildID: guild.id
});
and then the role gets settings.autoRole
the guild doesnt exist in the collection
yeah it should
console.log(settings)
no
uhh
ok
let settings = await Guild.findOne({
guildID: message.guild.id
}, (err, guild) => {
if (err) console.error(err)
if (!guild) {
const settings = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
guildName: message.guild.name,
prefix: process.env.PREFIX,
autoRole: "null",
joinMessage: "null",
leaveMessage: "null"
})
settings.save()
.then(result => console.log(result))
.catch(err => console.error(err));
return message.channel.send('This server was not in my database! I have now added and you should be able to use bot commands.').then(m => m.delete({timeout: 10000}));
}
});
why are you reassigning settings?
if the guild doesn't exist in the db
remove the const
it needs to add it
yeah
the info updates
like
the bot and the dashboard both update the prefix
in the db
what is Guild ?
const settings = await Guild.findOne({
guildID: guild.id
});
that Guild
anyone know pul:
just ask ur question
how can i get the actual ammount of users of a guild
<Guild>.memberCount?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
ok better
idk if it applies but to get the total number of users my bot is used by is client.users.cache.size
That applies to the total number of users your client has cached.
Freaking did you ask
how do u expect someone to help you if u dont ask ur question
Can you link to it
how do i center text in PIL
🤔
like this?
not center in the middle, but like in a area
draw.text(((MAX_W - w) / 2, (MAX_H - h) / 2),astr,(255,255,255),font=font,align="center")
im doing welcome cards
draw.text(((MAX_W - w) / 2, (MAX_H - h) / 2),astr,(255,255,255),font=font,align="center")
@charred geyser center of image tho
align="center"
i found all of these
but its like center of a specific area
like bottom middle
this is it
it works
but its a bit off
change the dimensions?
well i did
the thing is, itll be customisable
so i just need to figure out how to get it centred in the bottom
im assuming the 255s is the height, length and width
change the 2nd 255 maybe a bit lower to 240 or something (assuming the order is width, length, height)
sorry, i’ve not used mongoose in a while :/
rip
well its not working
@drifting wedge is there pil support?
?
like a discord support server for PIL
im not even familiar with python sorry
Ignoring exception in on_ready
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "bot.py", line 10, in on_ready
await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))
AttributeError: 'Command' object has no attribute 'Status'
errors are bad
someone should make a language where its impossible to get an error
Ignoring exception in command help:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot.py", line 17, in help
embed = discord.Embed(
AttributeError: 'Command' object has no attribute 'Embed'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Command' object has no attribute 'Embed'
message.user.id viewing user id, i will only view user name example Musti#0001 how to?
ingilizcemle dalga geçmeyin
message.author.tag
eyvallah reis
how can i filter from the json file?
i want to get the id of the queue whose name is test.
{"id":12345,"name":"test"}
then add .id after filter
How do we fit the id of the test as message.channel.send()?
Object.entries(users)
Returns
[
[
'0',
Collection [Map] {
'316736211266043904' => [User],
'725729827683827782' => [User]
}
]
]```
How can I access the length of the collection?
returned undefined, ended up doing Object.entries(users)[0][1].map(size => size).length
Looks so ugly 
TypeError: Cannot read property 'autoRole' of null
@charred geyser remove const from inside of the part where you define guild
cause it’s only inside of that part not going out
How do you change the color of either your buttons or you background on a top.gg bot page in which you own?
you can use html/css on long description
@charred geyser remove const from inside of the part where you define guild
@thick gull which file?
please give 7/24 join a voice channel code me
earlier
if (!settings)
settings = create new guild
im wanna play it
etc
play it in your own server
it should work then
i haven’t touched mongoose in a bit
buy why dank muted in here?
@thick gull like this
@charred geyser I haven’t touched mongoose in a while iirc they way you had it earlier is just basic js if I’m looking at it correctly while tired asf
if (!settings) settings = new settings
like that should work
but by adding const
i believe it’s limited inside of the if statement
is it working fine(?)
try logging it inside of the if statement
oh
its the other part thats the issue
show
getting the data from the collection
const mongoose = require('mongoose');
let Guild = require('../models/guild');
const Discord = require('discord.js')
module.exports = async (client, guild, member) => {
let settings = await Guild.findOne({
guildID: guild.id
})
console.log(settings)
member.addRole(guild.roles.find(role => role.name === settings.autoRole));
};
TypeError: Cannot read property 'addRole' of undefined
is that in a event
hm
well the error is that member isn’t defined
so perhaps you have something wrong there
like the placement
does ffmpeg support yt streams?
google it
I’m not sure but that seems like the error
there is no errors until addRole
well I haven’t used the member create thing, but the way it works with reactions; messageReaction.message so I’d presume that it would be the same with guilds
member.guild rather than guild and member
anyways iM probably wrong
but hopefully that helps
lol
it seems like no matter what i change TypeError: Cannot read property 'addRole' of undefined
is always the error
i have a %prefix command which updates the prefix
and it liike
actually updates the collection iin the database
and this autorole uses the same method
well similar
How do I add my bot to this server?
well similar
@charred geyser it’s 100% the variables
reason settings is null, guild is undefined
try logging everything Idk anymore lol
how can i add a reaction to a message
and check if the user clicked the reaction?
check dpy docs (?) kekw
i did
rip
you will not believe it
here is the "autoRole" part of the guild_settings Schema
and this is what i wrote
bum bum bum
i litterally spent hours on this
and all it was is me typing the wrong name in lmfao
must be role.add()
can anyone help me? I can't get out of that loop
😩
is keep senting me 3 messages at a time
put return at the end
oh apparently
at the end?
if (something){
return
}
@sweet kestrel you just space the await ctx.send wrongly so it gives indentation error
where do i put return
inside an if statement
I know, but i don't know how to fix it @radiant kraken
I know, but i don't know how to fix it @radiant kraken
@sweet kestrel align the await ctx.send with the top
@carmine summit like this?
let role = guild.roles.cache.find(r => r.name === settings.autoRole);
member.roles.add(role).catch(console.error);
await self.add_reaction(accept_decline, emoji=":red:752330198808133642", ":blue:752330312381628517", ":skipquestion:752330657446756382")
sends 404
is this wrong?
what the/....
await self.add_reaction(accept_decline, emoji=":red:752330198808133642", ":blue:752330312381628517", ":skipquestion:752330657446756382")
is there any thing i did wrong?
@sweet kestrel is there an error?
Have you tried using message edit?
im trying to add rwactions
Align the em = with the await ctx.send
brug
You can get errors in python just because of wrong spacing
offtopic
aren't you supposed to put return before await ctx.send()?
define the embed first
No it's just a misalignment of the spacing iirc
wait, @pale vessel which ctx.send are you talking about
there's 3
@radiant kraken do you know how to fix it?
null will help you, i'm a noob
lmao
wait after the return you added a 4 space
No i meant after the opening crafting table and return, you added four more spaces
The await before the else is not in the if statement
no it will still be a loop
what is it returning
break?
Your await ctx.send embed is in the for loop, not in the if statement
oh
await self.add_reaction(accept_decline, emoji=":red:752330198808133642", ":blue:752330312381628517", ":skipquestion:752330657446756382")
is this right?
i want to add reactions
bruh
it gives me some syntax errors
how to get out the loop and make it a if statement then?
still TypeError: Cannot read property 'autoRole' of null
i litteraly don't know how to do that
like indent?
em.set_thumbnail ...
await ctx.send(embed=Em)
liks that

Hi, someone knows why my .js files are not loading?
https://i.imgur.com/rnl9EN9.png
I use nginx:
https://i.imgur.com/Yr0C47W.png
I tried accesing using the browser, but nothing
https://i.imgur.com/RVQ6Sj3.png
3 message at a time again 😦
add break after the ctx.send
yeah
is guildID: guild.id ok?
No in a new line
Yes
wdym @charred geyser






