Discord.js bot that adds roles

So I’m making a discord.js bot and I want it to be able to add roles when you type something like +role1 and after that the bot will send a confirmation message like “I’ve added your role!” and delete everything after a few seconds.I’ve searched in so so many places but I can’t find anything that is working,I know it’s a long request but if someone helps me I would be very thankful!

See https://discordjs.guide/popular-topics/faq.html#how-do-i-kick-a-user for adding roles with discord.js v12.
To delete a message, use message.delete({timeout: 1000, reason: "Why not"}).

1 Like

Thanks! And do you know how to do the “after that the bot will send a confirmation message like “I’ve added your role!” and delete everything after a few seconds” part?

I just edited it for the deletion, for replying, just add the role, and run message.reply("this is a reply").

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.