allow getting all data
This commit is contained in:
parent
e85db060f0
commit
0f2ad7dd7b
1 changed files with 11 additions and 3 deletions
|
@ -15,9 +15,17 @@ class Retrieve extends Command {
|
||||||
return message.channel.send('Invalid database. Valid databases: `guild`, `member`, `user`');
|
return message.channel.send('Invalid database. Valid databases: `guild`, `member`, `user`');
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = data[args[0]][args[1]];
|
if (!args[1]) {
|
||||||
if (!res) return message.channel.send('Invalid key. Check for typing errors and try again.');
|
message.channel.send(
|
||||||
message.channel.send('```' + res + '```')
|
`\`\`\`js
|
||||||
|
${JSON.stringify(data[args[0]])}
|
||||||
|
\`\`\``
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
let res = data[args[0]][args[1]];
|
||||||
|
if (!res) return message.channel.send('Invalid key. Check for typing errors and try again.');
|
||||||
|
message.channel.send('```' + res + '```');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue