#development
1 messages ยท Page 1564 of 1
actually i could really use a code review xD, well its gcp VM i dont think the internet is bad..
i upgraded it to 16GB 4vcpus
and a separate sql instance of 7.5GB and 2vcpus, i figured the bottleneck is not from the DB side
gcp is soo expensive lul
yeah
how big is your bot?
4k ws ping is horrible
ikr but it fluctuates
Hello
and 600 servers is very little
Please Help Me
really not sure why it keeps lagging
also i noted that whenever i send a message embed, it takesd more than 3sec even tho the data already computed
well if your ws ping is 3k, that explains it
it takes 3 seconds for the command to reach your bot
why is the ws ping 3k in the first place ;-;;
i dont think it has something to do code?
what is those 2.1k players?
Hello everyone.
thats how many users use the bot
thats all?
2.1k thats all ? ;-;
nothing like a game or some activity?
its lagging a lot
itts a game
the bot
really think you have to try it out
xd
how does the game work? what does the bot have to do with those players?
have you tried measuring ram, cpu, disk and network?
yeah i see the graphs, the cpu util is 57% peaked today on a 16GB RAM and 4vcpu VM
your problem?
57% cpu? wtf
I Want To Make Some Commands That Only Voters Can Use
ye
just for comparison
if has votes check the docs
my bot has 7.5k servers and runs on a single 1 core cpu, 1gb vm
and cpu usage is 5%
if has votes
thats the issue
whatever your bot is doing, its possibly doing it very inneficiently
altough you use ds.light
true
djslight doesnt affect cpu
true,
you get the same cpu with djs
im using djs
only ram
not the light ver
also could really use code reviews
since the player base keeps increasing and i have exams ;-;
so need to figure out a good vm
What is the docs exact name ?
Thnx
try measuing some stuff, like nethogs, htop and iotop
install them if you dont have them installed
show a pic of yours and i'll show you
you're using 50% of a single core
scroll down with the arrow keys to find which process is using it
also press F5 to view it in tree mode, its easier to understand
ah so your cpu is not constantly at 50%
yeah the client
does it jump to 50% often? or is it always at 1% ?
and its always the client?
ok
cpu%
what does presences mean?
is it the "listening" thing thats displayed on the bot?
to see people's activity and status
nop
do you have presences enabled in your discord developer app?
nop
does your bot do any downloads?
nop, except for lavalink where it streams YT music but it isnt using much
it streams audio only i presume, lavalink and erelajs
do you mind testing the bot? like actually using it and stuff
ah ok, so that explains these numbers
you might know where its wrong
lavalink?
i even had lavalink on a separate vm
before
when i update my static folder on my website, the code doesnt update when i go to it via domain.com/static/file.js
like any ideas why?
restart?
audio does cause huge network usage indeed, so thats fine
because i dont have audio and these are my numbers at 7.5k servers:
i did already
Either the server is caching, cloudflare (if youre using it) is caching it or you browser is caching it
makes sense
can i fix it?
or just gotta wait?
iotop
well cloudflare you can clear cache or switch to development mode
your browser you can clear cache for that size and storage
if server is caching it just restart it
its not
i think its cloudflare
cuz the other stuff works fine
when i update
wait
the entire /static/ folder isnt updaying
so i think its ngiinx
i dont use nginx for anything other than the reverse proxy so cant help you much there
uhh i dont wanna like restart the server
same
so what can i do?
just restart nginx?
well changes might require you to restart
i restarted the webserver already
check for logs
well then something in your implementation is wrong 
also the browser logs
uhhh
I'd like to ask a question.
I am making a mute command and I basically saved a role ID into a variable named as Mute
Which one is correct.
const muterole = message.guild.roles.cache.find(role => role.id === Mute.id)
// or
const muterole = message.guild.roles.cache.find(role => role.id === Mute)
Which one is correct?
The second one?
Neither. Use get if you have a role's id to get the object
Basically I have the user be able to set a muted role for his server.
And once he set the muted role, the role ID will be saved.
The role id is considered as server.mutedRole
server.mutedRole = Mute Role ID
Now for the mute command to work, should I use get or find?
I did this.
const muterole = message.guild.roles.cache.find(role => role.id === server.mutedRole);
you can use both, but using find is way slower, because role objects are already paired with their ids
so use get
yes
https://sourceb.in/sXc8aLzId6
Its working but when I mute someone like 1h
Its removing the muted role in less than 1 sec
Is there a way to get discord.js to communicate with github and update the code with a command?
Like running git pull ?
Yes, automatically running git pull with a command.
I can't find any documentation on it or I am just blind af
it is not related with discord.js. You can create a exec command which executing command
hm
Look into the child-process built-in module
use built-in module
require("child_process").exec("git pull")
Okay.
mine
Okay, thank you.
So the child process will send a message to the chat or will I have to program that myself?
The child_process module is for executing shell commands
yes you have to code it
Hey, I have done the command and it seems to work, but when there is no ID saved or in other words, equals to null, it errors, and I tried doing this.
if(server.mutedRole === null) {
return message.channel.send("No muted role")
}
Doesn't work.
Better to do !server.mutedRole in case it's undefined and not null
Okay, how would I get it to post the results then? I never used child_process before.
the exec function accepts a callback which contains the output in a string
Okay, how would I put that in a message?
// stdout is your result
});
const muterole = message.guild.roles.cache.get(server.mutedRole);
if(!server.mutedRole) {
return message.channel.send("No mute role")
}
do I make it !muterole instead?
both work, but in the future you may have to fetch the role instead of getting it from the cache, so checking if the server.mutedRole is missing first is better
Ok.
I will do it, one second.
if(server.mutedRole === null) {
message.channel.send("You have not set a muted role.");
}
const muterole = message.guild.roles.cache.get(server.mutedRole);
Is that the correct order?
What database are you using?
Hello
@cinder patio Thank you! It does exactly what I need it to do.
Majority d.js here.
lol
Hi
I am using MongoDB
np! โค๏ธ
GoogleFeud, I have done it all
if(!server.mutedRole) {
return message.channel.send("You have not set a muted role.")
}
const muterole = message.guild.roles.cache.get(server.mutedRole);
Sometimes people put wrong role ID and makes the bot error, is there an if statement that checks if it's a valid role?
You should also check if muterole is undefined
Didn't !server.mutedRole check the problem already?
That only checks if there's a role id in the database
Oh, so !muterole?
oh, wait.. where do people put the wrong id? You're not using any user-provided arguments in the snippet
People will be able to provide a valid role by using my !config command, but if they somehow outsmart the bot and do stuff, I want to do an if statement just to be safe you know, that's why.
You should put a check in !config if the role is valid, and in the snipped above, too
Is there something I could do to check that? if so, I read the above.
I know, but that's my question, how can I check if the role is valid at here..
An if statement checking if muterole is falsey should be enough
if(!muterole) return "Mute role is not a role or whatever."
I put that after declaring it, okay I'll try it out.
@crystal wigeon did u find the cpu issue?
pluginsautomod: true if plugins and automod are both objects how can i get there, because i cant use .?
show your entire object structure
That's mongodb right?
looks wrong for mongodb
yes, i tried js await client.updateGuildData(message.guild.id, { plugins.automod = { enabled: true, ignored: [] }; })
plugins: { automod: { ... } }
show the updateGuildData function
async updateGuildData({ id: guildID }, settings){
let guildData = (await this.guildsData.findOne({ id: guildID }));
if(!guildData) {
guildData = new this.guildsData({ id: guildID });
this.databaseCache.guilds.set(guildID, guildData);
} else {
await this.guildsData.findOneAndUpdate({ id: guildID }, settings);
return guildData;
}
}```
this.guildsData = require("./models/Guild")```
You need to do {$set: settings}
inside the function or the call?
inside of the findOneAndUpdate call
same thing
Are you sure you're refreshing the collection?
anyone here work with python?
dont ask to ask
well then
this is just going to be a dumb question but is it possible to assign an if statement to a value like this? ```py
value = if ctx.author.id is self.config.owner
value = <true condition value> if condition else <other value>
value = "foo" if bar == "baz" else "foobar"
python has more vb syntax than vb has vb syntax
finna be writing with a whole ass english dictionary
yeahhh generally you dont see that sorta stuff
no
Lol
i litterally just say yes and demonstrate how it can be used and you say no
i think i might just pull a big brain move just to make user acknowledgments
you think thats bad wait till you see the pattern matching being added
my god its painful
lol
how to i setup multiple saves for multiple servers?
idk
xD
yeah im just putting the if statement inside the embed
and then ima follow it with an elif
i was thinking about it and it really depends on what your doing
A.) if your working with ranks then you need to make or use a database
B.) if your working with something like prefixes then im sure you can do something with json files
https://developers.google.com/classroom bot dev day 2 (not yet but should i do it)
hm
Does anybody know how to walk through a command folder and reload all the files?
fs.readdir
for each file check if it exists in require.cache
delete it from the cache and re-require it
Okay how do I do that?
Cause I made a command reloader, I just need it to read a whole directory now.
show your command
if(!cmd) {
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`:warning: Error In: Command :warning:`)
.setColor(0xFFD700)
.setDescription(`Hey <@${message.author.id}>! That command could not be found!`)
.setTimestamp(message.createdAt)
.setFooter(config.copyright);
await message.channel.send(`Hey <@${message.author.id}>!`, embed);
}
else {
//
await this.client.unloadCommand(cmd.conf.location, cmd.help.name);
await this.client.loadCommand(cmd.conf.location, cmd.help.name);
client.logger.log(`Loading Command: ${cmd.help.name}.`, "log");
//
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`Done!`)
.setColor(0xA1EE33)
.setDescription(`Hey <@${message.author.id}>! I have reloaded \`${cmd.help.name}\`!`)
.setTimestamp(message.createdAt)
.setFooter(config.copyright);
await message.channel.send(`Hey <@${message.author.id}>!`, embed);
Here is my loader:
async loadCommand (commandPath, commandName) {
try {
const props = new (require(`.${commandPath}${path.sep}${commandName}`))(this);
props.conf.location = commandPath;
if (props.init){
props.init(this);
}
this.commands.set(props.help.name, props);
props.help.aliases.forEach((alias) => {
this.aliases.set(alias, props.help.name);
});
return false;
} catch (e) {
return `Unable to load command ${commandName}: ${e}`;
};
};
@quartz kindle
do you know how to use fs?
fs is a built-in node module
you can use it to read/write files and folders and interact with your local file system
fs has a function to read a folder and return the names of the files inside it: fs.readdir() and its sync version: fs.readdirSync()
and also a promise version fs.promises.readdir()
And a promise ensures that it happens.
or just include fs/promises :D
no, promises have nothing to do with assurance
Oh.
So using fs.readdirSync(); how would I get it to see if a file is there but not in the cache?
the function returns a list of file names as an array
so you have to loop over the array and check if that file exists in your require cache
you probably know how to use the require cache, you should have some code for it in your unloadCommand function
you give it to readdir
I need some help for setting bot vote logs. Can anyone help me please.
Language:- discord.py
Dm me if you know the same
Through Args?
fs.readdirSync("./commands")
sure
lmao fs is what made me switch from js to python
why lmao it's so easy
@quartz kindle So this is what I have:
const folder = args.slice(0).join('');
if(!folder) {
//Returns an error
}
else {
fs.readdirSync(`../../commands/${folder}`);
i think it was because i got mad at it for not reading the directories to make a better help command
recursion is always your friend 
files = fs.readdirSync()
then files will be an array of file names in that folder
Okay, fixed.
also, if you're giving it a user defined folder, use a try catch
Now what?
because it will throw an error if the folder was not found
I should do that huh.
try {
if(!folder) {
//error
}
else {
const files = fs.readdirSync(`../../commands/${folder}`);
}
catch (e) {
console.error(e);
return message.channel.send(`error`);
}
Hows that?
please tell me that discord is just removing your indents?
Yes it is.
lmao so unclean and impure
Trust me I love my indents.
lol someone pinged me again 
@quartz kindle Does that look right?
is
Intel(R) Xeon(R) CPU @ 2.30GHz
Good for a discord bot?
ok
And thats what I'm connected to lmao
A rasberry pi can as well.
if you're looking into buying a vps, dont fret so much about cpu
ram will give you more issues
It will always be RAM.
True
if you have members intent off CPU suddenly becomes a more reasonable factor with growth
at some point you will just get I/O locked
is there a way of adding a user to your mongo db?
atlas
@quartz kindle Could I technically use a crawl function as described here?:
https://stackoverflow.com/questions/59041126/nodejs-discord-js-read-all-files-in-the-folders-of-a-specific-directory
you can manage them over the webinterface, but i cant say where exactly
if you want to search in folders inside folders, sure
well, the error says it all
Even though the directory exists.
if it's a valid directory, try using `${__dirname}/../../commands/Civilian`
I start in my administration folder, then I need to step out into my commands folder and get that one. I might be going too far back.
This is now whatโs happening.
But I also put it before commands so
?
Loading it up like that now
I think it worked! I didnโt get any console logs about the files being unloaded or loaded tho so
@pale vessel
Yup it works!
Thanks guys, sorry I was such a pain.
When I make the command an on_message event it still does not work.
did you take those with a microwave
https://paste.mod.gg always bin your code if you're going to share it
Alright
I will delete these and bin it
https://sourceb.in/Bu0hcqUg8M
Getting a problem with my " tempmute command "
After I mute someone for like 1 hour .. its unmute him less than a sec
How I can fix this ??!
I am not sharing it. I was asking a question
it wasnt a question it was a statement but sure
https://paste.mod.gg/doyuyiyuhu.py No, I asked a question... I asked what I was missing inside my bot.command codeline because the event works, but even when I turn the command into another event, it does not seem to want to do it's function.
It is like Pycharm is not letting me call upon multiple actions or events or commands.
I see No sign of a question but what ever lmao.
no
you're just not using discord.py properly lol
Wdym by that? I can run multiple commands and events on my other bot.
It is set up properly
It is the coding itself
Maybe you should read the link
cuz i can guarantee you're code is causing the error lol
I know it is too, but that is strange because my other bot uses just bot.command and bot.event, no .process required
again, you do... if you're overriding the event that the commands require 
Well I get that, but my other bot does not have it and it runs all events and commands fine
Which is why I was confused

The framework's system hasnt changed majorly in the last 2 years it behaves the same way regardless
you either have a listener or are processing the messages or just not using a message event at all 
I have my other bot in another server lmfao
It is in review rn for top.gg
It works
again, you're point doesn't matter lol The framework doesn't magically behave differently for a different bot
Again, your point doesn't matter because it is in a damn server rn and IS WORKING x'D
I can .bin the code and show it to you
sure 
https://paste.mod.gg/uwucolezoq.sql Same code pretty much the same as the Project Rin code, but this one has been running fine for me
I basically used the RedM Help Bot coding for Project Rin, but for some reason it hasn't been working on Project Rin, just RedM Help Bot.
channel.send(content, { embed })
btw, define "send at everyone"
<3
Okay I see my issue, possibly.. The Help Bot coding says it is somehow saved as .sql when it is .py.. Idk. I have just never ran into this issue before while developing.
are you developing on windows?
Yes
do you have file extensions enabled?
Nope
enable them
he doesn't mean that
that doesnt use on_message
thats just using commands
damn tim
So on_message is what needs overriden?
lmao
override on_message removes it's internal event
which is what the commands use by default
interally it
I need help, Everytime I Type a message it puts out those reactions but i want the reactions to come when im mentioned
How
async def on_message(self, message):
await self.process_commands(message)
Gotcha
message.members.mentions.first() is the first mentioned member, regardless of who is
I thought I used on_message in Help bot..
.first() is not a filter
Guess not Facepalms
I Want it to be specific
oh
so .has?
you need to check if the mentioned id is equals to the id you want
or .has also works yes
Ok
But it does say the Help Bot is Sql and the other one py lmao So I will have to go fix that too
Anyway, thanks. Just feel really dumb rn.
*I just
i mean you did decide to question someone with significantly more experience than you 
Yeah but that isn't why lmao. It was because I thought I used on_message in the help bot
I was just over-looking too much too fast
if (message.member.presence.activities.find(a => a.type === "CUSTOM_STATUS")) {
if (array.some(link => message.member.presence.activities.find(a => a.type === "CUSTOM_STATUS").state.includes("discord.gg/" + link))) {
}
}```
``` TypeError: Cannot read property 'includes' of null```
your trying to access a property that is null
how to check if a user has a status? @fierce ether
do you have GUILD_PRESENCES intent enabled?
@wicked pivot dont ping random people please.
sorry"
yes
Heyyo guys
After playing spotify album trough lavalink
I have this error
GaxiosError: The request cannot be completed because you have exceeded your quota.
It says from youtube api
Gaxios?
you need to check if the user has a presence
.state returns an optional
so if it doesn't have a value, it'll return null
How i can fix it? Without waiting, if i try to play album again, it will again, so i need answer
also, double check you have GUILD_PRESENCES intent enabled
Yea, idk what is this
if(..state !==null)``` ?
?.?
any body elses bots not loading images?
like it just isn't there?
is anyone else's bot not purging messages?
no other bot seems to be able to
Yeah I see now @modest maple I was putting the bot.process_commands at the bottom instead of using an else statement conjoined to the If statement. That was what I was having problems with earlier. I just misused bot.process_commands and assumed it did not need it because I misused it and took it out earlier. I apologize.
Which all lead me to thinking I had it in the other bot and that it ran it without it
why wont this catch statement work doe http://cdn.yxri.dev/u/201326030221.png
well currently the Discord.js API is F*cked
isnt it always
It's back to normal again, the images send through
what do you mean by "won't work"
because the .catch doesn't catch that particular error
discords image embed server is having fun today
Well, there's the issue
br .catch() catches promise rejections
not a normal error
use ?.
actually
do checks
?. won't error
i only get the error when the bots offline so is there a way to like check if the bots online or not
because its a webserver sending requests to the bot
make sure client.user isn't null
i'm used to it
I get an error because you can't write more than 1024 characters on a single line. Is this glitche special?
understandable. have a day.
agreed
Embed descriptions are limited to 2048 characters. There can be up to 25 fields. A field's name is limited to 256 characters and its value to 1024 characters. The footer text is limited to 2048 characters. - discordjs.guide
and everything together cannot exceed 6000 characters
Hi
tim you have a module you own???
lol i was like huh is this the same tim and then i just came here cuz i knew you would be here lol
lmao
thank <3
ye
discord.js-light (or timotejroiko/discord.js-light if you want the master version)
hey guys
https://hatebin.com could anyone please tell me why my code doesn't work properly? I mean, the console.log() does give the good id tho
but after that it doesn't do anything else.
we would except that we can't see it with that link ๐
try saving the page first (CTRL+S)
hastebin.com is notorious for this
Use paste.mod.gg
.com hardly works and hasteb.in is down iirc
they've shut down, they redirect to https://paste.gg/ now
A sensible, modern pastebin. Share text and source code snippets with no hassle.
which is unfortunate.
so many bins
no you can't even recycle them

imagine if the fbi/cia/nsa make recycle.bin
a website that stores everything you ever deleted from your pc
sounds about right
hatebin
maybe a couple more actually
hatebin is designed to hate you
there we go sorry,
i can't save anything with hastebin
if its not working, why is it amazing
shush
tbh i just upload the text to discord and let it do the message.txt
this is btw how the json looks like
for some reason it logs every info around, but it just does not perform the rest of the code.
frick, tim, take this one, i gotta head to the market
see my other message
shits bout to close in 15 minutes
im trying to make it where i can do db.guild(guildId).member(memberId) but idk how to things
can someone help pls
maybe it is my indentation that is fucked up?
anyways, thanks in advance if someone can explain the problem. Ping me when someone answered please!
class dbfile {
constructor(...) {...}
guild(id) {
return new Guild(id)
}
}
class Guild {
constructor(id) { somehow get guild }
member(id) {
return somehow get member
}
}
new dbfile().guild(id).member(id)
indentation means nothing in js, (its just for readablility) so thats not the issue
dafuq
tysm tysm tysm
indentation for functionality is really only a thing in python
in js you can even do it all in 1 line if you use ;
^^^
which is why many devs dont like python
owh
pissthong
but what would the problem be then?
python good
uhhm so all jokes aside, can someone please help me out and have a look at the hatebin?
fs isn't optimized for stuff like several writes at the same time
are you storing json files?
im not good enough to help, however if you slide into my dms i can try
what if you use separate files and a queue?
the superior database
LOl
okay sure
i mean you can
but it would take some extra effort
aight
json files. rn i use one long one (bad ik, it yeets itself a lot) but im rewriting to use directories and lots of tiny little json files
well thats less bad
the worst thing about json is its inability to be partially edited, so every single operation needs to process the entire file
if the file is small its not that much of an issue
i had a 15mb json file
oh no
lmao
but im thinking lots of byte size json files
just make sure your vps has a decent disk
because you're gonna be trashing it quite a lot
imagin using a vps
google/amazon have horrible disks
alright
another tip
dont overwite files directly
write a temp file, then rename
Hello
How do I get the voting information?
Library Python
why, whats wrong with that
tools -> python
a crash during writing will lead to lost data
oh so thats why my db kept yeeting itself

yup
tbh i had a bug with my code so it crashed every 3 minutes so...
xD

it might work with a backup system or something
but i mean
at this point i guess a proper database would be easier kek
writing then renaming will ensure the data will be intact, as the rename operation is atomic and done by the operating system
and if it crashes during writing, the original file wont be affected
h
my thought was if i make it lots of small files
and a queue
it can only yeet one member in one guild at once
so miniscule loss
well thats also true
how to get webhook_auth='password'?
I did this because I exceeded the character limit, but this time it says undefined. How do I fix it?
go to your top.gg bot edit page
in the webhook section
you write your own auth password there
yes
ok
ok
you're missing field titles
Here, what do I put?
http://prntscr.com/y6ngkk
I don't want it to be a title
setting them to null results in the undefined, try just using the title again @urban surge
you cant not have a title
you need to have a title. if you dont want a title, you can use a zero width space
.addField("\u200B", content here)
๐ค
where is your bot hosted?
vps
idk i havent used top.gg shet yet
put the vps's ip address and port
Which port is in the code?
for example if in your code you have webhook_port=3000 and webhook_path="/dblwebhook"
i did but it didn't
then your url is http://YOURVPSIP:3000/dblwebhook
ok (:
name: "\u200B"
name: null smh
thanks it worked
well today i learned that a bad purge command is a really bad idea
some guy decided it was a great idea to delete 9999 messages and my bot's cpu usage just skyrocketed to 100%
You reek of O(n^2)
I want to take the ID of who voted, but this shows an error
http://prntscr.com/y6po2s
how to fix?
wut
how
you mean discord bulk delete right?
yea
that shouldnt affect your cpu at all
that makes no sense, its api requests, your cpu has no business doing anything, its just waiting 90% of the time
i mean tbh i don't know how many messages the guy deleted exactly
but the last thing on console was a "Command 'clear' executed [...]" message
you're not blocking anything are you? lmao
nope 
then how, it makes no sense
no idea
my bot divides the message deletion into groups of 100
so it sends a request for every 100 messages
maybe a really big number could have caused too many requests?
for(let i = 0; i < 99; i++) {
await channel.bulkDelete(100);
}
``` if you do something like this
its gonna be idle 99% of the time
0% cpu usage
okey :/
await channel.bulkDelete(rest);
for (let i = 0; i < extra; i++) {
await channel.bulkDelete(100);
}
yeah this should have worked
now i got no idea how my bot crashed
weird
Is anyone able to help me make a dashboard for my bot
a dahbore
do you have a specific question or?
No
Store a logfile for each level
Sometimes it's handy to have a trace log
Or debug if you want less verbosed file
yeah that's probably a good idea
I would start by reading the discord oauth docs then, or if you dont understand web development doing some research on that.
its very hard that anyone will handhold you throughout the whole way, you need either a more specific question or ask something like what i should use
as far as finding someone to help co-work with you, this isnt the place. If you need guides or ask a question, then just ask for it
Would you like to be a developer for me
this is not the place to ask for that, you'll need to hire a dev for you
Do you know any good servers
ido not, i think the coder's den had an advertising thing somewhere
either that or discord bots, though that was talked about long time ago in Discord-Api
Ok
I want to take the ID of who voted, but this shows an error
http://prntscr.com/y6po2s
how to fix?
who pinged me?
me ๐ฅฒ
you can help me?
im not too keen on python, only in js/ts
ok ๐ฅฒ
why does running lavalink just not do anything?
Could you show your code?
print date {'bot': '751151926959276050', 'user': '608094296595496970', 'type': 'test', 'query': '?test=data¬RandomNumber=8', 'isWeekend': False}
Holdon.
ok
yes
yes
so it should be ["user"] or ["bot"]["user"]
data["user"]
im try
hi try, I'm sora
Yes, it worked
pog
sup
^^
yea
But I can't seem to figure out how to find more then one schema at a time
Is that not possible?
wdym
find()
find({user_id: ''}, { sort: { valueInObject: -1 } })
valueInObject?
I cant remember exactly
do some testing
it should basically sort -1 / 1
to asc / desc
ok
-1 = ascending
1 = descending
by the looks of it
@blissful coral https://img.pyrocdn.com/t6k36xiK
also
looking at the mongodb docs is kinda meh
I also just realised
the example I gave
was meh
since it was using the custom func xig build for dblstats

sorry
"I made this on paint because i cant find nothing compared" im trying to make when i put the command "?off" that he will show in an embed that is offline but when i put "?on" this will make that on again, how can i do this, pls help me!
Off and on for what
Is an example
Im trying to make the bot show a thing when i put the command
I dont know how to explain very well
//command function
//End of command
message.channel.send('command done')```?
Can't help if you can't explain it
For example i put the command "?closed" or "?open" and when i put that command he will send that for the embed, and when i put the command "?showembed" he shows the embed, and the embed shows if its close or open. I think its this
Its an intuitive embed, i think
Yes, but i want that command make the embed say if its close or open, well if i think better i can use only one command!
Then you need a db
Im gonna use it on a fiveM discord server, and if the guy say ?close, then in the embed he gonna show that the applications are closed
//Close command
class close extends Command {
execute: (client, message, args) {
const db = require(``) //Require your db or if assigned to client use that instead
db.query //Or whatever you use [mysql, mongoose, etc.]
//save
message.channel.send(`Closed`)
}
)```
Example of close command
bad example but
Then just make a query to the db to check if it is open or closed
I have to do the bot verification and for the intents, do I need to specify like GUILDS or more specifically GUILDS -> GUILD_CREATE etc?
ahhhh now it makes sense
so you want two commands basically: an "apply" command to register yourself in something and an application manager command, which opens or closes applications right?
if it's closed then show an "applications are closed" error to whoever uses the apply command
so yeah, definitely go for databases
Actually, what are Privileged Gateway Intents? I don't currently have them enabled, but I don't really even know what the option is
Yo guys help me please
So i want to make a bot that can talk to you like what ever you say he respones to you.
something like this
https://i.gyazo.com/ca4388783a4b602df6fe583997c5d8bb.mp4
What are some good vps to use? Iโm finally gonna upgrade to one
galaxy gate or digital ocean
Also how do I know how much ram Iโll need?
just use free tier amazon aws
Why do you suggest that one? Just curious
Because its free, and amazing
So i want to make a bot that can talk to you like what ever you say he respones to you.
something like this
https://i.gyazo.com/ca4388783a4b602df6fe583997c5d8bb.mp4
the privileged intents are members and presences
guys can someone help please
Literally its perfection
But why is it amazing?
because it is powerful enough to run a bot, stable, effective and free
if u dont know how to do this urself no one is gonna help you, this is complicated stuff
pls help me ur a bot dev u should know this stuff pls ๐ฆ
I need help with something, my bigger reload command (for reloading my command folders) is still fucked. Its not loading commands and its not unloading commands.
Ok so what option do I choose when I look at the free tiers? There is a lot
whatever u want sam
Ain't nobody gonna spoon feed you. Go read the docs.
But some are database some are compute some are mobile. What one do I use?
....
If I've been using my bot up to this point without them enabled, I don't need to apply for them now, right? I don't think I really understand when they're actually triggered or what they may contain. The only thing I've seen is like guild member caching, but I sometimes use that to get the GuildMember from a User. I'm so confused
ur not going to run a discord bot off of a database hoster are you
i did not ask for the SPoon feed i just need help there is nothing bed with this Question.
Iโm asking because I donโt know the difference between the other options. Thatโs the point
... sigh
do you have a specific question?
or are you just asking for general help
So i want to make a bot that can talk to you like what ever you say he respones to you.
something like this
https://i.gyazo.com/ca4388783a4b602df6fe583997c5d8bb.mp4
Security guard i suggest going to learn how to make a simple bot before you start going for advanced ones like this...
that
you should ask something specific
that's not a specific question
that's the entire bot
^
Ok what ever guys LOOk
Do you want it to respond to sentences that are predefined? Or respond like us humans do?
Thats extremely advanced stuff, and stuff you would really do on your own. Why do you think I said to go read the docs?
without the guild members intent, you cannot:
receive guildMemberAdd
receive guildMemberUpdate
receive guildMemberRemove
fetchAllMembers
fetch more than 100 members at once
without the guild presences intent you cannot:
see online members
see people's statuses and activities
receive presenceUpdate
fetch members with presences
they're like special permissions for your bot
@quartz kindle I do still need help, its not doing what I thought it was doing.
Okay. That helps. I don't think I'm using any of that. Thanks for clarifying
Filling out the intents form was so aids
That part I do understand, but just not sure what extra stuff they gave
@severe pike so what option do you use?
windows server because cba to learn linux
F
but if you know linux use that
even if you dont know linux, you should use it
eh its a headache
Out of these options though? Iโm really confused tbh. Digital ocean looks a lot more simple
compute is what you're probably looking for
wait is that form something important
Thatโs all Iโve been asking lmao but thanks
@earnest phoenix not sure what you are asking? You want a one use command?
by what definition?
once per user? once per server? once per channel?
once per hour? once per year?
once per covid positive case?
this man asking the real Qs
then you need a database
or if you are a real pleb you can use a text file
sometimes they need help to figure out the right questions to ask xd
๐
the heck is that
Yes
#memes-and-media for memes and media
bruh
what kind of database do you have?
gacha cringe in dev
??
so when a user uses the command
yes
so the next time they use it
check if it exists in the db
yes
if(check2) {
what you want to happen if its true;
}
if(check2) return message.channel.send("you cannot use this anymore")
you should do your set after the check if they have ran it before
you fix this?
Oh ye
That's from ages ago
Wait
I think I didn't
@restive willow u know how?
naw
question still up
Well
