mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
Updated output of roles list, added baserole check
This commit is contained in:
parent
67be623b3f
commit
f7dec07e50
1 changed files with 5 additions and 3 deletions
|
@ -20,7 +20,7 @@ exports.addrole = {
|
||||||
if (suffix) {
|
if (suffix) {
|
||||||
//suffix = suffix.toLowerCase();
|
//suffix = suffix.toLowerCase();
|
||||||
// Checks if the role mentioned in the message is in the allowed roles listed in the wunderbot config.
|
// Checks if the role mentioned in the message is in the allowed roles listed in the wunderbot config.
|
||||||
if (rolelist.allowedroles.includes(suffix) || baserole == suffix) {
|
if (rolelist.allowedroles.includes(suffix) || rolelist.baserole.includes(suffix)) {
|
||||||
// Checks if the role even exists in the discord server
|
// Checks if the role even exists in the discord server
|
||||||
if (newrole !== null) {
|
if (newrole !== null) {
|
||||||
// Checks if the member has the role that they are trying to add
|
// Checks if the member has the role that they are trying to add
|
||||||
|
@ -28,7 +28,8 @@ exports.addrole = {
|
||||||
msg.member.addRole(newrole).then(msg.channel.send(msg.member + ' has been added to the ' + suffix + ' role!'));
|
msg.member.addRole(newrole).then(msg.channel.send(msg.member + ' has been added to the ' + suffix + ' role!'));
|
||||||
if (rolelist.baserole !== ' ') {
|
if (rolelist.baserole !== ' ') {
|
||||||
if (baserole !== null) {
|
if (baserole !== null) {
|
||||||
if (!msg.member.roles.find('name', rolelist.baserole)) {
|
// Checks if Member has the baserole, and also checks if they just added the baserole
|
||||||
|
if (!msg.member.roles.find('name', rolelist.baserole) && suffix !== rolelist.baserole) {
|
||||||
msg.member.addRole(baserole).then(msg.channel.send(msg.member + ' has been added to the ' + rolelist.baserole + ' role!'));
|
msg.member.addRole(baserole).then(msg.channel.send(msg.member + ' has been added to the ' + rolelist.baserole + ' role!'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -91,7 +92,7 @@ exports.roles = {
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'List of roles',
|
name: 'List of roles',
|
||||||
value: buildRoleString(rolelist.allowedroles) + '\n' + rolelist.baserole,
|
value: buildRoleString(rolelist.allowedroles) + '`' + rolelist.baserole + '`',
|
||||||
inline: false
|
inline: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -127,3 +128,4 @@ function buildRoleString(roles) {
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue