diff --git a/src/bot/index.ts b/src/bot/index.ts index 3b73bcd..d2e4c5a 100644 --- a/src/bot/index.ts +++ b/src/bot/index.ts @@ -23,6 +23,7 @@ import { welcomeFeature } from "./features/start-command"; import { unhandledFeature } from "./features/helpers/unhandled"; import { Context } from "../types"; import { session } from "./middlewares/session"; +import { askFeature } from "./features/commands/shared/ask-command"; interface Dependencies { config: Context["env"]; @@ -45,6 +46,9 @@ export async function createBot(token: string, dependencies: Dependencies, optio const bot = new TelegramBot(token, { ...options.botConfig, ContextConstructor: await createContextConstructor(dependencies), + client: { + timeoutSeconds: 20, + }, }); // Error handling @@ -89,6 +93,9 @@ export async function createBot(token: string, dependencies: Dependencies, optio // Group commands bot.use(banCommand); + // shared commands + bot.use(askFeature); + // Unhandled command handler bot.use(unhandledFeature); diff --git a/src/bot/setcommands.ts b/src/bot/setcommands.ts index 1e790ec..477fe19 100644 --- a/src/bot/setcommands.ts +++ b/src/bot/setcommands.ts @@ -90,6 +90,10 @@ function getPrivateChatCommands(): BotCommand[] { command: "wallet", description: "Register your wallet address", }, + { + command: "ubiquityos", + description: "Ask UbiquityOS a question", + }, ]; } @@ -112,6 +116,10 @@ function getGroupChatCommands(): BotCommand[] { command: "ban", description: "Ban a user", }, + { + command: "ubiquityos", + description: "Ask UbiquityOS a question", + }, ]; }