Skip to content

Commit c93308d

Browse files
committed
handle /sstart command by emitting a runtime event, remove unused vars
1 parent ad642d1 commit c93308d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ import {
33
type Content,
44
type Entity,
55
EventType,
6-
type HandlerCallback,
76
type IAgentRuntime,
8-
type Memory,
97
Role,
108
type Room,
119
Service,
1210
type TargetInfo,
1311
type UUID,
1412
type World,
15-
WorldPayload,
1613
createUniqueUuid,
1714
logger,
1815
} from '@elizaos/core';
@@ -21,7 +18,7 @@ import { type ChatMemberOwner, type ChatMemberAdministrator } from 'telegraf/typ
2118
import { TELEGRAM_SERVICE_NAME } from './constants';
2219
import { validateTelegramConfig } from './environment';
2320
import { MessageManager } from './messageManager';
24-
import { TelegramEventTypes, TelegramWorldPayload } from './types';
21+
import { TelegramEventTypes, type TelegramWorldPayload } from './types';
2522

2623
/**
2724
* Class representing a Telegram service that allows the agent to send and receive messages on Telegram.
@@ -144,6 +141,13 @@ export class TelegramService extends Service {
144141
* @returns {Promise<void>} A Promise that resolves when the initialization is complete.
145142
*/
146143
private async initializeBot(): Promise<void> {
144+
this.bot.start(ctx => {
145+
this.runtime.emitEvent([TelegramEventTypes.SLASH_START], {
146+
// we don't need this
147+
//runtime: this.runtime,
148+
ctx,
149+
});
150+
});
147151
this.bot.launch({
148152
dropPendingUpdates: true,
149153
allowedUpdates: ['message', 'message_reaction'],

0 commit comments

Comments
 (0)