Closed roziscoding closed 1 year ago
Major redesign to better support filtering. Proposed usage:
import { Bot } from "./src/deps.deno.ts"; import { Commands } from "./src/plugin.ts"; const bot = new Bot("..."); const cmds = new Commands(); cmds.command("start", "Initializes bot configuration") .localize("pt", "start", "Inicializa as configurações do bot") .addToScope({ type: "all_private_chats" }, (ctx) => ctx.reply(`Hello, ${ctx.chat.first_name}!`)) .addToScope({ type: "all_group_chats" }, (ctx) => ctx.reply(`Hello, members of ${ctx.chat.title}!`)); await cmds.setCommands(bot); bot.use(cmds); bot.start();
Major redesign to better support filtering. Proposed usage: