Skip to content

Commit

Permalink
add commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cyri113 committed Nov 29, 2024
1 parent 07a36ba commit 2040de9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/bot/src/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ export class BotService implements OnModuleInit {
) {
this.bot = new Bot(configService.get<string>('telegram.token'));

this.bot.command('start', async (ctx) => {
await ctx.reply(
'<b>Welcome, {username}!</b>\n\n<u><b>Get Started</b></u>\n\nTo get you up and running, there are two simple steps:\n\n<b>1. Add me to your group or channel</b>\n\nTo add me to your group or channel, simply tap on my username (at the top) and select <i>"Add to Group or Channel"</i>.\n\nSelect the group or channel you want.\n\nI will need <b>Admin Rights</b>, but you can disable all additional privileges.\n\n<b>2. Verify me on <a href="https://app.togethercrew.com">app.togethercrew.com</a></b>\n\nHead over to <a href="https://app.togethercrew.com">https://app.togethercrew.com</a>.\n\nIn your community settings, add a Telegram platform.\n\nCopy the verify command into your group and send it.\n\nI will take care of the rest.',
);
});

this.bot.command('verify', async (ctx) => {
await ctx.reply('[Coming soon] This will blow your mind.');
});

Object.values(IgnoreEvent).map((event) => {
this.bot.on(event, () => {
this.logger.warn(`Ignoring ${event} event.`);
Expand All @@ -46,6 +56,11 @@ export class BotService implements OnModuleInit {
return;
});
});

this.bot.api.setMyCommands([
{ command: 'start', description: 'Get started with the TogetherCrewBot' },
{ command: 'verify', description: 'Verify your group.' },
]);
}

async onModuleInit() {
Expand Down

0 comments on commit 2040de9

Please sign in to comment.