From 23e6b78f0568a13cc15620e17a1b22207d0c99e8 Mon Sep 17 00:00:00 2001 From: GingerPlusPlus Date: Wed, 16 May 2018 19:09:27 +0200 Subject: [PATCH] Alias !report and !admins? to /report --- handlers/commands/index.js | 1 - handlers/regex/index.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/commands/index.js b/handlers/commands/index.js index ab515a4..5bf5149 100644 --- a/handlers/commands/index.js +++ b/handlers/commands/index.js @@ -50,7 +50,6 @@ composer.command('user', deleteMessage, userHandler); composer.command('ban', deleteMessage, banHandler); composer.command('unban', deleteMessage, unbanHandler); composer.command('report', deleteMessage, reportHandler); -composer.hears(/^@admins?\s?/i, deleteMessage, reportHandler); composer.command('staff', deleteMessage, staffHandler); composer.command('link', deleteMessage, linkHandler); composer.command('groups', deleteMessage, groupsHandler); diff --git a/handlers/regex/index.js b/handlers/regex/index.js index c30d623..d34a861 100644 --- a/handlers/regex/index.js +++ b/handlers/regex/index.js @@ -1,10 +1,11 @@ 'use strict'; -const { compose } = require('telegraf'); +const { compose, hears } = require('telegraf'); /* eslint-disable global-require */ module.exports = compose([ + hears(/^(?:!report|[@!]admins?)\b/i, require('../commands/report')), require('./runCustomCmd'), require('./groupLinker'), ]);