mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-09-03 12:30:16 +00:00
Merge pull request #225 from lbryio/Coolguy3289-patch-2
Add Ability to Self-Add Baserole
This commit is contained in:
commit
f06fdcab71
2 changed files with 10 additions and 5 deletions
|
@ -103,5 +103,9 @@ npm install
|
|||
to run prettier before submitting your code simply run the following in the bots root directory.
|
||||
|
||||
```
|
||||
npm run precommit
|
||||
```
|
||||
npm run prettier
|
||||
```
|
||||
To be sure your build will pass with TravisCI, also be sure to run
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
|
|
@ -20,7 +20,7 @@ exports.addrole = {
|
|||
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)) {
|
||||
if (rolelist.allowedroles.includes(suffix) || rolelist.baserole.includes(suffix)) {
|
||||
// Checks if the role even exists in the discord server
|
||||
if (newrole !== null) {
|
||||
// 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!'));
|
||||
if (rolelist.baserole !== ' ') {
|
||||
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!'));
|
||||
}
|
||||
} else {
|
||||
|
@ -91,7 +92,7 @@ exports.roles = {
|
|||
fields: [
|
||||
{
|
||||
name: 'List of roles',
|
||||
value: buildRoleString(rolelist.allowedroles),
|
||||
value: buildRoleString(rolelist.allowedroles) + '`' + rolelist.baserole + '`',
|
||||
inline: false
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue