f
constf:object=filter
Defined in: sdks/agent/src/core/filter.ts:75
Short name for the message and conversation filters.
Type Declaration
Section titled “Type Declaration”fromSelf
Section titled “fromSelf”fromSelf: (
message,client) =>boolean
Check whether the client sent the message.
Parameters
Section titled “Parameters”message
Section titled “message”client
Section titled “client”Returns
Section titled “Returns”boolean
hasContent
Section titled “hasContent”hasContent: (
message) =>message is DecodedMessageWithContent<unknown>
Check whether the content type is known and has decoded custom content.
Parameters
Section titled “Parameters”message
Section titled “message”Returns
Section titled “Returns”message is DecodedMessageWithContent<unknown>
isDM: (
conversation) =>conversation is Dm
Check whether the conversation is a direct message.
Parameters
Section titled “Parameters”conversation
Section titled “conversation”Returns
Section titled “Returns”conversation is Dm
isGroup
Section titled “isGroup”isGroup: (
conversation) =>conversation is Group
Check whether the conversation is a group.
Parameters
Section titled “Parameters”conversation
Section titled “conversation”Returns
Section titled “Returns”conversation is Group
isGroupAdminAsync
Section titled “isGroupAdminAsync”isGroupAdminAsync: (
conversation,message) =>Promise<boolean>
Await this check before granting group admin access.
Parameters
Section titled “Parameters”conversation
Section titled “conversation”message
Section titled “message”Returns
Section titled “Returns”Promise<boolean>
isGroupSuperAdminAsync
Section titled “isGroupSuperAdminAsync”isGroupSuperAdminAsync: (
conversation,message) =>Promise<boolean>
Await this check before granting group super admin access.
Parameters
Section titled “Parameters”conversation
Section titled “conversation”message
Section titled “message”Returns
Section titled “Returns”Promise<boolean>
usesCodec
Section titled “usesCodec”usesCodec: <
T>(message,codecClass) =>message is DecodedMessageWithContent<ReturnType<T["decode"]>>
Check the codec authority, type name, and major version.
Type Parameters
Section titled “Type Parameters”T extends AnyContentCodec
Parameters
Section titled “Parameters”message
Section titled “message”codecClass
Section titled “codecClass”() => T
Returns
Section titled “Returns”message is DecodedMessageWithContent<ReturnType<T["decode"]>>