import { DyNTS_Bot_MessagingProvider_ServiceBase } from '../_services/bot-messaging-provider.service-base'; import { DyNTS_Bot_MessageWrapper } from './bot-message-wrapper.interface'; /** * Wraps a bot channel with provider context * This ensures channels include the provider information needed for platform-specific operations */ export class DyNTS_Bot_ChannelWrapper_Base< T_MessagingPlatformChannel extends any = any, T_MessagingPlatformMessage extends any = any, > { id: string; name: string; isTextBased: boolean; isVoiceBased: boolean; isDM: boolean; rawPlatformChannel: T_MessagingPlatformChannel; /** Reference to the provider instance for platform-specific operations */ provider: DyNTS_Bot_MessagingProvider_ServiceBase< T_MessagingPlatformChannel, T_MessagingPlatformMessage, //DyNTS_Bot_MessageWrapper, any, //DyNTS_Bot_UserWrapper, any >; } export class DyNTS_Bot_ChannelWrapper< T_MessagingPlatformChannel extends any = any, T_MessagingPlatformMessage extends any = any, > extends DyNTS_Bot_ChannelWrapper_Base { constructor( set: DyNTS_Bot_ChannelWrapper_Base ) { super(); Object.assign(this, set); } async sendMessage(content: string, issuer: string): Promise> { return await this.provider.sendMessageToChannel(this, content, issuer); } async sendTyping(): Promise { await this.provider.sendTyping(this); } async fetchMessages(limit: number): Promise[]> { return await this.provider.fetchMessages(this, limit); } /* async fetchAllMessagesWi */ async clear(): Promise { await this.provider.clearChannel(this); } }