Skip to content

Commit de01d6f

Browse files
committed
command/lang: hotfix
1 parent a28c7e4 commit de01d6f

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

commands/misc/lang.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module.exports = class LangCommand extends BotCommand {
2828
}
2929

3030
hasPerm(msg) {
31-
return msg.guild.member(msg.author).hasPermission('ADMINISTRATOR');
31+
if(msg.client.isOwner(msg.author.id)) return true;
32+
else return msg.guild.member(msg.author).hasPermission('ADMINISTRATOR');
3233
}
3334

3435
run(msg, {language}) {
@@ -41,8 +42,8 @@ module.exports = class LangCommand extends BotCommand {
4142
}, msg.client.getGuildLocale(msg.guild)));
4243
}
4344
else {
44-
if(this.hasPerm(msg)) {
45-
45+
if(!this.hasPerm(msg)) {
46+
return msg.say(i18n.__ll('commands.lang.execute.noPermission', msg.guild));
4647
} else {
4748
//return msg.reply('access denied. (needs translation)');
4849
//i18n.setLocale(language);

lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108
},
109109
"execute": {
110110
"get": "The current language is: `%s`",
111-
"set": "Language setting changed to `%s`."
111+
"set": "Language setting changed to `%s`.",
112+
"noPermission": "You don't have `ADMINISTRATOR` permission to do that."
112113
}
113114
},
114115
"activate": {

lang/ko.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108
},
109109
"execute": {
110110
"get": "현재 언어: %s",
111-
"set": "언어 설정이 `%s`(으)로 바뀌었습니다."
111+
"set": "언어 설정이 `%s`(으)로 바뀌었습니다.",
112+
"noPermission": "commands.lang.execute.noPermission"
112113
}
113114
},
114115
"activate": {

0 commit comments

Comments
 (0)