From 78fde4b94ca2a18bfa7bb51d6f25c3499f934825 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 11 Oct 2020 13:14:16 +1100 Subject: [PATCH] command to change personal prefixes --- bot/commands/Configuration/userprefix.js | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bot/commands/Configuration/userprefix.js diff --git a/bot/commands/Configuration/userprefix.js b/bot/commands/Configuration/userprefix.js new file mode 100644 index 0000000..c277337 --- /dev/null +++ b/bot/commands/Configuration/userprefix.js @@ -0,0 +1,25 @@ +const Command = require("../../base/Command.js"); + +class Userprefix extends Command { + constructor (client) { + super(client, { + description: "Change the prefix you use for Woomy. This will affect servers and commands in DM's.", + usage: "`userprefix` ", + examples: "`userprefix !!` - Sets your personal prefix to !!" + }); + } + + async run (message, args) { // eslint-disable-line no-unused-vars + if (!args[0]) { + return message.channel.send( + `Your prefix for Woomy is currently: \`${await this.client.db.getUserKey(message.author.id, 'prefix')}\`` + ); + }; + + await this.client.db.setUserKey(message.author.id, 'prefix', args[0]); + + message.channel.send(`Your personal prefix has been set to: \`${args[0]}\``); + }; +}; + +module.exports = Userprefix;