#development
1 messages · Page 1520 of 1
it just doesnt make any sense
i think discord is broken
i mean test it out for yourself
i have tryed it on my main bot and this bot
It'll always give errors because the bot cannot nickname any member that's equal or above its role, including the owner
?
No one on the guild can set a nickname for the guild owner
at C:\Users\admin\Desktop\Bots\CrashTime\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at C:\Users\admin\Desktop\Bots\CrashTime\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:7892) 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: 6)
So you will always get at least one error, trying to nickname the owner
It probably errors out on the owner and then doesn't nickname anyone else after that
You'll need to catch your errors.
okay so yeah
it got
itself
and me
i think thats right
but how do i stop it from trying to change my nickname
filter the owner's id or catch the error
msg.guild.members.forEach(member => {
member.setNickname(`e-` + member.user.username)
})
};```
simple
okay now tell me how you would catch on that
Read.
no
what
try {
if (msg.content.startsWith('-giveNick')) {
msg.guild.members.forEach(member => {
member.setNickname(`e-` + member.user.username)
})
}
};```
wait
after the if
you want me to
catch and try?
read what evie sent, if u wanna learn how to catch an error
just one
I want you to read how to catch errors in promises.
i will do try
try/catch will not work. Read the page.
I was trying to get you to read the page...
We don't spoonfeed here, so you have to learn how to do this.
i know how to catch
Clearly not if you're trying to do try/catch, which doesn't work on promises, unless you use async/await (which in your case wouldn't be necessary)
facts
unless you await them
I DIDNT TRY TAHT
BRUH MOMENT
ok
you want me to
catch and try?
i was dun founded
cause you asked me a question
I want you to fucking read the page I sent which tells you HOW to catch errors on promises
and i was confused
christ it's not that hard to read
f
The question is: why do you need this role? What do you intend to do with it?
at least try to use it
We still haven't figured out what he means by "skip"
ye idk
i assume he means it doesn't return anything
although he hasn't used it
mhm
smh
What
Ok well you need to check whether the message author has that role then
just saying "here's a role" isn't the same as "does the member have a role?"
if
lol
you code it
learn basic js
bop it
twist it
or read the discord.js docs
pull it
here, this should help https://anidiots.guide/understanding/roles
there's a good guide
i still havent figured out why my bot wont give nicknames
when it literally has the shit
it needs
did you catch the errors
no
is that could enough lol
did you catch the errors
no
Then it's not going to magically start working
okay
Go read https://js.evie.dev/promises#catching-errors instead of fucking around here
well i dont understand
lol
I AHVE
mathAdd(2, 2).then( answer => {
console.log("The answer is: ");
console.log(answer);
});
i read it
you just took the first bit of code on the page and pasted it
you didn't even catch the error
instead of using your brain and reading
lol
Stop being a dumbass and read the english on the page
that was from the website
That was from the website yes
the website that explains how promises work
and how to catch errors
and has examples
ok
exactly and you didn't catch the error from the example lmao
.then(console.log).catch(console.error);
so im gonna use this
it's not just random code you can copy/paste, you need to actually read stuff
at C:\Users\judep\Desktop\Bots\CrashTime\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at C:\Users\judep\Desktop\Bots\CrashTime\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: 'DiscordAPIError',
message: 'Missing Permissions',
path: '/api/v7/guilds/780151796324237333/members/573945508746231811',
code: 50013,
method: 'PATCH'```
well then you didn't catch the error on the right line
right
you need to catch the setNickname
as if
msg.guild.members.forEach(member => {
member.setNickname(`e-` + member.user.username).then(console.log).catch(console.error);
})
};
i hadnt
are you sure you saved your code and restarted? lol
yes g
ill do it again
okay
so it was different
nvm
it was the same
the error was just posted at the top
case 'inventory':
var arrayOfItems = [
{
setOnCmd: `lambo_${message.member.id}`,
itemName: "Lamborghini"
}
]
var stringInventory = "";
arrayOfItems.forEach(item => {
if(db.fetch(item.setOnCmd) != null){
stringInventory += (item.itemName + ": " + db.fetch(item.setOnCmd) + "\n");
}
})
const inv = new Discord.MessageEmbed()
.setColor("BLUE")
.setDescription(stringInventory)
.setFooter("if you dont see anything, you got nothing in your inventory right now")
message.channel.send(inv)
break;
how can i make that it will show how much i got
not true
wdym?
quickdb i guess
yes it is
what is db.fetch() supposed to return
bruh
hello guys
no lol, okay i will fixed it already, if you use a database, please use mongol or something like that, dont use quickdb,
bruh :v
mongo
anyways
still dornt work
i think something definitely wrong
thats what it caught
does that user have higher roles than the bot?
me neither ro
msg.guild.members.forEach(member => {
member.setNickname(`e-${member.user.username}`).then(console.log).catch(console.error);
})
};```
try thjat
see if it gives you the same issue
await for the setNickname
i think
so it will not do the setNickname of all user at the same time
but i need forEach function for member
nah
client.on('message', async msg => {
if (msg.content.startsWith('-giveNick')) {
msg.guild.members.forEach(member => {
await member.setNickname(e-${member.user.username}).then(console.log).catch(console.error);
})
};
await is only valid in async function
dunno tho
Makes sense
what
if u write like that then its
msg.guild.members.forEach(async (member) => {
...
it'll not fix the issue mate
i know
i dont get it
why is discord api retarded
im trying something boys
not that retarded
give me a sec
you can't use that
If you didn't realize, <Array>.forEach() isn't async
forEach is 
really???
It doesn't have respect for promises
i just know that rn lol
Either use a for loop or Promise.all()
okay yeah nah discord is fucked bois
I suspect they didn't add full promise support to Array.prototype.forEach() because it's just for lazy devs
bro
try it
it doesnt work for me
the bot has its roles
its at the top
how would they add support for it lol
its literally a loop that starts functions
client.on('message', async msg => {
if (msg.content.startsWith('-giveNick')) {
msg.guild.members.forEach(member =>{
member.setNickname(`e-${member.user.username}`)
}
)
};
im telling you g this shit aint gonna work
Don't use for each for that
?
bro
it doesnt mmatter
did you do what we told you to do? skip the guild owner?
at C:\Users\j\Desktop\Bots\CrashTime\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at C:\Users\j\Desktop\Bots\CrashTime\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:11428) 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: 2)
(node:11428) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
you didnt tell me how
i did...
welp

you shouldnt have to skip the guild owner
why is it like this
dont is not defined
what is that supose to be
bruh
bro
i really dont get it
wdym
{ dont }
@quartz kindle
@earnest phoenix hi
{dont{
dont rename
safe evaulating
it was example
do u like the layout https://hackmd.io/s/HyWM-K3Cv ??
Discord Web Dashboard ###### A Custom Command Bot with Auth2 connection with Discord and Db(mongod
wha
i know
it was an example
what do i put there
a return?
no
what
lol
bruh
you playing with me
i really just wanna know
so i can understand
Can someone please help us program a discord bot?
what exactly you need help with?
ask your question here and wait for an answer
Hello, someone can tell me how to host on raspberrypi? I used pm2 and forever, and both of these stopped working after approximately 3 hours.
i need help programming it
if you looking for a coding partner, this isnt the place
so, like i add you to the repl and you code in it
go to fiverr or some other place to find people to code for you
this aint the place for that
We can answer specific programming questions here, not work for you.
the raspberry pi isnt being shutdown right?
maybe it restarted adn you dont know about it
in anytime
you should have a monitor on it pinging every 10 seconds to check it
try to see if you catch some downtime
pm2 works and shows that the bot is online but on discord the bot becomes offline after about 3 hours
like i said, check if your rpi isnt restarting due to an energy short or something similar
how to check it
?
you should have a monitor on it pinging every 10 seconds to check it
try to see if you catch some downtime
in what sense a monitor
anything that would be able to monitor if your rpi went offline
um?
write some basic code with fetch or axios. Ping it every 10 seconds, if it doesnt reply, console.log('Offline')
something simple like that would work
mhm
its very rudimentary but should give you a clue
what about it
how to check the console log in rpi?
My computer uses a lot of electricity and it cannot stay on for too long :/
I don't understand a bit how this is supposed to help me
: |
he wants to determine if the rpi is going offline and is the cause.
i explained twice
,
but i said that
are you connecting every 10 seconds?
are you sure between connections it didnt restart?
are you connected all the time?
to see get disconnected?
as if it were rebooting, pm2 would not list running applications
does it?
yes
did you set pm2 to open up on restart?
my concern is it restarting and you not catching it, if pm2 restarts, you wouldnt cacth it, as the process itself would stay
as far as other stuff goes, forever should have a log
both forever and p2m iirc
make sure your log is fine
both would fail after x attempts to restart the give up
I don't know why, but the command for this doesn't work for me, and when I tried to run by entering the command manually into the crontab, my rpi crashed.
what about forever?
same
umm
An rpi support or form might be able to help more, as this seems more like an rpi issue.
someone know how to fix this error, when I turn on rpi? End Kernel panic - not syncing: No working init found
lmao
nuke raspberian and get a fresh install
i forget, which database is this
quick.db
freakin quick.db
pretty sure add and subtract only work if the number is stored as a numer
true..............
no its not
i tried
and it did the same
well if u read, lambosell & lamo1 are numbers
i mean in the actual db they need to be type number
Hello woo
i did, same error
else if (isNaN(oldValue)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched}\nEXPECTED: number`);
https://github.com/lorencerri/quick.db/blob/master/src/methods/add.js#L23
Am new here
welcome? i guess
oop, shouldnt have posted add, the error you seemed to get was on subtract
else if (isNaN(oldValue)) throw new Error('Target is not a number.');
https://github.com/lorencerri/quick.db/blob/master/src/methods/subtract.js
no idea why the same error is completely diffrent between subtract and add, but whatever.
but yeah, seems whatever is stored in lambo_userid isnt a number currently.
thanks
@scenic kelp
@green kestrel spam above
yeet
im always alive
ohh
It's acceptable.
Works for a small bot tbh
But you can't hide any data, meaning, anything you save on there, anyone can see.
(unless you connect to an external DB)
What's the safest F̸̉͘R̵̬͂E̶̔͝E̷̊̇ hosting?
F̸̉͘R̵̬͂E̶̔͝E̷̊̇
There is no good free host.
if you want good and safe service, pay for it
They're all safe-ish
the safest of the dangerous?
hmmmm, I'll check it
const array = ['hello', 'testing array 123']
const description = args.find(arg => arg.name.toLowerCase() == "message").value;
let random = Math.floor(Math.random() * 2);
if(command == 'hate') {
client.api.interactions(interaction.id, interaction.token).callback.post({
data: {
type: 4,
data: {
content: "You're gonna say " + "``" + description + "`" + " to me? Here's my response... \n " + random(array)
}
}
});
}
})```
how come this doesnt worl
work
says random isnt a function
where
it should be array[random]
yea the 10$ Digitalocean droplet wont cut a Discord Bot that uses tensorflow. the Way i use Tensorflow causes me some CPU spikes.
log the array and random to console
if all you need is to randomly select one of two options, just do array[Math.round(Math.random())] lol
then you need to multiply by array length
is Math.random() biased
also this is what prints
[ 'hello', 'testing array 123' ]```
in console
but it doesnt send the randomMess
oh im so dumb
nvm
wut
and yeah use array[Math.floor(Math.random()*array.length)], will save you future pain from having to edit a constant
should be pseudorandom but not biased right?
i use js Array.prototype.random = function() { return this[Math.round(Math.random() * this.length )] }
why Math.round
so i can do array.random() lol
huh
Math.round will give you incorrect results
lets say array length is 2, so Math.random() becomes a value between 0 and 2.
if you get 0.9 it should pick the first item, index 0
with Math.round you will get index 1
oh right
and if you get 1.6 you will get index 2, which is an invalid index in an array of 2 items
ight somebody who's experienced with having a bot i need some help lol
My bot hit trending for a while on top.gg and when i went to complete the verification cause my bot hit 75 servers, it says this https://gyazo.com/3b64334916148c8b9e84962e33e3435a
you grew to fast
im about to rent a Root server bcs its cheaper than a VPS, should i opt in for ECC memory? its only 6€ more/Month but im not entirely sure if i really need it.
i host mine on vultr.com and its $5 a month with more than enough specs
its running linux ubuntu 18
then again, i wrote my bot in python so its very easy to pull from github on my server and run the main.py file
well ive wrote today a bot that uses tensorflow and i get spikes to 70-80% CPU usage while tensorflow is running, and this is only one guild. looked into a higher Performance CPU VPS at Digitalocean this will cost me 40€/Month for 4GB Ram and 2CPU cores, now i look at a Root server with a Ryzen 5 3600 and 64GB ram for 46€/month,with ECC Memory its 52€/Month
i could afford the 52€/Month but saving 6€ is quite a bit over the span of 12 Months
also i get way faster Storage i think, i guess Digitalocean uses Sata SSDs the Root server gets 2 512GB NVME SSDs
Epic
Fetch returns a promise, so you are doing
Promise.send which makes no sense.
You will want to await it
No, I would suggest learning about javascript promises. Spending 30 minutes learning about them will save you a ton of time about them down the line
ok ty
How can I get random user from reaction collection?
Filter it instead of using find and use .random() to it
collection.filter().random()
What is difference between filter and find
filter returns an array with the elements that "pass" the function you passed
filter() returns the collection of elements that passed the function you give and find only returns the first element of that
Thanks
(node:15104) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
hmm
i got This Error
jointocreatechannel(newState);```
this are error lines
what is user?
Full Error
at jointocreatechannel (C:\Users\Home\Desktop\bot\jointocreate.js:87:37)
at Client.<anonymous> (C:\Users\Home\Desktop\bot\jointocreate.js:38:5)
at Client.emit (events.js:315:20)
at VoiceStateUpdate.handle (C:\Users\Home\Desktop\bot\node_modules\discord.js\src\client\actions\VoiceStateUpdate.js:40:14)
at Object.module.exports [as VOICE_STATE_UPDATE] (C:\Users\Home\Desktop\bot\node_modules\discord.js\src\client\websocket\handlers\VOICE_STATE_UPDATE.js:4:35)
at WebSocketManager.handlePacket (C:\Users\Home\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Home\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Home\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\Home\Desktop\bot\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7312) 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: 1)
(node:7312) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
1st Congrats for bot reviewer
2nd
am making Temp Voice Channel
so user.channel is a custom property?
no
also, parent is nullable
https://discord.js.org/#/docs/main/stable/class/VoiceChannel?scrollTo=parent
i found the mistake
the voice channel should be in a Category to Work
i wonder
can i make the bot see the channels id from a json file?
sure, why not.
for ex
Command: /settemp CHANNEL ID
and then write it on a json file
and then use it
enmap is super easy afaik, but never used it.
quick.db is really not good right now
its a database with practically no features built in
why?
most databases have a reasonable set of features, quick.db doesnt have most of them.
and quick.db is no easier than any of the other ones.
what does enmap have that quick.db doesnt?
🤷♂️ never used it, just trying to support evie lol
ah xd
ive never used either, but always though both of them were similar in many aspects
but from what i understood, evie correct me if im wrong, enmap keeps a copy of the dataset in memory, whereas quick.db doesnt
which db u use?
is there any way to get VC channel id with name?
for ex
!id GeneralVC
and it gives the id

yea I believe enmap is just a data structure
???
yes it does
shivs been drinking
hello, I have a cool idea for the bot I would like to share. Where can I do that?
idk man
How?
oh i was talking to shiv
;-;
you want to do like !id #channel and it says the channel id?
what lib are you using?
message.mentions.channels
oh djs
no
not #development for ex
then what
a voice channel
yes but you're gonna mention it?
oh you cant mention voice channels
then look for it by name
that what i couldnt do
guild.channels.cache.find()
^
guild.channels.cache.find(channel => channel.name === channelName)
where channelName can be message.content.replace('!id ', '') or smth
and you can just get the id from the object that's returned
oh does that make sense tho
nope
my bots on at wierd times till i can properly code it thats how lazy i am lul
hey guys
const filter = m => m.content.includes('+') && message.author.id == targetMember.id why is this part not working?
what is wrong
message.guild.channels.cache.get(channelid).messages.fetch(messageid).then(message => message.react(stringmessage));
Most likely here or any other popular programming server
How can I get random user who reacted message with 🎉
what language
i smell giveaway bot
hey
why does tradepokemon log undefined? ```js
let tradepokemon;
collector.on('collect', m => {
tradepokemon = m.content
});
console.log(tradepokemon)```
aha i understand.
so there is no way to define tradepokemon outside the collector?
the code above basically does "whenever a collect happens, do this" and then proceeds normally until the end of the function
because someone in this chat actually told me to use callbacks.
it doesnt wait for the collection to happen
aha yeah i understand, thanks!
but what should i do now, then?
idk what you want to do with that variable
do define it outside the scope.
I need tradepokemon to function outside the collector.
can show you the whole snippet on hastebin if needed.
it cant function outside the collector
unless you create a promise around the collector and await it
ah that sounds 'Promising'.
how would i promise it?
what are you collecting anyway?
but what is it
later on searching for it
a message, a reaction?
is it like a command that asks for a reply from the user, then uses the reply?
it awaits the reply of the users, assigns it to a variable and later on uses it outside the collector
dont use a collector
use awaitMessages
its the same as a collector but in promise form
hmm okay i will try. Thanks
hey @quartz kindle
in the docs i only see collected.size being targeted.
how would i get the exact content?
collected.content?
dont use collectors
i am using awaitmessage
let m = message.channel.send(targetMember + "What pokemon do you want to trade for: " + found.name + "?. Only input your pokemon-name, starting with +. Example: ``+Charizard``.")
const filter3 = m => m.content.startsWith('+');
message.channel.awaitMessages(filter3, { max: 1, time: 15000, errors: ['time'] })
.then(collected => console.log(collected.size))```
yeah i have that page open too
dont use .then
use await
otherwise you wont be able to store the variable you want
okay.
collected is a collection of returned items
if you just have 1 item, just use collected.first()
aha okay
yeah never worked with awaitmessages, so i am kinda bad.
so instead of then i should use await
let m = await message.channel.send(targetMember + "What pokemon do you want to trade for: " + found.name + "?. Only input your pokemon-name, starting with +. Example: ``+Charizard``.")
const filter3 = m => m.content.startsWith('+');
message.channel.awaitMessages(filter3, { max: 1, time: 15000, errors: ['time'] })
(collected => console.log(collected.size))```like this
hmm yeah i see.
ooowh okay
let collected = await message.channel.awaitMessages(filter3, { max: 1, time: 15000, errors: ['time'] })
(collected => console.log(collected.size))```and i can assign a variable to collected.size named tradepokemon
uhhm
TypeError: message.channel.awaitMessages(...) is not a function
@quartz kindle
(collected => console.log(collected.size))
Hey tim what bot did u make?
this one? But how would i ever get the collected size then?
i put my bot on top gg how long does it take
i have 3 bots, my main bot is called Astrobot
it takes about 1 week to be approved
ok\
about 7k
no
once it hits 100
Discord dosent do that anymore
no
once your bot is verified by discord, your bot will get the verified bot badge
you as the developer wont get anything
you can apply for verification with discord once it reaches 75+ guilds
So sad how it was removed
it was removed for good reason
bcs folks just verified bcs the badge
well many people did
It wouldnt have been that exploitable
youve seen it here people getting over 75 guilds in a few days to just 1 week
Hey Tim, i tried fixing the function but it literally returned shit,
people sold servers for your bot to join to get verified.
and then get denied because inorganic growth
let m = message.channel.send(targetMember + "What pokemon do you want to trade for: " + found.name + "?. Only input your pokemon-name, starting with +. Example: ``+Charizard``.")
const filter3 = m => m.content.startsWith('+');
let collected = await message.channel.awaitMessages(filter3, { max: 1, time: 15000, errors: ['time'] })
let tradepokemon = collected
console.log(collected)```
i wanna verify so more people trust my bot
200 may be a stretch
it would have been in the thousands imo
5000 is fine
that means its working, but you have 0 results
people pay hundreds of dollars to buy accounts with the badge, they are valued quite highly
Bruh moment
i literally input +358353
and id
but it did not save apparently?
imagine getting paid to make thousands of servers just so someone could get the badge 
Ah yea I know someone with all badges except staff and he says people come to his dms offering thousands of dollars
📈
i just want the check on my bot so that people trust my bot\
and add it to more servers
you will get the check once you pass discord's verification process
(the check imo dosent really affect anything)
what is the process?
look, i literally had an input.
you will get a dm from discord once your bot gets to 75 servers
the badge maybe probably
yes
but you will need to provide proof of identity
i think they require an id with a photo
i have highschool id
Tim about that proof of identity, what about if you have team members
you can try
Everyone has to provide it?
no idea, but i doubt it
should be only the team leader/owner
Ah alr
yes
yes
@quartz kindle i can't get it to work tbh
let m = message.channel.send(targetMember + "What pokemon do you want to trade for: " + found.name + "?. Only input your pokemon-name, starting with +. Example: ``+Charizard``.")
const filter3 = m => m.content.startsWith('+');
let collected = await message.channel.awaitMessages(filter3, { max: 1, time: 15000, errors: ['time'] })
let tradepokemon = collected
console.log(collected)```
i literally input +3953953
but as soon as the m message gets sent, it collects it.
but i still need the time to get the input ready.
can we maybe fix that using await in the let m'=
how to clear what is in a file with fs?
i g2 take a phone call
you don't import typescript, you transpile typescript to javascript and then include the transpiled javascript in your HTML file via a <script> tag
K thanks
hey @quartz kindle how would i access the collected message content ? It now shows me [Object Map]
collected.first() will return the first message that got collected
you should know how to get the content from there @eternal osprey
anyone know how long it takes for your bots card in google search results to update?
1h
vertical-align: top
how do i delete a slash command
i cant do it via shell
bash: syntax error near unexpected token `"theidishere"'```
ignore the idishere, its numbers but i removed it
this doesnt list the cmds
you need to await it
it prints
[]
ah
need to specify guild
one sec
found it thanks!
how would i delete it
i get
unknown app command
client.api.applications(client.user.id).commands('id').delete()
@earnest phoenix
how come it adds a digit instead of a number?
var mgsspn = '0'
mgsspn = mgsspn + 1```
Djs
Guessing it’s the plus
?
Try removing the plus and then try @distant cobalt
it'll not work ofc
'0' is a string, so its treating '1' as a string.
That's wrong.
The const must be like this:
const help = new Discord.MessageEmbed();
how do i fix it
it's still doing that thing
Oh right
k
@earnest phoenix you needed to know what lang this was to know what was wrong?
typescript warnings intensify
'0' is a string
so adding 1 to it
will make it "01"
that is kinda common sense to me
oh would typescript get mad about that?
i dont think it should 🤔
most the TS errors make sense to me, but if anything automatic string concatenation seems useful.
not that it really matters since you can freely convert between the two anyway
Hm?
when you require MessageEmbed you misspell it.
Oh caps right?
Message is mispelled.
No
you just cant spell
It’s the E
the e
who needs spelling ;p
correction
google translate for vs
i had to google concatenation because i couldnt remember how to spell it 
Lol
@solemn latch YOOOO CONGRATS IT WORKED! 😄

Lol
no body cares
Bruh why are you acting like this?
Yea well that’s the best... I am iPad
I wished I also had visual studio code
Would’ve been better
but honestly you should double check spellings before asking here
Yes well I’m a bit blind LOL
Hmmm
what error was logged?
but did you add a color in the .setColor?
although that shouldnt kill a rpel project
lol, how did i miss that
Loll
so did you add a colour or just keep it as "your color here"
it helps to keep the console page open in another tab so you can quickly see logged errors.
i read it in order and stopped as soon as i saw an error.
did it work now and not kill ur repl?
It works but then dies right after
whats the error
ah its that
Hm? What is it
its in your index.js file
38 it says
since the message happened in a direct message, the message.guild doesnt exist
and is null
.guild is nullable, so it should be treated as such.
so as Woo said, since you are sending the embed into the users DMS, message.guild doesnt exist
So I should delete it
personally i would use optional chaining, and an inline if statement.
Hm, I got no idea so uh should I delete would it effect any other commands?
since you are new to coding I recommend just sending the help embed in the channel the command is run on
you would never have a prefix
i mean, could just fix the error
@earnest phoenix you can
What? But I have no idea what to do with it since I’m a Newbie
its in your index
or just use optional chaining 🤔
you can
optional chaining is super simple
you can do a switch
So uh which line btw? @solemn leaf
I aint helping you fool
Lol...
the solution i was thinking of was just
const prefix = get({msg.guild?.id}) || "defaultprefix";
would be a clean solution and solve the issue without messy double event listeners.
well, actually that doesnt work 
but using a ternary it would
talking to myself at this point, but does quick.db error with a undefined input? i thought it errored, but cant remember anymore.
Someone help
maria is leaving me :(
mariadb.InterfaceError: MySQL server has gone away
whats best way make a website off localhost?
when I try to invite my bot to a server that's not mine, it says that the OAUTH2 requires a code grant. How do you fix that?
disable the code grant setting in the dev portal.
thanks :)
looks like you are looking for message.member
ill try that
Thank You So Much @solemn latch
You Should Get a Staff Promo
Your The Best!
development doesnt really mean anything here staff wise.
for the time being, not looking to get mod. bot reviewing is already enough work.
Well You Should Consider
you saved both files right?
B
so, if you want, you can just require discord again in your ban file and not pass it in the execute function, will work just as well.
i did the code again and didnt work
how do you not pass it in the execute funtion
what should it look like
looks fine to me, your other option is logging Discord before the execute and see if its the right variable.
most likely command didnt have perms to add a role to that member.
is it trying to modify an owner?



