Skip to content

Commit

Permalink
chore: install new command, increase bot reply timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 6, 2024
1 parent 49df118 commit e0e4f1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 8 additions & 0 deletions src/bot/setcommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function getPrivateChatCommands(): BotCommand[] {
command: "wallet",
description: "Register your wallet address",
},
{
command: "ubiquityos",
description: "Ask UbiquityOS a question",
},
];
}

Expand All @@ -112,6 +116,10 @@ function getGroupChatCommands(): BotCommand[] {
command: "ban",
description: "Ban a user",
},
{
command: "ubiquityos",
description: "Ask UbiquityOS a question",
},
];
}

Expand Down

0 comments on commit e0e4f1f

Please sign in to comment.