Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Betabot #81

Merged
merged 16 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Morbo: Morbo can't understand his teleprompter because he forgot how …
…you say that letter that's shaped like a man wearing a hat.
  • Loading branch information
wootosmash committed Feb 29, 2020
commit 3bf62d7b0bbaf74d640b2b811ef33998fffe76c9
2 changes: 1 addition & 1 deletion src/commands/modules/follow.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function sidle(msg) {
return;
}

if (!msg.ownerCanManageTheServer()) {
if (!msg.ownerCanManageTheServer() && !msg.memberCanManageTheBot()) {
msg.il8nResponse('sidle.nope');
return;
}
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/bot-stuff.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ class BotStuff {
return rtn;
};

// determines if a member can manage the bot
canManageTheBot(server, member) {
if (!server.adminrole) return false;
const rtn = member.roles.has(server.adminrole);
return rtn;
};

botHasManageMessagePermissions(server)
{
var botMember = server.guild.members.find( x => x.id == this.bot.user.id);
Expand Down
5 changes: 5 additions & 0 deletions src/models/MessageDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class MessageDetails {
return rtn;
}

memberCanManageTheBot() {
var rtn = botStuff.canManageTheBot(this.server, this.message.member);
return rtn;
}

il8nResponse(key, params) {
var _this = this;
var server = this.server;
Expand Down