diff --git a/handlers/messages/runCustomCmd.js b/handlers/messages/runCustomCmd.js index 4a55b17..13e58f0 100644 --- a/handlers/messages/runCustomCmd.js +++ b/handlers/messages/runCustomCmd.js @@ -6,13 +6,12 @@ const { getCommand } = require('../../stores/command'); const runCustomCmdHandler = async (ctx, next) => { const { message, state } = ctx; const { isAdmin, isMaster } = state; - const isCommand = message.entities && - message.entities.filter(entity => entity.type === 'bot_command'); - if (!isCommand || !isCommand.length) { + const isCommand = /^!\w+/.test(message.text); + if (!isCommand) { return next(); } - const commandName = message.text.split(' ')[0].replace('/', ''); + const commandName = message.text.split(' ')[0].replace('!', ''); const command = await getCommand({ isActive: true, name: commandName }); if (!command) {