Changed bot features to .hears and used regex to detect commands.
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 3m10s
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 3m10s
This commit is contained in:
@@ -10,8 +10,8 @@ const feature = composer.chatType(["private", "group", "supergroup"]);
|
|||||||
* What triggers this feature and adds to the log when it has been triggered.
|
* What triggers this feature and adds to the log when it has been triggered.
|
||||||
* The trigger is the command "/botInfo"
|
* The trigger is the command "/botInfo"
|
||||||
*/
|
*/
|
||||||
feature.command(
|
feature.hears(
|
||||||
"botInfo",
|
/^\/botInfo/,
|
||||||
logHandle("bot-info-command"),
|
logHandle("bot-info-command"),
|
||||||
async (ctx: Context) => {
|
async (ctx: Context) => {
|
||||||
// Checks if the context includes a message property.
|
// Checks if the context includes a message property.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const feature = composer.chatType(["group", "supergroup", "private"]);
|
|||||||
* What triggers this feature and adds to the log when it has been triggered.
|
* What triggers this feature and adds to the log when it has been triggered.
|
||||||
* The trigger is the command "/help"
|
* The trigger is the command "/help"
|
||||||
*/
|
*/
|
||||||
feature.command("help", logHandle("help"), async (ctx: Context) => {
|
feature.hears(/^\/help/, logHandle("help"), async (ctx: Context) => {
|
||||||
const GROUP_IDS = process.env.GROUP_IDS
|
const GROUP_IDS = process.env.GROUP_IDS
|
||||||
? process.env.GROUP_IDS.split(",")
|
? process.env.GROUP_IDS.split(",")
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user