Skip to content

Commit

Permalink
command/lang: hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
comjun04 committed Nov 1, 2019
1 parent a28c7e4 commit de01d6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions commands/misc/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = class LangCommand extends BotCommand {
}

hasPerm(msg) {
return msg.guild.member(msg.author).hasPermission('ADMINISTRATOR');
if(msg.client.isOwner(msg.author.id)) return true;
else return msg.guild.member(msg.author).hasPermission('ADMINISTRATOR');
}

run(msg, {language}) {
Expand All @@ -41,8 +42,8 @@ module.exports = class LangCommand extends BotCommand {
}, msg.client.getGuildLocale(msg.guild)));
}
else {
if(this.hasPerm(msg)) {

if(!this.hasPerm(msg)) {
return msg.say(i18n.__ll('commands.lang.execute.noPermission', msg.guild));
} else {
//return msg.reply('access denied. (needs translation)');
//i18n.setLocale(language);
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
},
"execute": {
"get": "The current language is: `%s`",
"set": "Language setting changed to `%s`."
"set": "Language setting changed to `%s`.",
"noPermission": "You don't have `ADMINISTRATOR` permission to do that."
}
},
"activate": {
Expand Down
3 changes: 2 additions & 1 deletion lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
},
"execute": {
"get": "현재 언어: %s",
"set": "언어 설정이 `%s`(으)로 바뀌었습니다."
"set": "언어 설정이 `%s`(으)로 바뀌었습니다.",
"noPermission": "commands.lang.execute.noPermission"
}
},
"activate": {
Expand Down

0 comments on commit de01d6f

Please sign in to comment.