mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
Added lowercase to wunderbot ranks. Fixes #160.
This commit is contained in:
parent
dd50a6eec4
commit
ac78ac158b
1 changed files with 2 additions and 0 deletions
|
@ -12,11 +12,13 @@ exports.addrole = {
|
|||
usage: '<role>',
|
||||
description: 'Adds you to specified role',
|
||||
process: function(bot, msg, suffix) {
|
||||
rolelist.allowedroles = rolelist.allowedroles.map(v => v.toLowerCase());
|
||||
// Here the bot,msg and suffix is avaible, this function can be async if needed.
|
||||
let newrole = msg.guild.roles.find('name', suffix);
|
||||
let baserole = msg.guild.roles.find('name', rolelist.baserole);
|
||||
// Checks if the user put a role in the message.
|
||||
if (suffix) {
|
||||
suffix = suffix.toLowerCase();
|
||||
// Checks if the role mentioned in the message is in the allowed roles listed in the wunderbot config.
|
||||
if (rolelist.allowedroles.includes(suffix)) {
|
||||
// Checks if the role even exists in the discord server
|
||||
|
|
Loading…
Add table
Reference in a new issue