Skip to content

Commit

Permalink
fix(discord: commands): fix -g included in the argument name being …
Browse files Browse the repository at this point in the history
…interpreted as global
  • Loading branch information
dsevillamartin committed Jun 25, 2018
1 parent b355a28 commit 0a10ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Discord/Commands/Conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ConfCommand extends Command {
const { guild, channel } = msg;
const args = this.generateArgs(a);
const key = args.filter(e => !e.includes('-'))[1];
const conf = (args.includes('--global') || args.includes('-g')) ? serverConf : channelConf;
const conf = (args.includes('--global') || args.includes('-g')) && args.length > 3 ? serverConf : channelConf;
const validKeys = ((args.includes('--global') || args.includes('-g')) ? ServerConfig : ChannelConfig).validKeys;
let value = args.filter(e => !e.includes('-g')).slice(2, 20).join(' ');
if (key !== 'prefix' && value.includes(', ')) value = value.split(', ');
Expand Down

0 comments on commit 0a10ef5

Please sign in to comment.