2020-10-09 05:04:01 +00:00
|
|
|
const Command = require("../../base/Command.js");
|
|
|
|
|
|
|
|
class Retrieve extends Command {
|
|
|
|
constructor (client) {
|
|
|
|
super(client, {
|
|
|
|
description: "Retrieves a key's value from the Redis DB.",
|
|
|
|
usage: "retrieve [key]",
|
|
|
|
guildOnly: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-10-10 03:01:56 +00:00
|
|
|
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
2020-10-09 05:04:01 +00:00
|
|
|
if (!args[0]) return message.channel.send("You didn't specify what key to retrieve!")
|
|
|
|
|
|
|
|
try {
|
2020-10-10 00:38:29 +00:00
|
|
|
const res = await this.client.db.getGuildKey(message.guild.id, args[0])
|
2020-10-09 05:04:01 +00:00
|
|
|
message.channel.send(res)
|
|
|
|
} catch (err) {
|
|
|
|
return message.channel.send(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Retrieve;
|