diff --git a/src/index.ts b/src/index.ts index 0a7ebb6..40fe5d3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,12 +38,13 @@ const RE_FLAG = /^--\S+(=.*)?$/g; const RE_FLAG_NAME = /^--[^=\s]+(=*?|$)/g; const DB_FILE = process.env.DB_FILE || './db.json'; const RE_USER_MENTION = /^<@[0-9A-HJ-KM-NP-TV-Z]{26}>$/i; -const PUBLIC_COMMANDS = ['suicide', 'status', 'help']; +const PUBLIC_COMMANDS = ['suicide', 'status', 'help', 'type']; const COMMANDS = { 'help': 'List available commands', 'status': 'Edit the bot\'s status', 'suicide': 'This will make you commit suicide', 'debug': 'Debug command', + 'type': 'Kibby is yping...', 'approve': 'Release users from probation', 'unapprove': 'Send users to probation', 'block': 'Troll a user', @@ -479,6 +480,15 @@ client.on('message', async (message) => { break; } + case 'type': { + if (message.channel?.typing_ids.has(client.user!._id)) { + message.channel.stopTyping(); + } else { + message.channel?.startTyping(); + } + break; + } + case 'help': { const commands = Object.entries(COMMANDS).filter(c => privileged || PUBLIC_COMMANDS.includes(c[0]));