@@ -159,10 +159,14 @@ export class TelegramService extends Service {
159159 */
160160 private async initializeBot ( ) : Promise < void > {
161161 this . bot ?. start ( ( ctx ) => {
162- this . runtime . emitEvent ( [ TelegramEventTypes . SLASH_START ] , {
163- // we don't need this
164- ctx,
165- } ) ;
162+ this . runtime . emitEvent (
163+ TelegramEventTypes . SLASH_START as string ,
164+ {
165+ ctx,
166+ runtime : this . runtime ,
167+ source : 'telegram' ,
168+ } as any
169+ ) ;
166170 } ) ;
167171 this . bot ?. launch ( {
168172 dropPendingUpdates : true ,
@@ -386,7 +390,6 @@ export class TelegramService extends Service {
386390 name : ctx . from . first_name || ctx . from . username || 'Unknown User' ,
387391 source : 'telegram' ,
388392 channelId : chatId ,
389- serverId : chatId ,
390393 type : ChannelType . GROUP ,
391394 worldId : worldId ,
392395 } ) ;
@@ -426,24 +429,30 @@ export class TelegramService extends Service {
426429 entityId,
427430 roomId : roomId ,
428431 userName : newMember . username ,
429- userId : telegramId ,
432+ userId : telegramId as UUID ,
430433 name : newMember . first_name || newMember . username || 'Unknown User' ,
431434 source : 'telegram' ,
432435 channelId : chatId ,
433- serverId : chatId ,
434436 type : ChannelType . GROUP ,
435437 worldId : worldId ,
436438 } ) ;
437439
438440 this . syncedEntityIds . add ( entityId ) ;
439441
440- this . runtime . emitEvent ( [ TelegramEventTypes . ENTITY_JOINED ] , {
441- runtime : this . runtime ,
442- entityId,
443- worldId,
444- newMember,
445- ctx,
446- } ) ;
442+ this . runtime . emitEvent (
443+ TelegramEventTypes . ENTITY_JOINED as string ,
444+ {
445+ runtime : this . runtime ,
446+ entityId,
447+ worldId,
448+ source : 'telegram' ,
449+ telegramUser : {
450+ id : newMember . id ,
451+ username : newMember . username ,
452+ first_name : newMember . first_name ,
453+ } ,
454+ } as any
455+ ) ;
447456 }
448457 }
449458
@@ -576,7 +585,7 @@ export class TelegramService extends Service {
576585 id : worldId ,
577586 name : chatTitle ,
578587 agentId : this . runtime . agentId ,
579- serverId : chatId ,
588+ serverId : chatId as UUID ,
580589 metadata : {
581590 source : 'telegram' ,
582591 ...( ownerId && { ownership : { ownerId } } ) ,
@@ -600,7 +609,7 @@ export class TelegramService extends Service {
600609 source : 'telegram' ,
601610 type : channelType ,
602611 channelId : chatId ,
603- serverId : chatId ,
612+ serverId : chatId as UUID ,
604613 worldId,
605614 } ;
606615
@@ -636,7 +645,6 @@ export class TelegramService extends Service {
636645 entities ,
637646 generalRoom . id ! ,
638647 generalRoom . channelId ! ,
639- generalRoom . serverId ! ,
640648 generalRoom . type ,
641649 worldId
642650 ) ;
@@ -673,7 +681,6 @@ export class TelegramService extends Service {
673681 * @param {Entity[] } entities - The entities to process
674682 * @param {UUID } roomId - The ID of the room to connect entities to
675683 * @param {string } channelId - The channel ID
676- * @param {string } serverId - The server ID
677684 * @param {ChannelType } roomType - The type of the room
678685 * @param {UUID } worldId - The ID of the world
679686 * @returns {Promise<void> }
@@ -683,7 +690,6 @@ export class TelegramService extends Service {
683690 entities : Entity [ ] ,
684691 roomId : UUID ,
685692 channelId : string ,
686- serverId : string ,
687693 roomType : ChannelType ,
688694 worldId : UUID
689695 ) : Promise < void > {
@@ -713,7 +719,6 @@ export class TelegramService extends Service {
713719 userId : telegramMetadata ?. id as UUID ,
714720 source : 'telegram' ,
715721 channelId : channelId ,
716- serverId : serverId ,
717722 type : roomType ,
718723 worldId : worldId ,
719724 } ) ;
@@ -904,7 +909,7 @@ export class TelegramService extends Service {
904909 source : 'telegram' ,
905910 type : ChannelType . GROUP ,
906911 channelId : `${ chatId } -${ threadId } ` ,
907- serverId : chatId ,
912+ serverId : chatId as UUID ,
908913 worldId,
909914 metadata : {
910915 threadId : threadId ,
0 commit comments