#development
1 messages ยท Page 968 of 1
try lower()
i did
i don't use python so i'm not sure
nah it's string.lower()
yea it isnt that
this is something else i used to do it as
@client.event
async def on_message
where it gets the message content
but now im trynna rewrite using @client.command
ah
yea apparently makes it so uur code is cleaner
got it
u just pass in a case insensitive param
case_insensitive=True yeah
i was about to send it haha
maybe shldve done this before
lol
ty!
ok now idk how to make thhe prefix case insensitive
;-;
"Aaaa".toLowerCase()
doesnt work
;-;
client = commands.Bot(command_prefix='pt.'.lower(), status='Online', case_insensitive=True)
U sure?
ye
The last argument was supposed to make it case insensitive
wdym
Get the user input (the message) and make it lowercase
Then compare with the prefix
did u do ur bot in pytthon?
anyone have level up raw?
bruh
Im trying to setup an api
for Time
but I need to put the auth key in a header
idfk what that is, or how to do it
and when I try I get 404
First of all you're calling the wrong url if it's giving u 404
A header is kinda like a field in a http request
thats whats annoying, its like the alex api
that messes up images
with the user ids, and stuff
const request = require('node-superfetch');
Use node built-in fetch
fetch('someurl', {
method: 'themethod',
headers: [
header1: 'somevalue',
header2: 'anothervalue'
]
})
If you wait me finish typing
sorry, lol
That's a promise btw, so remember to handle it properly
ye
Just note that native fetch doesn't have a timeout
So you might get stuck in a request
thx for the help
How do I add code to my bot?
use IDE
He clearly doesn't know what an ide is lol
lol
@turbid nova but you can add code by mobile
using repl.it
and opening it on your mobile
but it might be tedious and hard
btw
const args = message.content
.slice(PREFIX.length)
.trim()
.split(/ +/g);
const command = args.shift().toLowerCase();
this is from v11
how do i write it in v12
doesnt work
Only some big changes that seem to break people's code is the use of managers
yo
is it normal for a bot whose in 1 guild and serving 3 users and it uses 10mb
is that normal>
its python btw
is it too much or less
fetch('someurl', {
method: 'themethod',
headers: [
header1: 'somevalue',
header2: 'anothervalue'
]
})
@lyric mountain the headers lol
how do i get rid of these warnings
what does they say when you hover over em
best discordbot making free website
what>
read up
uh k
can u tell?
i want to say you that ,, I want any free website which is used to make discord bot
so you cant help
wtf
no i never use bot making things
there is no website for "making bots"
yeahhh'
like discord bind
??
*bot bind
i have no idea what you saying
ok bro
its ok , thanks


how to type or in code lan
learn any programming language first
i know c++,c,c# and java
then code in em
java is not that perfect of mine
why bot maker
even C#
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
there arent really an working cpp libs
there are
this is gonna sounds stupid but why would this output the meow message if the reaction.message.id isn't in the database? and I double checked...the db is actually empty...js client.on('messageReactionAdd', async (reaction, user) => { if (reaction.emoji.name === '๐ซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); // console.log(ticketConfig) if (ticketConfig) { reaction.message.channel.send(`meow`) const findTicket = await StateManager.connection.query(`SELECT * FROM tickets WHERE authorId = ${user.id}`); } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } } });
LOL
what about aegis.cpp
nadeko is c#
and nadekos code is very very shit
that part i can agree with
kwoth is the biggest clown of a dev you can find
the last commit was 5 months ago
it could still work for most things but using like
any other language would probably be better
can you guys take this somewhere else so my question doesn't get buried...
discord.js and discord.py are the most well documented
the ticket config still exists
it is a variable that exists
no it doesn't...it's legit an empty db
oh duh lol sorry I just realized that
debug your code, debugging exists for the very reason to answer why questions
its generally good practice to print whatever variables arent working
or console.log in your case
wait...no you are wrong...I'm checking to see if a certain row exists...and that row doesn't exist...
yes I see that
you create the variable here
you check to see if it exists here
you dont check to see what the value of the variable is
yes and it checks MySQL for a row with a certain value...that value does NOT exist therefore it shouldn't be running that
which is why its triggering the if statement
the value doesnt exist so the variable is Null
or whatever the return type is for that function
it is most likely Null
anybody know of a good dotenv lib for python
ok so I checked if it's undefined and it works but now if it's not undefined it it continuously going to the else statement
sorry Jazz I don't
this doessn't look like it's undefined to me... https://prnt.sc/sxmnk1
so now it's just always skipping the if statement with this code js if (reaction.emoji.name === '๐ซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); console.log(ticketConfig[0][0]) if (!ticketConfig === undefined) { reaction.message.channel.send(`meow`) } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } }
I shouldn't have to...it's not undefined
When this is ran in the code it does not seem to work because it does not change the game or the status of the bot any ideas
async def on_ready():
await bot.change_presence(status=discord.Status.dnd, activity=discord.Game('!help'))```
It used to work like 3 weeks ago though
any idea on my issue of it not doing the if/else statement right?
how to put random condition in java
try ticketConfig !== undefined
you answered mine?
no
if resp.status not in [200, 404]:
raise exceptions.WebAPIInvalidResponse(
status=resp.status
)
if resp.status == 404:
await ctx.send(
ctx("API Error")
)
return
data = await resp.json()
print(data)
# print(data.location.name)
location = data["location"]
print(location)``` hey so i cant manage to get the name from json data
the name is located in location
but idk how to get it help 
how to put "or" condition in if...else java
isnt it ||
try
ticketConfig !== undefined
@pale vessel nope...which was expected lol
please give an example@fiery stream
!== is for math I believe
@terse lynx
if (1 || 2) {}
else {}
@fast trench no?
!== means doesn't equal which works for objects and strings and arrays
well I know it's not for comparing to 2 things like I'm trying to do...I'm trying a different setup real quick
@terse lynx idk java but it might be like ```if (food = food || 2+2=4) {}
something like that
^
wdym
??
what do you mean?
user typed = .tip
bot sended = top
(i want that my bot also say tip in random )
nvm I got it a different way lol
If you want something "random" in Java (such as generating a random number), check out the java.util.Random class
@fiery stream are you asking how to get a dictionary key from a nested dictionary? If so it's just data["location"][whatever]
like you just keep going with the brackets
so next should be name?
yeah
@noble bay ^^?
thx
wait...not working...now it's just going to the if statement again...
just check for the value of the return, you know what you want it to be
the data type I mean
not sure what you mean
well firstly, what does the console.log output
if it's undefined its still doing the if statement...It shouldn't be doing the if statement
im very confused
I'm not fluent in JS so I can't help you with specific syntaxing
but what I'm saying is to check to see if it's a string
it is constant
if that's how you're storing it
what format are you storing the variables in
VARCHAR
oh wait
i don't think that matters in this case
do you have any ideas?
please suggest me any non coding free website for bot
because it's obviously not undefined and it's still acting like it is...https://prnt.sc/sxn1ed
please suggest me any non coding free website for bot
message.author.presence.status
Rishit what do you mean
@scenic geode
YES
sounds like discord bot maker
why would this be skipping the if statement if ticketConfig[0][0] isn't undefined in the db? js if (reaction.emoji.name === '๐ซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); console.log(ticketConfig[0][0]) if (!ticketConfig === undefined) { reaction.message.channel.send(`meow`) } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } }
if (food == food || 2 + 2 == 4) {}
@noble bay im gussing you know python i have one more question i got this code (url=data["current"]["weather_icons[0]"]) i cant get the array part to work in weather_icons[0]
that's not how you check for undefined values
since rows are always sent (they could be empty), you can just check by using if (ticketConfig[0][0]) {}
you can't just check by undefined
how do you find a tagged user's status
like the author's status is
message.author.presence.status
@sudden geyser do u know
negate the item
that's not how you check for undefined values
@copper cradle that's how I do it in all my other commands and code...
does anyone know
try what i sent
or just do if (a) lol
uhhh
@fiery stream brackets on the outside
yeah
wdym
please suggest me any non coding free website for bot
since rows are always sent (they could be empty), you can just check by using
if (ticketConfig[0][0]) {}
@pale vessel yeah but it doesn't allow empty data in the table...every box has to have a valid message id
@noble bay can i get an example?
just do if (a) if it exists if (!a) if it doesn't
[weather_icons][0]
i meant that if nothing exist from the query, the rows are empty
ohh
@terse lynx they already did
and do i have to double quote 0? @noble bay
just do if (a)
if it existsif (!a)if it doesn't
@copper cradle tried
if the first element inside an array exist, it's not empty and there's result
no just the weather thing
@fast trench where
oh it still didn't work?
bro discord bot maker is paid
no...that's been the problem
flaze
console.log(ticketConfig)
have you tried like n
do u use node-supefetch?
node-fetch
coding it by yourself lol
ok and it logs it correctly
ah
i don't need node-superfetch
bot maker software isn't supported in this channel
would it be possible
iirc sql databases output as tuples
could u help me
i need website
but maybe that's just SQLite
https://gyazo.com/f03c2a3e638e76415a3bd2998ed87108
I have put the login details and still is not working.
not an application
it logs ticketConfig correctly
send a screenshot of the output
what happens if i send one from the source?
huh?
can someone get banned from this server if they stole my accidentally leaked token?
ye
ok
zod Dm a mod
ok
you can regenerate bot tokens and changing your password changes your token@open oracle
what happens if i send one from the source?
@pale vessel huh?
i did
^
they deleted my whole discord thankfully i had a template
https://prnt.sc/sxn5py
here is what it logs
but they unlocked my minecraft server console
im so happy that there was no damage done to that tho
?
not you
sooooooo'
if console.log(ticketConfig[0][0]) works then js if (ticketConfig[0][0]) reaction.message.channel.send(`meow`) should also work. weird
it doesn't though
oh I thought you meant that in a sarcastic asshole way lol I didn't see you put weird
you're an asshole yourself
ok just to be clear
console.log(ticketConfig[0][0]) really works right?
oh wait...I think I made progress lol one second
flaze
yis
thanks for the exmple
and it's working all of a sudden ๐ idk why but when I changed the !ticketConfig === undefined to just ticketConfig[0][0].messageId it started working for some weird reason
actually it's this sorry ```if (!findTicket[0][0].messageId === undefined) {
oh
yeah idk ๐คทโโ๏ธ
why don't you just use !==
! on the front is out of place imo
not that you care anyway
Why is it not outputting anything
https://gyazo.com/f03c2a3e638e76415a3bd2998ed87108
I have put the login details and still is not working.
cool enough?
hi
hello
whats wrong in this
if message.author.presence.status === "online"
const onlineEmbed = new Discord Message.Embed()
.setColor('#00ff00')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Online`**")
message.channel.send(onlineEmbed)
if message.author.presence.status === "idle"
const idleEmbed = new Discord Message.Embed()
.setColor('#ffa500')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Idle`**")
message.channel.send(idleEmbed)
if message.author.presence.status === "dnd"
const dndEmbed = new Discord Message.Embed()
.setColor('#ff0000')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently on **`Do Not Disturb`**")
message.channel.send(dndEmbed)
else
const invisibleEmbed = new Discord Message.Embed()
.setColor('#f0f0f0')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Invisible/Offline`**")
message.channel.send(invisibleEmbed)
hi
plz someone tell
whats the error my guy
if message.author.presence.status === "online"
^^^^^^^
SyntaxError: Unexpected identifier
you're using js
You're kind of just throwing random stuff out there.
um else or if function is wrong
@fiery stream LoL humidity: 9, 9 what. Temp 33, 33 what. Wind: N0
what
The language can't read your mind. You need to provide it valid syntax. if requires parentheses.
@grand dagger thats api and its correct and N in wind stands for north
m/s?
km/h?
if (message.author.presence.status) === "online"
^^^
SyntaxError: Unexpected token '==='
now getting this
mph
if (message.author.presence.status) === "online"
const onlineEmbed = new Discord Message.Embed()
.setColor('#00ff00')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Online`**")
message.channel.send(onlineEmbed)
else if (message.author.presence.status) === "idle"
const idleEmbed = new Discord Message.Embed()
.setColor('#ffa500')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Idle`**")
message.channel.send(idleEmbed)
else if (message.author.presence.status) === "dnd"
const dndEmbed = new Discord Message.Embed()
.setColor('#ff0000')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently on **`Do Not Disturb`**")
message.channel.send(dndEmbed)
else
const invisibleEmbed = new Discord Message.Embed()
.setColor('#f0f0f0')
.setTitle(`${message.author}'s Status:`)
.setDescription("You are currently **`Invisible/Offline`**")
message.channel.send(invisibleEmbed)
i love how itโs stated
thx ig
what
multi that code is all wrong
how
not all but yeah
you need to close it after the condition ends
)
it works this way so it's good lol
@fast trench You talking to me?
after each if?
you're closing it early
@vale garden your way (message.author.presence.status) === "dnd" correct way (message.author.presence.status === "dnd")
ok thx
dont mind the ")"
const onlineEmbed = new Discord Message.Embed()
^^^^^
SyntaxError: Unexpected token 'const'
now why is this
an error
add curly brackets
uh i dont want to spoon feed this guy
this is not python lol
for the embed?
somebody please help him
learn javascript
thx @pale vessel for that ^^^
learned something lol?
they need a command like TheSourceCode server has that links to different djs doc pages lol
itโs still ass
howwwww
yeah what does that mean
wait how is humidity measured tho
so in percent?
hereโs mine
@grand dagger only the "ยฐ" stands for celsius too huh
it means degree
im dumb at this stuff ๐
ยฐF, ยฐC
is the c supposed to be capital?
ยฐK lul
Iโm not sure lemme check
yes
ยฐC
is that fine now lol
๐
can someone help me with canvas in js
i suck at that
ion know what that is 
its like drawing with code
ya
i just get tons of errors
uh i have no idea how canvas works sorry
k
The one I use had a large database, but it blocked my vps from connecting to it
Oh that
yeah
ik what ur talking about
yeah that part of it sucks
I shall keep looking
yeah
is that find or something wrong with this too
oh thx
I have a date for when they created their discord account
You could add that 2 if u want
y
really bruh
itโs literally one of the only sick things
An info command tells you
(Is this person an alt? Y/N) xd
This seems useful to me
get member
^
date#now - api#date
I think
smh
Sup
by public i mean the upload part
also art shouldn't you just have an info command that displays all of the info instead of a unique join date command
Y tho
that seems wasteful
bruh
y not
it wastes memory
the dumbest thing happened to me
that's a lot
mine never goes over 10mb
People spam ping my bot and my computer dies
mine never goes over 40 and it's quite robust
art how many people use your bot?
not many only 2k members
the number of people using it shouldn't impact the memory much
oh well mine is used by 3 people in guild as of now
each asynchronous function uses kilobytes at most
a few of my commands do heavy computation
Mine is used in 20 servers or so
mine is in a server with 2k members as well
quite impressive
yo guys
cards against humanity soon
anybody here older then 18?
Iโm 18
i got locked out
I am 18
and i cant test nsfw commands
Ah
lmao
Sounds like a job for horny teenager
true ^^
not me
Not me either
if anybody wants to help me lmk
no the thing is the asked me age when i entered nsfw
@commands.is_nsfw()
discord does
not my bot
not the bot
oh
Yeah mate I'm 2828282828
its discord's new thing
Yeah discord did that recently
Oh
Good thing my bot isn't nsfw
nope
LOOOOOL rip horny children
re
mem
ber
okay peace out imma do some testing
Gl
have you really spammed their API that much
got a smart ass bot dont i
well
you need to have that
To have any nsfw commands
Xd
to put it on bot.gg
Atleast
true but the way he tells the general needs to be nsfw
Alright
Dw bout what it does
y'all got weird stuff going on with bots
command list of what?
of ur bot
well im making a bot rn
i c
and i dont think im plan on making that
its just gonna be a in bot command list thing
So built in command list?
yeah
other thing is 2 much work
xd
its not like i cant do that but im lazy
rn im just going for a good bot that can get me a badge
yeah
have what 1?
Website
oh i got multiple
To list the commands
not for bot tho
actually i do got one website for bot
its old rust bot that i made a while back with friends
Nice
Java

why crab o=lol
y not
f
yeahh
its api
the apiโs the issue?
yeah
Which API
import nsfw_dl its a python package
oh
yeah
I use rest apiโs for my nsfw commands
oh you got link
everything lol
Nice.
can i get the links lol
print(member.activities.) guys im having trouble unpacking tuple help
i want to access the spotify data help
Is doing client.connect() required to send a message to a DM channel?
print(member.activities.title) i would really appreciate if someone could help me
print(member.activities.title)
AttributeError: 'tuple' object has no attribute 'title'```
actually i need it for a spotify command
and i have no idea how i get that from there
You also might need a check to ensure it's Spotify
Tuple
Probably a for-loop with comparing activity.type tl discord.ActivityType.listening
Or if you are really sure the user has only Spotify as their presence and cba to do it, member.activities[0]
when i do [0] it just prints "Spotify"
Yeah, because print calls str() on the object
uh ahk
repr owo
You still get an object with accessible properties
Yeah, repr sounds appropriate
ctx.send("No Music Found")
return``` is that good enough for check
@slender thistle
nope
ctx.send("No Music Found")
return``` now?
isnt mine correct tho
That's quite a workaround
k cool
Can bots read an entire channel?
depends
Duration: 0:03:19.534000 how do i get rounded duration lol
round the seconds before inserting
Probably round() :p
ohk lol
Is logging in the bot required to send messages?
hi i am discord.js new leaner i have to set help command in embed anyone can help
yes Sun! The bot must make a connection with the gateway
Sending a message is an API call
I believe it only needs to be connected once since the the bot account was created and then you can send messages without active connection
Yup, it doesn't say anything about an active connection during sending
yeah ^ that's true
hi i am discord.js new leaner i have to set help command in embed anyone can help
@earnest phoenix https://discordjs.guide/popular-topics/embeds.html#embed-preview
ok
gl
and dont copy paste the code, try to understand it
ok but channel is not defined channel.send(Embed);
@earnest phoenix
message.channel.send
yes
is there any half decent lib for js that can convert times reliably (ie. 12h or 12 hours) to milliseconds
@sick cloud https://www.npmjs.com/package/ms
cool thanks
and is there any library to convert them back to being readable that isn't huge
humanize is ok but big
this can
ms seems like it'll work
message.channel.send
@honest perch or get(x)/the id of the sv and then send(r)
Depends where you want to send the embed
so to get the time it'd be after the time provided, Date.now() + ms(...) should work right
Dumbass question, but how do you ping a role by ID in discord (like how you do @proven sorrel for users, but for roles)
<@&id>
put the role id
Ohhh that's it thank you
yee
<@&265125253443878912>
Examples
ms('2 days') // 172800000
so i could add Date.now() to that to get the time in 2 days basically
momentjs
yeah
moment().add(2, "days")
ms already does conversion
that's how i do it for refreshing oauth tokens
why would i install another module
because the js ecosystem promotes bloated design
why do you need high accuracy ms though
because the js ecosystem promotes bloated design
that's an under statement.
reminders
oh i should try adding that
although i've actually never seen an implementation of it
i'm just adding a crap basic one to my mod bot
help ?
Is a timmeout error, it appears when the connection between your bot that is in vc and discord sv is not stabile, time is 15 secs, obv the bot didnt connect, try again to upload the code, thats an error on music bots, in vc
Is a timmeout error, it appears when the connection between your bot that is in vc and discord sv is not stabile, time is 15 secs,obv the bot didnt connect, try again to upload the code, thats an error on music bots, in vc
@earnest phoenix has a solution?
basically the connection is not stable, try to run the code on cmd or on node(swich the one you use), idk, is an normal error, try again(as sometimes when you as a user connect to vc and have a big amount of ms the connection is no longer stabile and you might get disconnect, like this is the bot too), im not so much into a discord music bot but i believe that you cant fix that;
Strange, because I have a simple music bot without advanced commands and normal correct
connect*
is an usual error
sorry my english i'm brazilian
is ok im not native too
so there's nothing wrong with programming?
Hello!
Hello
[13:01]
Can anyone help me in a oding??
[13:01]
*coding.
[13:01]
I have this problem "Cannot read propery 'for each' of undefined", Array.forEach (<anonymous>)
[13:02]
It started when I added the Muted command
[13:02]
and when I remove the command.. it works.
[13:02]
any help?
no, i dont think the code is wrong
@earnest phoenix at least you can play one song without error right?
casue if you can play that means that is ok and the error happenes
all other functions work normal, except music
Hello.. can anyone help me? I have this problem "Cannot read propery 'for each' of undefined", Array.forEach (<anonymous>)..
It started when I added the Muted command.. and when i removed it.. it works..
Any help? ๐ฎ
it worked to play at least one song? bcs last time i tried musc, the error was like after 10-12 songs played
in the other bot yes, if I add more functions it will give an error
debug your code, hamoodi
debug your code, hamoodi
@earnest phoenix I tried.. it didnt work
it worked to play at least one song? bcs last time i tried musc, the error was like after 10-12 songs played
@earnest phoenix don't even touch the first
then you didn't try
if you had debugged you would have found your issue already
How can I do that?
@earnest phoenix true
imagine claiming you debugged when you don't know what debugging is 
dont be so mean
inspect your variables and log on every closure
follow all the parameters
@feral aspen
that will tell you to what point the code had executed and what the values of the variables are
and the logs sometimes might help
When fetching messages from a text channel in discord.js by a limit or time period rather than an ID, are the messages in the order they were cached?
const reminders = client.data.reminders.filter((x) => {
console.log(Date.now(), x.expiresAt, (Date.now() >= x.expiresAt))
return (Date.now() >= x.expiresAt);
});
console.log(reminders.length)```
1591866465629 1591866020858 true
undefined
am i doing something stupid here
it returns true in the filter but returns undefined
I've never seen a filter done like that before tbh
it's just a multiline
Are the other bits meant to be separated by commas or should it be semicolons?
console.log is just for debugging and makes zero diff
see which type reminders is
stringify it and see the props
Hey idk if I asking questions in right channel so my question is how can I add manual shard system In python
do you need to shard
Yes we need to shard
how many servers do you have
1830+
no
you can setup sharding, most libs provide automatic deployment of shards.
if you don't need it, it'd only deploy one shard.
I need help to figure out if it's possible to configure a discord server so that a discord bot with Server Administrator privileges can.... reference a Server Role, but without @mentioning it.
A while back before a particular Discord update, roles were able to be confisued so that nobody could @mention a role, not even owner/server admins, and when a user tried to @mention the role, it appeared as plaintext, but still it was possible for bots to be programmed to present the role in a message as a kind of @rolename link, but it did NOT ping or mention that role!
But now, that seems to not be the case. Now even if a role is not flagged as @mentionable, a user/bot with Server Administrator privilege causes the role to be @mentioned. Is there a way to configure a bot to be able to make the role name @linkable but without causing a ping @mention notification for users with that role?
I think your best bet is embeds
This is probably more related to permission, server administration than bot development, but, I guess regarding development, is there a way to recreate the old experience where a role can be @flat lantern without mentioning it, perhaps as part of sending a flag to Discord API along with the message?
oops, sorry, I didn't mean to mention anyone
Ah, I almost figured out, but not quite.
Nice
that just pinged mods
Well
Wait what
-atmods
Awesome.
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
It's still a mention
how do i send a dm
what library?
discord.js
<user>.send(CONTENT)
thanks
Is there a possible reason as to why my clusters are constantly dying when I never had this kind of problem before?
any errors?
What value do you guys use for messageCacheMaxSize (discord.js)? I have it currently set to 20, but I'm wondering if I can reduce it further without adverse effects.
If you don't use cached messages at all, set it to 0
thats sometimes not the best choice, it's best to set it to a low value, even if you don't think you'll be using it
discord.js treats cache like a king
i set it to 5
but it doesnt matter for me because i dont cache channels (only active ones)
so even if i cached 200 messages it would still be less than 5 messages on thousands of channels lul
I don't think setting it to 0 would have any side effects
Other than maybe channel.lastMessage being null
when i try to start my bot, i don't get anything? This is all i got after 10mins in my Terminal
if it didnt return control do you, that means its running
does it not come online?
bOt AwAiTinG aPProVal
me and a friend are making a warn command on discord.js and we get a error whenever we try to warn eachother? Anyone know what this error means?
TypeError: Discord.RichEmbed is not a constructor
at Client.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:578:22)
at Client.emit (events.js:224:7)
at MessageCreateAction.handle (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\c```
Hey guys I know using html to change my bot page but how do I make the bot name different colour I tried with h1 and h2 but that doesn't seem to change that
Thanks in advance
Oh wait I've worked it out
Oh I didn't realise I was in v12 ๐คฆ
oh lel
I'm so confused rn, I edited my ban command to DM a user right before they get banned and then I randomly got this error.. can someone help me?
PS C:\Users\Jon\Desktop\SpiderBot Project> node .
(node:4816) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
Logged in as SpiderBot#9421 with a ping of 436ms
C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150
throw new RangeError('BITFIELD_INVALID');
^
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
at Function.resolve (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150:11)
at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:45:28)
at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\Permissions.js:45:85)
at C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\structures\GuildMember.js:268:53```
I don't even have a bitfield.js
I'm so confused rn, I edited my ban command to DM a user right before they get banned and then I randomly got this error.. can someone help me?
PS C:\Users\Jon\Desktop\SpiderBot Project> node . (node:4816) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit Logged in as SpiderBot#9421 with a ping of 436ms C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150 throw new RangeError('BITFIELD_INVALID'); ^ RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number. at Function.resolve (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150:11) at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:45:28) at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\Permissions.js:45:85) at C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\structures\GuildMember.js:268:53```
@still merlin it's about your permissions
Did you use message.member.hasPermission ?
yeah
what did you put in there
return message.channel.send(
"**error** You don't have the ban members permission!"
);
const member = message.guild.member(user);
let dmsEmbed = new Discord.MessageEmbed()
.setTitle("Ban")
.setColor("#ff7f27")
.setDescription(`You have been warned on __${message.guild.name}__`)
.addField("Banned By", message.author.tag)
.setFooter("๐ฃ๏ธ ๐จ");
user.send(dmsEmbed);
message.delete();
message.channel.send(`${user.tag} has been banned`);
if (member) {
member
.ban({
reason: "",
})
.then(() => {
message.channel.send(`โ
I have banned ${user.tag} โ
`);
})```
instead of the comma put ||
no?
what comma though
no.
if (!message.member.hasPermission(["BAN_MEMBERS" || "ADMINISTRATOR"]))
it works as is
^
what
hlo
then you are pepega
shut up
Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager()
let shop = new Eco.ShopManager()
module.exports = {
name: 'buy',
description: "for buying items in the shop",
execute(message, args) {
let water_bottle = args[0];
let add = shop.getItem(message.author.id, "water_bottle");
let subtract = eco.removeMoney(message.author.id, 750);
if (!args)
return message.reply("Please enter an item to be bought like this for example:\n2t!buy water_bottle")
if (args[0])
return message.reply(`You have bought a ${getItem.item.Name} for ${removeMoney.amount}`)
}
}
my code ^
and im getting this error
execute(message, args) {
^^^^^^^
SyntaxError: Unexpected identifier
help
Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id
Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id
@autumn summit <array>.find(variable => condition)
@vale garden put function in front of it
tysm
hello
and shut the fuck up
ask once, you don't need to spam
not you
kk
caca
function in front of what
not working bruh
go learn javascript
learn how to pass a function
Apparently its my warn command thats giving a weird bitfield error thing..
the code is
let args = message.content.substring(prefix.length).split(" ");
switch (args[0]) {
case "warn":
if (!message.member.hasPermission("MANAGE_MEMBERS"))
return message.reply(
"**error** You need the manage members permission to do this!"
);
let reason = args.slice(1).join(" ");
let user = message.mentions.users.first();
if (message.mentions.users.size < 1)
return message.reply(
"**error** You must mention someone to warn them!"
);
if (reason.length < 1)
return message.reply(
"**error** You must have a reason for the warning!"
);
let dmsEmbed = new Discord.MessageEmbed()
.setTitle("Warn")
.setColor("#ff7f27")
.setDescription(`You have been warned on __${message.guild.name}__`)
.addField("Warned by", message.author.tag)
.addField("Reason", reason);
user.send(dmsEmbed);
message.delete();
message.channel.send(`${user.tag} has been warned`);
}
});
you make me angry
MANAGE_MEMBERS ?
resending what?
What
that's the error
has nobody hear of pastebin or hastebin?
That doesn't exist
it's a lovely thing
nope
dude i do the same thing everytime
I really need to read the docs
execute
yes you do, why are you not reading it, like why?
Try MANAGE_GUILD or MANAGE_ROLES
ok thanks!

