Skip to content

Commit

Permalink
fix(discord: commands): conf: fix arg containing -g being ignored e…
Browse files Browse the repository at this point in the history
…ven if not global
  • Loading branch information
dsevillamartin committed Jun 25, 2018
1 parent dde1b59 commit 52271a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Discord/Commands/Conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ 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')) && 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(' ');
const global = (args.includes('--global') || args.includes('-g')) && args.length > 3;
const conf = global ? serverConf : channelConf;
const validKeys = globsl ? ServerConfig : ChannelConfig).validKeys;
let value = global ? args.filter(e => !e.includes('-g')).slice(2).join(' ') : args.filter(2).join(' ');
if (key !== 'prefix' && value.includes(', ')) value = value.split(', ');
if (!Array.isArray(value) && (key === 'ignoredUsers' || key === 'ignoredBranches' || key === 'disabledEvents')) value = value ? [value] : [];
const embedData = {
Expand Down

0 comments on commit 52271a9

Please sign in to comment.