allow getting all data

This commit is contained in:
Emily 2020-10-10 16:26:27 +11:00
parent e85db060f0
commit 0f2ad7dd7b

View file

@ -15,9 +15,17 @@ class Retrieve extends Command {
return message.channel.send('Invalid database. Valid databases: `guild`, `member`, `user`');
}
if (!args[1]) {
message.channel.send(
`\`\`\`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 + '```')
message.channel.send('```' + res + '```');
}
}
}