I would like my bot to be able to mention and notify anyone in a role when called... For example if someone calls the role "@role" i would like everyone in that role to be mentioned...
Thanks in advance!
<@&roleID>, but this should probably be added to Role itself
Well then RoleObject.mention() would also work
Hey @abalabahaha
How can you use roles in your code? For example if there is a role called @here how would you notify anyone inside that role?
The actual @here (Discord's implementation of it) would simply be "@here". If you had a role called here you could use its object and call its mention() function. Ex.:
bot.on("message", msg => {
if(msg.content == "mention") {
var hereRole = msg.channel.server.roles.get('name', 'here');
// All of these three produce the same output
// 1
bot.sendMessage(msg, hereRole.mention() + " is anyone here?");
// 2
bot.sendMessage(msg, hereRole.toString() + " is anyone here?");
// 3
bot.sendMessage(msg, hereRole + " is anyone here?");
}
});
Thanks a lot @GexoXYZ, i will now try if it works, thanks again for your time helping me!
Can I add this in to my bot using a const?