Solved TelegramBot custom commands
-
Hi! I’m trying to make MMM-page-indicator working. But on telegramBot no clear(for dummy like me) instruction how to install custom command for changing pages.
Plugin accept this: this.sendNotification(“PAGE_CHANGED”, 2);
I don’t know how to interpret this so Telegram and that plugin can understand each other. Please i need help!
-
maybe, try something like this in TB configuration with
customCommands
feature:customCommands: [ { command: "pages", description: "Change page number", callback: (command, handler, self) => { if (handler.args) { var args = handler.args.split(" ") if (args[0] && !isNaN(args[0])) { handler.reply("TEXT", "Change page number to " + args[0]) return self.sendNotification("PAGE_CHANGED", args[0]) } else { return handler.reply("TEXT", "invalid number page!") } } handler.reply("TEXT", "/pages <page number>") } } ]
and you should discover
pages
commands in/commands
syntax for
/pages
command is/pages <page number>
sample:/pages 1
-
You’re amazing!!!Thank you!
-
bugsounet