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: bots
(Discord.js) TypeError: Cannot read property ‘add’ of undefined
So here’s the code: When I run the bot, I get the error: As seen on the code, I add the part where the bot would make a role as when the role is unavailable. But still, it thinks as that the role never exist. Before this was copied, I aslo wrote the code like this: And the result is
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,
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
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
How to create a role with discord.js
I’ve been trying to make a discord bot using discord.js, but I can’t seem to find any documentation on how to create a role that works in 2018. All the ones I can find that work, no longer work as they have removed the referenced function. In https://discord.js.org/#/docs/main/stable/class/Role there is no mention of a createRole(“role”, “roleName”); type function. If anyone
How can I get my bot to send a message to another channel?
so I have a bot that takes whatever I say when I do the command /say and deletes my message. Since it still technically sends my message, people will see it through notifications and can tell that it was me that got the bot to send the text. I am doing this as a fun and troll thing with my
How to make bot Whent, the bot
I have this code but I have errors Answer You have few errors in code, first addField method takes 2 parameters, and both are type of string, setFooter also. client.users.get(“404968772969955329”).send(yumz) grabs user(visible by bot) with id 404968772969955329 and sends him a direct message, so if you want to send message direct to guild channel you’ll need something like this:
How to Play Audio File Into Channel?
How do you play an audio file from a Discord bot? Needs to play a local file, be in JS, and upon a certain message being sent it will join the user who typed the message, and will play the file to that channel. Answer GitHub Project: LINK In order to do this there are a few things you have