import { EntityLike } from "../define" ; import { Api } from "../tl" ; import { EventBuilder , EventCommon , DefaultEventInterface } from "./common" ; remarks example export class DeletedMessage extends EventBuilder { constructor ( eventParams ) { super ( eventParams ) ; } build ( update , callback , selfId ) { if ( update instanceof Api . UpdateDeleteChannelMessages ) { return new DeletedMessageEvent ( update . messages , new Api . PeerChannel ( { channelId : update . channelId } ) ) ; } else if ( update instanceof Api . UpdateDeleteMessages ) { return new DeletedMessageEvent ( update . messages ) ; } } } export class DeletedMessageEvent extends EventCommon { deletedIds : number [ ] ; peer ? : EntityLike ; constructor ( deletedIds , peer ? ) { super ( { chatPeer : peer , msgId : Array . isArray ( deletedIds ) ? deletedIds [ 0 ] : 0 , } ) ; this . deletedIds = deletedIds ; this . peer = peer ; } }