I am trying to add a bulk delete command to my bot but when I type how many messages I want to delete, I get the following error: Here’s the code: Answer To use the parseInt(), you have to add the decimal base, so 10 -> parseInt(args[0], 10);. The snippet of code I have put above is working well.
Tag: discord
Temporary mute command returning error ‘Cannot read property ‘slice’ of undefined’
I am trying to create a temporary mute command, that will unmute the muted user in the given time. Here’s my code: Currently getting the following error: Cannot read property ‘slice’ of undefined Do you have any idea on how to fix the command? edit this after a year and this is for future people who come here the issue
How to I make my music bot play a finite playlist of songs?
Building further on my music bot… I’m trying to make the jump from having him play a single song, and then leave, to having him play a finite list of songs, and then leave. This should not be confused with a queue – the list of songs is predetermined and finite. It can’t be added to or changed by the
How to fix cannot read property “send” of undefined
This question might have a few duplicates, but the code there is different and none of the answers work for me. I’m new to discord.js so it might just be a silly mistake. This is my code – I really don’t know how to fix this, so all the solutions I have tried lead to this error. Also if you
How to fix cannot read property “send” of undefined
This question might have a few duplicates, but the code there is different and none of the answers work for me. I’m new to discord.js so it might just be a silly mistake. This is my code – I really don’t know how to fix this, so all the solutions I have tried lead to […]
How to make bot send message to another channel after reaction | Discord.js
How do I make it so that when someone reacts with the first emoji in this command, the bot deletes the message and sends it to another channel? Current Code: Answer You can use awaitReactions, createReactionCollector or messageReactionAdd event, I think awaitReactions is the best option here since the other two are for more global purposes,
How to auto-give role when someone is playing game? V12 discord js
I recently decided to upgrade my discord js library to v12. I wanted to when someone turns on the game (Golf With Your Friends) he gets a role. But I can’t program it in discord js v12. Can you help me? Here is my code in v11: Answer Here’s a guide from discordjs.guide on updating from v11 to v12: https://discordjs.guide/additional-info/changes-in-v12.html#managers-cache
Discord.js RichEmbed field values “empty” even thought they are not. messageUpdate
So basically I have been making an log for message edit. The aim of the function is to write in modlog channel if someone edits the message. Also I wanted bot to write message before and after update. Here is the code: The console error : What the bot does: -Bot executes the function exactly as planned. I have all
How to securely store the Access-Token of a Discord(OAuth2) User?
I’m struggling to find a way to securely save an Access-Token, which my web application retrieved from the DiscordAPI after the user authorized the application. I’m creating a web-interface for a Discord Bot. Here it is important, that not everyone can use it. Only server-moderators and such on a specific Discord server should be allowed to access most parts of
Sending message to specific channel based on an argument
I have searched up and found multiple forum posts on both Reddit and StackOverflow where users are asking how to send a message to the specific channel, but I cannot find one where you can send to a specific channel using an Argument. What I mean is that you use I have been testing around with this “function” and have