MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / start

Method start

src/runtime/adapters/telegram.ts:50–68  ·  view source on GitHub ↗
(ctx: AdapterContext)

Source from the content-addressed store, hash-verified

48 }
49
50 async start(ctx: AdapterContext): Promise<void> {
51 this.agent = ctx.agent;
52 this.rootDir = ctx.rootDir;
53 this.ipcBroadcaster = ctx.ipcBroadcaster ?? null;
54
55 this.bot = new TelegramBot(this.options.token, { polling: true });
56
57 this.bot.on("message", (msg) => {
58 this.handleTelegramMessage(msg).catch((err) => {
59 console.error("[Telegram] Error handling message:", err);
60 });
61 });
62
63 // Register bot commands with Telegram
64 await this.bot.setMyCommands(getTelegramBotCommands());
65
66 const me = await this.bot.getMe();
67 console.log(`[TelegramAdapter] Started as @${me.username}`);
68 }
69
70 async stop(): Promise<void> {
71 if (this.bot) {

Callers 1

startServerFunction · 0.95

Calls 3

handleTelegramMessageMethod · 0.95
getTelegramBotCommandsFunction · 0.85
onMethod · 0.65

Tested by

no test coverage detected