From 6695a4e4b01e506b481d22170f2dc0623964161b Mon Sep 17 00:00:00 2001 From: ender Date: Fri, 12 Apr 2024 17:27:54 +0200 Subject: [PATCH] refactor commands --- src/bot.ts | 4 ---- src/plugins/chatgpt.ts | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index 6657250..ab96f67 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -335,10 +335,6 @@ export class Bot { trigger = command.replace('/', `^${escapeRegExp(this.config.prefix)}`); } - if (command.startsWith('@')) { - trigger = command.replace('@', '^@'); - } - if (!friendly) { if (parameters == null && trigger.startsWith('^')) { trigger += '$'; diff --git a/src/plugins/chatgpt.ts b/src/plugins/chatgpt.ts index 9c24d7e..7d0d87b 100644 --- a/src/plugins/chatgpt.ts +++ b/src/plugins/chatgpt.ts @@ -10,15 +10,15 @@ export class EchoPlugin extends PluginBase { super(bot); this.commands = [ { - command: `@${this.bot.user.username}`, + command: `/chatgpt`, parameters: [ { name: 'text', - required: false, + required: true, }, ], + friendly: `^@${this.bot.user.username}`, description: 'Use ChatGPT to provide text outputs in response to inputs', - skipHelp: true, }, ]; }