diff --git a/packages/dispatcher/src/filters.ts b/packages/dispatcher/src/filters.ts index f96c6bac..81d9fd61 100644 --- a/packages/dispatcher/src/filters.ts +++ b/packages/dispatcher/src/filters.ts @@ -424,13 +424,17 @@ export namespace filters { ctor === UserStatusUpdate || ctor === UserTypingUpdate ) { - const id = (upd as UserStatusUpdate | UserTypingUpdate).userId - return matchSelf && id === upd.client['_userId'] || id in index + const id = (upd as UserStatusUpdate | UserTypingUpdate) + .userId + return ( + (matchSelf && id === upd.client['_userId']) || + id in index + ) } else { const user = (upd as Exclude< typeof upd, Message | UserStatusUpdate | UserTypingUpdate - >).user + >).user return ( (matchSelf && user.isSelf) || @@ -565,7 +569,17 @@ export namespace filters { type: MaybeArray ): UpdateFilter< Message, - { action: Extract } + { + action: Extract + sender: T extends + | 'user_joined_link' + | 'user_removed' + | 'history_cleared' + | 'contact_joined' + | 'bot_allowed' + ? User + : User | Chat + } > => { if (Array.isArray(type)) { const index: Partial> = {}