#development
1 messages · Page 1386 of 1
Yes
You can use .sort on the Cursor, as far as I remember
which will then give you an iterable with sorted values
my mongodb is getting ~ 1-2 connections per second lmao
or if i do collection.find().sort() i get dictionary?
connections?
.sort is a methid
method, a function
you need to pass proper sorting options to it
p.s. see pymongo cursor sort
let me try
cord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: sort() missing 1 required positional argument: 'key_or_list'
on uns = collection.find().sort()
@slender thistle
you people ever just go to google and search up your errors
or like
read documentations
so i dont annoy people?
yes i am sorry i just discovered you can annoy people on discord with your errors
i am new
Well, it's more of a strong suggestion
Please help me. I have an error.
command:
if(command === 'new'){
let ruser = message.reactions.cache.get('🎰').users;
if(!message.author.id == 500933509859246100)return;
message.delete({timeout: 0});
message.channel.send(allarg).then(function(message){
message.react('🎰').then(ruser.add(role))
})
}```
error: https://cdn.discordapp.com/attachments/272764566411149314/777287397355683850/unknown.png
can i be mongo ratelimited?

oh i get it now
And yeah, see Evie's link. Help yourself be an independent developer and get used to doing research on your own
and it errored
@drifting wedge what did it say
it works but... why is the latency so high?
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
@earnest phoenix what this is saying is that the get() returns undefined - which means, no one has reacted to the message using that emoji.
latency != ping
name: "ping",
description: "Pinging the bot",
execute(message, args) {
var latency = -1 * (Date.now() - message.createdTimestamp)
message.channel.send('Bot latency is ' + latency + ' ms');
}
};
thats my ode
Interesting
like its not ur bot speed
then...?
can it be wrong mongourl?
how to ping then?
imporper?
@earnest phoenix what this is saying is that the get() returns undefined - which means, no one has reacted to the message using that emoji.
@umbral zealot so i need to use find()?
but that might not be the case if you claim that it happens when you spam requests at Atlas
No you need to actually code it so it doesn't crash if the . get() returns undefined.
well i did spam it lol
And I somewhat doubt Atlas will throw BadAuth for ratelimits
if you used .find() you'd still get undefined if no one reacted.
user_info = {"_id": guild.id, "isinguild": "true"}
collection6.insert_one(user_info)```
@drifting wedge then how do i make a ping?
Unless your auth key got reset by itself lmfao
prob why it happenined
insert_many ftw tbh
oh lmao
which technically doesn't make any difference for shit functionality-wise afaik
but...
raise TypeError("%s must be an instance of dict, bson.son.SON, "
TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping
No you need to actually code it so it doesn't crash if the . get() returns undefined.
@umbral zealot So what i need to do? i don't know that
Do you not know how to create conditions?
why?
Is there anybody else that uses MySQL that could help me with something?
@client.event
async def on_ready():
print('Bot is loaded/ready.')
mongo_url6 = "url"
cluster6 = MongoClient("no leakies pls")
db6 = cluster6["isinserver"]
collection6 = db6["main"]
for guild in client.guilds:
user_info = {"_id": str(guild.id), "isinguild": "true"}
collection6.insert_many(user_info)```
this is the bot code
basically
I'll specifically murder you for a TypeError in pymongo and write a note that said "Incompatible type (Human) with class World"
Do you not know how to create conditions?
nope
@earnest phoenix Useful links for learning JavaScript and Node:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/
so what can i do?
do i go thru each id by itself?
and add it?
its like 450 ids so i prefer to do it auto
insert_many([{"_id": str(guild.id), "isinguild": True} for guild in client.guilds])
ty papi
Honestly I don't think this is even worth a try at this point
but you never know
:^)
Bruh
(Just apply a change every 0.5-1 seconds)
how i can merge 2 dictionaries
like this:
{'a': 1, '_id': ObjectId('54ff30faadd8f30feb90268f'), 'b': 2}
{'a': 1, 'c': 3, '_id': ObjectId('54ff32a2add8f30feb902690'), 'b': 2}
@earnest phoenix Useful links for learning JavaScript and Node:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/
@umbral zealot You can't tell me what i need to do :c?
Ehh but get back to insert_one if you do that
No. I don't code for other people. We don't spoonfeed here.
Hello
tf
Ehh but get back to insert_one if you do that
@slender thistle i mean can i just do many?
I don't want the code
Fuck it
itll be like 4 mins
Try it
whatever
ill do insert 1 waiting for .5 secs
😂 good luck man
ill let u know
how i can merge 2 dictionaries
like this:
{'a': 1, '_id': ObjectId('54ff30faadd8f30feb90268f'), 'b': 2}
{'a': 1, 'c': 3, '_id': ObjectId('54ff32a2add8f30feb902690'), 'b': 2}
raise TypeError("%s must be an instance of dict, bson.son.SON, "
TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping```
Of course you want the code. You need to make a condition on the thing being undefined. IF you don't understand what "make a condition on the thing being undefined" means, there is literally no other choice than either give you the answer, or tell you to learn javascript so you can fix it yourself.
okay fine
for guild in client.guilds:
asyncio.sleep(0.5)
collection6.insert_one([{"_id": str(guild.id), "isinguild": True} for guild in client.guilds])```
What the faq
-faq 1
oh yeah
you simply
silly
pass a dictionary, not a list comprehension
Ignore list comprehensions for your case
for guild in client.guilds
guild1 = dict1 = [guild.id]
wat did i just type
lmao
I didn't get what you wanted to-yeah
for every guild
just insert_one(yourdicthere)
i want to set it in the db
that it is in the guild
thats what i want
cuz for dashboard
dictpp = {}
in {} guild.id?

wadda fuck!
Can y'all stop being dicts 😂
how do i make the guild ids a dict then:
what even are you trying to achieve
Evie plz I'll I'll legitimately del you to the point you will cause a ReferenceError
how do i make the guild ids a dict then:
@drifting wedge see your previous code snippet
@earnest phoenix i want to put all the guilds the bot is in in a db
like the very first one you sent
alr cool ty
raise OperationFailure(msg % errmsg, code, response,
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
still
heyo i'm in the dev of a hangman but i still lack a little experience in js, so i have two variables.
A variable that has the word (item)
and another which has the text that the player sees example: ___ e__
now I don't know how I can replace the text with the letter in what the player sees.
if(item.indexOf(message.content)){
let a = item.indexOf(message.content)
}else{
}```
use replace
@digital ibex can we replace with a number?
yes
How ? js itemview.replace("??", message.content)
show more of ur code so i can have an idea of what ur workin with
the part where the user sends a letter
awaitMessage(msg.channel, m => m.author.id === message.author.id, 60000).then(message => {
message.delete()
if(lettre.indexOf(message.content)){
game()
return message.channel.send("Vous avez déjà mis cette lettre.").then((msg) => msg.delete({timeout: 5000}))
}
lettre.push(message.content)
if(item.indexOf(message.content)){
let a = item.indexOf(message.content)
}else{
if(lettreerror == 10){
}else{
lettreerror++
}
}
})```
Did someone ping me here?
i did
brain, there was a scam link
marco took care of it
@slender thistle py user_info = {"_id": "no no no noob", "isinguild": "true"} collection6.insert_many(user_info) this is the code
gave error
raise TypeError("%s must be an instance of dict, bson.son.SON, "
TypeError: document must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMapping```
_one not _many
oh lmao lemme try
raise OperationFailure(msg % errmsg, code, response,
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
user_info = {"_id": "772089684465418240", "isinguild": "true"}
collection6.insert_one(user_info)```
i need help
@digital ibex ?
what does this mean
TypeError: 'set' object is not a mapping
theres nothing about it on google
Reeee
nvm it works
Who has experience with Discord-XP? And Canvas...
I have the rank card sorted but need to get the rank using that below what would the getYourRank(); be?
const rank = getYourRank();
But I’ve tried Levels, Level and Rank but didn’t want to work.
But at the bottom it says Problems should say what the error is on there
ok lemme send it
Try adding the else somewhere else maybe under that one?
Try adding the else somewhere else maybe under that one?
@ornate tree i tried
didnt work
rip
ty u too
Hello how do i join voice?
hey so im making a embed command and it works fine with no errors except i was wondering how to split the args basically let Title = args.slice(0).join(" ") this is the code i have for the title part but i was wondering how to split it from args[1] so this doesnt happen
anyone know any solutions?
@lilac glen to join a voice channel just click on its name
Ok thanks
like command?
check if the channel is nsfw
you will 1. need a module that supplies the nsfw images and 2. code it to check for if the channel is a nsfw channel or not
so
how tf can i make an command thats check for if the channel is a nsfw channel or not
can someone confirm me real fast thats 30min interval?
just look up a Second to Minute calculator
millisecond*
ah
yea i assumed they are ms and checked it says 30mins
code? @earnest phoenix
looks like multiple instances
You're adding a listener for every time run is invoked.
like what?
on every message, you are setting up the message listener once more, so it will run as many times as the command already ran
oh, wait
no
weird
how many times do you call .run()?
Hi, im making a mute rol command, but i got error in console, the line of the error is:
role.setPermissions(
role.permissions - (1 << 21)
)```
And the error is:
```js
(node:12436) UnhandledPromiseRejectionWarning: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.```
You can use HTML & CSS in the long description.
i need help...
i cannot code in CSS nor HTML
umm, then learn how to code in CSS or HTML
they're both easy
....
i dont know code eitherthas why i have my friend help me ;-;'
you don't know how to code?
im dumb
If you do not know how to use css or html, then you are unfortunately not able to do this yet
i suggest looking up a few tutorials on how to do this
We don't spoonfeed here, that's why
we can only link you to resources that might help you
Does anyone know the code to add verification for a bot on discord.js?
Yes
you seem to be a bit confused about bot verification, i highly suggest reading this support article by discord https://support.discord.com/hc/en-us/articles/360040720412-Bot-Verification-and-Data-Whitelisting
i cannot learn code
Like when you join the server and react with a checkmark to verify
ohh
and get a role
me too
i cannot think straight
@earnest phoenix i do so too, but i managed to get past it through concentration and focus
So do you happen to know the code for that for discord.js
and maybe a bit of meditation
Not code, but i can tell you roughly how you can do that
Its alright
well i have a very bad adhd to the point i cannot think. at the momemnet
i take medication to help adhd but it lats for a few hours
@grave vortex you could store your message id inside a variable and then check on react if that message has the id you stored, then get the reaction and do your code
Depends what coding program your using
who as a css code for top.gg ?
for color
i am trying to change color on my bot page
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionAdd and
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionRemove might come in handy for you
but i am too dumb
you can use <style> inside your long description to change stuff on your bot page
i know
i just want my whole page a color and my buttons customized
i have floating icon code
but i want button color code
howwww
your long description, the field where you enter your bot description
you can use html inside that, lemme make you a quick example
@earnest phoenix using this inside your long description changes for example your whole bot page to green:
#bot-details-page {
padding-top: 120px;
background: green;
}
is that your bot?
yeah
you did it then, or what else do you want to change?
buttons
me i want chnage color button
(Invite ,Vote)
i wanna change all buttons so they look cool
lol

Changing the buttons is easy aswell, their css name is .btn-orange
an example would be this
.btn-orange {
background: green;
}
this would change your buttons to green
you can put that inside your already there style
lol wat
thank you
;-;
put it below your background change
one sec
also, you dont need 2 <style></style>, one is good enough
<html> <style> <body>
i am so dumb i am laughing
same true
which body? up or down
for floating image :
<style>
.bot-img{
animation: float 2s ease-in-out infinite;
}
@keyframes float {
0% {
box-shadow: 0 10px 25px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
} 50% {
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
transform: translatey(-20px);
} 100% {
box-shadow: 0 25px 55px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
}
</style>```
dont have that
@earnest phoenix
so i delete that style
or keep
C:\Users\poronga\3D Objects\Otisbotfinal\commands\skip.js:12
serverQueue.connection.dispatcher.end("La cancion fue skipeada");
^
TypeError: Cannot read property 'end' of null
😐
thank you so much @rustic nova

you already have one that says bot info, you can remove that
i'll be with you in a few minutes
oki
<style>
.votebutton {
background-color: white;
color: white;
}
</style>```
and how i can make a walpaper on background ?
background-image:
and image link ?
alright @earnest phoenix, you don't need multiple style tags with the same thing
oh, good job 
i keep getting meet women in your area when i am gay ...
yeah that's just ads
imma change my packground to plack
black*
who knows how to reduce the outline of an image (no relation to the development)
how do i make the buttons have a shadow of that color that i have
#example1 {
box-shadow: 5px 10px;
}
#example2 {
box-shadow: 5px 10px #888888;
}```
width="" height="" @earnest phoenix
bootstrap is something with js, right?
no
you should then
its a css library
why put example
yeah you should be able to then
XD
#example is the id
change it to a class if u want
and add the class to ur button
like this
.example1 {
box-shadow: 5px 10px;
}
...
<button class="example1">Click me</button>
but the .example1{} must go in ur css
not html
also WHY CANT I preview
u could add inline styling
yea now change the styles
how
i mean isnt the shadown too intense
u can change the numbers
and im pre sure u can change the color bu just adding it after the 10px
anywayssssssss.
preview...
is it working for u?
yesh thanks
How can I get him to edit the time out embed?
i trying this
but it did not work
some one left a 3 star review bc the audio shutters and it only shutters when RTC is down
yo im so confused
Me too
ive been trying to figure out preview for like half an hour
why cant i preview myHTML
.votebutton {
box-shadow: 2px 2px;
}
</style>
<style>
.votebutton {
background-color: white;
color: white;
}
</style>
<style>
.bot-img{
animation: float 2s ease-in-out infinite;
}
@keyframes float {
0% {
box-shadow: 0 10px 25px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
} 50% {
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
transform: translatey(-20px);
} 100% {
box-shadow: 0 25px 55px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
}
</style>
<style>
.btn-orange {
background: #8A6DB0;
}
</style>
<style> #bot-details-page {
padding-top: 120px;
background: #2A292B;
}
<style>
="background-color:#8A6DB0;"
</style>```
thats all i have
pls
webpack experts
how tf do i reduce the bundle size properly
there's not even that much code and only 5 packages
actually
i think it's an icon library
aaaaaand i was right
I don't understand anymore my bot has 38 votes and only 56 servers and it's been a week that he is so......... How can i grow him up
member.guild.id isnt a function?
take a guess
yes
not member
i'm aware
i dont have it
if (!servers[member.guild.id] || !servers[member.guild.id].logs) return;
how do i change color of text on my bots page now
is code where error is
I don't understand anymore my bot has 38 votes and only 56 servers and it's been a week that he is so......... How can i grow him up
@spark oracle not development related, but a bot needs time and effort to grow. Implement features that might sound interesting to potential bot users, invent something new that nobody has seen before.
that should work @zenith knoll
it says
id: 4)
(node:12) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
at Client.<anonymous> (/home/container/index.js:226:31)
at Client.emit (events.js:314:20)
at Object.module.exports [as GUILD_BAN_ADD] (/home/container/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_ADD.js:15:29)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:797:20)
at Receiver.emit (events.js:314:20)
(node:12) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)```
djs v12
i
i just send
if (!servers[member.guild.id] || !servers[member.guild.id].logs) return;
how do i change text color on my page\
it's saying that whatever you're trying to call id on is undefined, aka the guild is undefined
Full code if possible
kk
....
free code lmfao hereclient.on("guildBanAdd", async (member) => { if (member.id == client.user.id) return; if (!servers[member.guild.id] || !servers[member.guild.id].logs) return; const channel = member.guild.channels.cache.get(servers[member.guild.id].logs); const audit = await member.guild.fetchAuditLogs({ limit: 1, type: 'MEMBER_BAN' }) const banLog = audit.entries.first(); if (!banLog) { const e = new Discord.MessageEmbed() .setColor('RED') .setTitle(`Member Banned`) .setDescription(`👮 ${member} was banned from the server, but we couldn't locate who did it.`) .setFooter(`User ID: ${member.id} - OXYGEN Security`, client.user.avatarURL({ dynamic: true, format: 'png', size: 1024 })) return channel.send(e) } const { executor, target } = kickLog; if (target.id === member.id) { const e = new Discord.MessageEmbed() .setColor('RED') .setTitle(`Member Banned`) .setDescription(`👮 ${target} was banned from the server by ${executor}`) .setFooter(`User ID: ${member.id} - OXYGEN Security`, client.user.avatarURL({ dynamic: true, format: 'png', size: 1024 })) channel.send(e) } else { const e = new Discord.MessageEmbed() .setColor('RED') .setTitle(`Member Banned`) .setDescription(`👮 ${member} was banned from the server, but we couldn't locate who did it.`) .setFooter(`User ID: ${member.id} - OXYGEN Security`, client.user.avatarURL({ dynamic: true, format: 'png', size: 1024 })) return channel.send(e) } })
is this dev related
help please
i dont have adblock
dbl doesn't have control over ads they show you, they use google ads
help please
@zenith knoll i wish i could bud but i cant
google ads show you relevant ads to what you've been searching for
you're getting 18+ ads because you searched for titties
use incognito next time
Clear your data
I AM GAY
WTF
you searched for titties
lmao
AND ON SCHOOL LAPTOP
I AM OFFENDED
ive been clearing data.
somebody else on your network's been searching for titties then 🤷
if you looked at my history you would find gay P**n
my dad >.>
he always does
he watches hentai and hes 50
LIKE BRUH
quite possible lol, my mom influenced my ad interests
google ads is so stupid
ikr
that's why i opt-out from personal ads on google 
^turning them off doesn't work
just install ublock origin and use firefox
good combo for blocking ads and trackers
no help for u
Channel for chatting about (bot) development. If you have questions, ask the questions and wait for someone who can answer to help you. Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem. Do not @mention people randomly.
yeah i don't see any problems from my js knowledge
ok then im going to check docs again, idk why it aint working
how do i change my bots page text color
You can turn off Google tracker in your Google account settings
i am so dumb
You can turn off Google tracker in your Google account settings
yup, did that and opted-out of personal ads
the ban event passes in guild obj if u require it
LMFAO

hello? i asked how i change text color
my 6 bots all stopped after intents
What happened with intents?
clearly i am very important
my 6 bots all stopped after intents
@zenith knoll IKR, I HAD TO LIKE FIGHT WITH MY CODE FOR LIKE 10 HOURS
XD
till i went to the javacord support and asked why it wasn't working
then told me "do you use itents?"
lmfao
my bot just didnt respond
i got like dms from 7 ppl saying "uyr fkin dumb bot aint no work"
Some libraries should just inform you if you use a specific event that requires intents
If you are using any event that requires privledge gateway then you will need to turn it on from dev portal

Always refer to discord api official documentation

Nobody will ping you it's your job as a developer to be updated
If you are using any event that requires privledge gateway then you will need to turn it on from dev portal
@vague imp How do you know to do that when you don't trust yourself and your coding skills and your bot doesn't tell you that you didn't enable privileged gateways
If you event is not working it's obvious
how do i chnage textdyp color

I KNOW I AM DUMB BUT CMON
I know myself, i don't trust myself
imma go
@earnest phoenix
p {
font-weight: 400;
}
``` add color inside it
Inspect element can help too
So people had enough time
@vague imp Yeah my Library discord announced that too, but i don't really notice it due to having disabled message sounds and them not pinging everyone
Hey i tried to make a mute command but it throws an error when i try to put a tempmute
(node:10312) UnhandledPromiseRejectionWarning: ReferenceError: ms is not defined
ReferenceErrors are primitive: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined
anyone know how to remove the chrome default button border on click? https://speedy.is-a-qt.dev/media/1605409619368/z6i882UiuR.gif
fixed it with outline none
on focus*
Yo i can't setup my bot
?
A bit more explanation would be nice
Are you using python?
no
js?
yes
I’m not gonna lie and pretend I know how to work with js, but gl ig
okk
Someone will prob come and help you soon
thanks
:)
fixed it with outline none
@split hazel Thanks you helped me to LOL
why I always leave my solutions 
@delicate shore this looks like the root of your error
Since it doesn't look like the command could be found, you could try installing it.
:0
Now I get an error could not locate binding
could you screenshot what it looks like
try npm rebuild
I did that 6 times
if that doesn't work, run npm i -g node-gyp and try again
I did that also
These all were on stack over flow
I did all of these
But nothing worked
Ok, well, at htis point, the binding error, try rm -rf ./node_modules and then npm install
I did even that
if that doesn't work, try with yarn
Ok but the problem changed now so do it again
it used to be another problem, this problem might be resolved by retracing other steps
Problem previous one solved because I was using other version of node
But in package file it was 12x
So I down graded
Can you try deleting node_modules and running npm install, right now?
Yes I am doing it will take time
yes, I'm aware
like I said, yarn sometimes can work better.
it's also usually faster.
So one thing
Should I do npm install
Or should I install yarn
Then do yarn install
hello
feels good to finally have the bot developer role
yayayay
lol
my bot got rejected 6 times now cuz it was offline all the time
i-
lol
I mean all you had to do was make sure the bot stayed online. not that hard.
better open an issue here then https://github.com/JoshuaWise/better-sqlite3/issues
or look through the existing one. see if one fits.
He says it's not issue with package
And only says that remove modules folder
And install again
¯_(ツ)_/¯
I mean all you had to do was make sure the bot stayed online. not that hard.
@umbral zealot thing is it didnt have 24/7 hosting cuz i didnt know how to do it at the time and the bot was always checked at times like 3 am for me
so not that hard
isnt true
by a bit
lol
I've had test bots on one testing server stay up 24/7 on free hosting services so I dunno what you're talking about 😂
It's easy, if you know what you're doing. You didn't, that's lack of knowledge, not difficulty of the task.
how to get dbl api
Anybody use MySQL that could help me?
I am having an issue figuring out how to implement my database with a new set of files and coding style, and I need help cause I have no idea how and I’ve tried googling and asking on stack overflow and stack overflow removed my post.
Sorry... just a bit of pride here.
Getting it functioning really, I used an open source bot as my tutorial so that way I can get my bot a lot more advanced and so I can learn a new coding style, I used the AtlantaBot for this. They used a mongoose DB and not MySQL, I’ve tried asking around in the support server and I haven’t received any sort of help.
I also think I may have found the answer to my problems so give me a second
Cause it’s what I learned.
TL;DR: MySQL is a bad database. Don't use it unless you have literally no other option.
Why shouldn't I use MySQL?
- MySQL has no transactional DDL. This means that if you fuck up creating a table in the middle of a migration, you cannot rollback easily.
- MySQL has a lot of security issues. New zero-day vulnerabilities are found regularly.
- MySQL is owned by Oracle.
- MySQL is slow. It beats Postgres etc at some things, but once you move beyond basic queries it begins to slog.
- MySQL disconnects you randomly. Unless you setup your connection specially, it will break regularly.
- MySQL allows all kinds of insane data to be inserted. '0000-00-00' is valid in MySQL.
- MySQL is not ANSI compliant. You have to turn it on; even then it isn't fully compliant.
- MySQL has no feature advantage over other databases; PostgreSQL has many more useful features (such as RETURNs).
There is no reason to use MySQL over PostgreSQL, or even sqlite3. See also:
https://blog.ionelmc.ro/2014/12/28/terrible-choices-mysql/
https://grimoire.ca/mysql/choose-something-else
If you know mysql, PostgreSQL would be a better option
since it's using the same base language (SQL) you won't be lost with it
Okay, is it still more the same stuff with SQL? Just... more secure I guess?
better, faster, stronger.
Okay, is that what you use?
nah, enmap /s
And right when I start doing things I get it to work ffs...
hey so im making a embed command and it works fine with no errors except i was wondering how to split the args basically so let Title = args.slice(0).join(" ") this is the code i have for the title part but i was wondering how to split it from args[1] so this doesnt happen
@main trench split the string per space
May i see a example I'm still learning arg splitting
let greeting = "hello! how are you doing today?"
console.log(greeting.split(" ")) // ["hello!", "how", "are", "you", "doing", "today?"]
Ah I see what ya mean
OK so
const data = await prefix.findOne({
GuildID: msg.guild.id
})
const PREFIX = null
if(data.prefix){
PREFIX = data.prefix
}else{
PREFIX = DPREFIX
}
const prefix = require('./models/prefix');
So just ```let title = args[0]
.setTitle(title.split(" ")```
@trim saddle would this work?
args[0] would be the first word?
const data = await prefix.findOne({
GuildID: msg.guild.id
})
const PREFIX = null
if(data.prefix){
PREFIX = data.prefix
}else{
PREFIX = DPREFIX
}
@delicate shore Ig gives an error
Yeah
Its a embed command
So args[0] is title and args[1] is description
@pale vessel i'll split you for crapping on my answer
But how it is now args[0] is including args[1] which ruins the embed
do it, no balls
how did you split your args
you can use args.shift()js let greeting = "hello! how are you doing today?".split(" "); console.log(greeting.shift()); // "hello!" console.log(greeting.join(" ")); // how are you doing today?
you don't need to use slice
So just ```let title = args[0].split(" ")
.setTitle(title.shift())```
nono
Hmm
args[0] is the first word
Oh true
it should already be an array so you don't need split() either
nah
you need to use args.shift()
and then the description would be args.join(" ")
Aight ill try it and see the outcome
so it takes the first word and use it for title. now that the array doesn't have the first word (since you used shift()), you can join it back
yep
But the reason I did .split was to have multiple words in title
Any way to make this work how im intending it to?
@delicate shore did you use GUILDID as unique key?
just a step to make sure why your prefix is undefined
ahh found your issue
const PREFIX = null //Const makes your Value Static use Let instead
if(data.prefix){
PREFIX = data.prefix //you try to overwrite a static value
}else{
PREFIX = DPREFIX //you try to overwrite a static value
}
Lol
yea i had fixed that
But the issue was
in prerfix .js i had Prefix
but here i had prefix
if that makes sense
yea this also breaks it atleast if you try to reference it somewhere else
btw @lusty quest how to delete it
how to delete the schema
of a guild
can u guide me?
like see in #commands
the one here is probably softlocked bcs there is no prefix
Means?
you could log into your database with MongoDB Compass and set manually a prefix for here
I have not connected a mongo db using url
how did you then want to get the prefix from the database?
await Guild.findOneAndRemove({guildID: guild}) is the correct function.
in your model; options: Array,
then just pass the array into your model or save constructor
hello, can anyone help me?
if you want to define a model and save an object that is also possible users: [{Name:String, 2ndName:String}],
@silk lotus sure
ok wait
@slow canyon is showing offline in my server
this here is the wrong server for this @zinc hawk
visit the Support server from the Bot
im making a member count feature which gets a voice channel and put the total no. of members in the guild, see my code too
module.exports = (client, message) => {
const channelName = message.guild.channels.cache.name.startsWith('Members:')
if(!channelName){
return
} else {
const updateMembers = (guild) => {
const channel = guild.channels.cache.get(channelName)
if(channel){
channel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
}
}
client.on('guildMemberAdd', (member) => updateMembers(member.guild))
client.on('guildMemberRemove', (member) => updateMembers(member.guild))
const guild = client.guilds.cache.get('774930645888794625')
updateMembers(guild)
}
} ```
the error:
```js
TypeError: Cannot read property 'guild' of undefined
yea they wont work as good as they used to bcs you need now also intends
wdym 😅
const updateMembers = (guild) => { where did you define guild
ohh
if you want to define a model and save an object that is also possible
users: [{Name:String, 2ndName:String}],
@lusty quest
I wanna do this like in user id it saves all links asked by user
?
hi
i suggest use MongoDB compass. also idk with the website i have my own server running it without any website
hi
and what is dbname?
?
when I go to connect
mongodb+srv://bot:<password>@cluster0.shgav.mongodb.net/<dbname>?retryWrites=true&w=majority
Here what is dbname
where i can get that
you only need to add this if you want to access only one database. if you want to access the entire database dont set a name
if you use MongoDB atlas you can just copy/paste a connectionstring
the db name is the name of the Database you want to connect to
Yes i do
the db name is the name of the Database you want to connect to
@lusty quest means username?
in database access
username is for authentification
no this is the cluster
i know
if you want to login with Compass dont set a dbname
then you can see every database you have in your MongoDB database
then set a name
it doesnt matter what name it will create one
Ok thanks
You should remake that cluster because the name shouldn't be Cluster0
And I don't think you can rename it
you rename the cluster but it wont really change anything
Yay
my website got approved
for adsense
@lusty quest I did this
if(command === "fixitpls"){
await prefix.findOneAndRemove({guildID: "264445053596991498"})
await prefix.findOneAndRemove({guildID: "690557545965813770"})
msg.channel.send(`done`)
}
and?
well you deleted all configurations and never generated a new one lol
But i have done this
const data = await prefix.findOne({
GuildID: msg.guild.id
})
let PREFIX = null
if(!data){
PREFIX = DPREFIX
}else{
PREFIX = data.prefix
}```
So data is absent
where did you set DPrefix?
in env
DPREFIX = "s!"
let newData = new prefixModel({
prefix: args[1],
GuildID: message.guild.id
})
newData.save()```
should i try this
will not work bcs you cant run a command
let newData = new prefixModel({
prefix: "aa",
GuildID: "264445053596991498"
})
newData.save()```
This
this can work
use async and promise
Presumably the solution is to fix whatever syntax error in your code.
press the problems button down where the therminal is but i guess you have one excessive }
In other news that is just about the most horrible theme I've ever seen on VSCode or any IDE in my entire life.
if else if else if else if else if else
I'd suggest adding the "Bracket Pair Colorizer 2" extension in vscode it makes seeing matching brackets much easier @eternal solstice
because clearly you have one that's not matching
Define embed in global scope add fields and stuff in if else based on need
And send in last
Ideal way
the embeds are fine but the chained else if statements are almost on a Tsundere Dev level
Now, obviously, they've asked this question before at <#development message> and they even had an error but now they decided "let's start over again from the top" 8 hours later, ignoring any progress made to help them
Feels so good watching ads on your own website
they are way to easy to get rid off
And btw @lusty quest thanks
I downloaded compass
and removed from there
it worked then
He might don't know if else and else if
Hey @umbral zealot, any idea why db.query() is not a function?
lol_quick_db.gif
dEfInE it

It is defined lmao.
doesnt seem so
It's just not a function.
@lusty quest i know i do but i'm trying to add a new else
¯_(ツ)_/¯
@eternal solstice please learn basic please
@eternal solstice you have an excessive } if you check the Problems tab it will tell you
@eternal solstice look at what I gave you. Use the bracket pair colorizer and your cursor selections to determine where you're missing a } or { or whatever
Quite literally is defined, no idea why it just... isn't a function
but i suggest use a Switch case instead of the Else if chaining
He is adding else after else
Then
What tha actual heck?
...
@stable nimbus except it's not. db.query isn't a thing in quick.db.
ok
i thought they were asking whether they should pick postgresql or mongodb, why did they choose quick.db 
Lol
done
I don't use quickdb...
@stable nimbus well then maybe you should actually tell us wtf you're using, honey.
so pgsql?
What's db
not everyone is comfortable with a remote database or dont have money for it. sure there are Free Hosts like Firebase or MongoDB Atlas but they usually need a credit card for authentification
I AM STILL USING SQL BECAUSE I'M A LIL BITCH AND DON'T WANNA CHANGE DB'S
which sql
SQL is a language.
Using a good db like mongo or MySQL is better someday u will want to make a dashboard then u have to transfer all stuff
what sql
not a module
MySQL
MySQL is a server. Not a nodejs module.
what module 🗿
Yes
What, specific thing are you using. How do you define db?
mysql? mysql2?
mysql is a module too
mysql
There is a module named mysql
yes. show exactly how you're defining these things.
@vague imp what seems to be the problem
btw why mysql really?
Why could you not send the link?
it's not like we haven't seen this exact code before
Send it here
you should be allowed to post here links from hastebin as example
i thought i had no perms
@eternal solstice learn if else properly
async run(client, message, botdb){
await botdb.query(`SELECT * FROM users WHERE userid = ${message.author.id}`, async (err, results) => {
if(err) throw err;
await message.delete().catch(() => {});
const Embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`${emoji.civ} Your Inventory! ${emoji.civ}`)
.setColor(0xA1EE33)
.setDescription(`Hello <@${message.author.id}>! Here is your inventory!\n ====== \n${results[0].inventory}`)
.setTimestamp(message.createdAt)
.setFooter(config.copyright);
await message.channel.send(`Hey <@${message.author.id}>!`, Embed);
});
};
};
The Command ^^
const botdb = mysql.createConnection({
host: 'localhost',
password: '',
database: 'bot',
user: 'root',
});
botdb.connect(err => {
if(err) throw err;
console.log('Connected to the bot\'s database!');
botdb.query('SHOW TABLES', console.log);
});
botdb.queryPromise = function(sql) {
return new Promise(function(resolve, reject) {
botdb.query(sql, function(err, results, fields) {
if(err) reject(err);
resolve(results, fields);
});
});
};```
How I defined it with a bit of help of the queryPromise.
You can't add else after else
oh god
then how can i add another case
use mysql2/promise
Also for tag it's member.tag
hi
Learn basic please no one will spoonfeed u here
what is this server for ?
read #502193464054644737
await on a callback function. that's cute.





