GramIO API Reference / @gramio/contexts/dist / TargetMixin
Class: TargetMixin
Defined in: contexts/index.d.ts:5253
This object represents a mixin which has sender data (e.g. senderId, from etc.)
Extended by
BoostAddedContextChatBackgroundSetContextChatControlMixinChatInviteControlMixinChatJoinRequestContextChatMemberContextChatMemberControlMixinChatOwnerChangedContextChatOwnerLeftContextChatSenderControlMixinChatSharedContextChecklistTasksAddedContextChecklistTasksDoneContextCommunityChatAddedContextCommunityChatJoinedContextCommunityChatRemovedContextDeleteChatPhotoContextDirectMessagePriceChangedContextForumTopicClosedContextForumTopicCreatedContextForumTopicEditedContextForumTopicReopenedContextGeneralForumTopicHiddenContextGeneralForumTopicUnhiddenContextGiftContextGiftUpgradeSentContextGiveawayCompletedContextGiveawayCreatedContextGiveawayWinnersContextGroupChatCreatedContextInvoiceContextLeftChatMemberContextLocationContextManagedBotCreatedContextMessageAutoDeleteTimerChangedContextMessageContextMigrateFromChatIdContextMigrateToChatIdContextNewChatMembersContextNewChatPhotoContextNewChatTitleContextPaidMediaPurchasedContextPaidMessagePriceChangedContextPassportDataContextPinnedMessageContextPinsMixinPollOptionAddedContextPollOptionDeletedContextProximityAlertTriggeredContextRefundedPaymentContextSuccessfulPaymentContextSuggestedPostApprovalFailedContextSuggestedPostApprovedContextSuggestedPostDeclinedContextSuggestedPostPaidContextSuggestedPostRefundedContextUniqueGiftContextUsersSharedContextVideoChatEndedContextVideoChatParticipantsInvitedContextVideoChatScheduledContextVideoChatStartedContextWebAppDataContextWriteAccessAllowedContext
Constructors
Constructor
new TargetMixin():
TargetMixin
Returns
TargetMixin
Properties
| Property | Type | Defined in |
|---|---|---|
payload | Record<string, any> | contexts/index.d.ts:5254 |
Accessors
businessConnectionId
Get Signature
get businessConnectionId():
string
Defined in: contexts/index.d.ts:5279
Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
Returns
string
chat
Get Signature
get chat():
Chat
Defined in: contexts/index.d.ts:5273
Conversation the message belongs to
Returns
chatId
Get Signature
get chatId():
number
Defined in: contexts/index.d.ts:5277
Chat ID
Returns
number
chatType
Get Signature
get chatType():
TelegramChatType
Defined in: contexts/index.d.ts:5281
Chat type
Returns
from
Get Signature
get from():
User
Defined in: contexts/index.d.ts:5258
Sender, empty for messages sent to channels
Returns
senderBoostCount
Get Signature
get senderBoostCount():
number
Defined in: contexts/index.d.ts:5271
Optional. If the sender of the message boosted the chat, the number of boosts added by the user
Returns
number
senderChat
Get Signature
get senderChat():
Chat
Defined in: contexts/index.d.ts:5267
Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group
Returns
senderId
Get Signature
get senderId():
number
Defined in: contexts/index.d.ts:5275
Sender's ID
Returns
number
Methods
hasFrom()
hasFrom(): this is Require<TargetMixin, "from" | "senderId">
Defined in: contexts/index.d.ts:5256
Checks if the instance has from and senderId properties
Returns
this is Require<TargetMixin, "from" | "senderId">
hasSenderChat()
hasSenderChat():
this is Require<TargetMixin, "senderChat">
Defined in: contexts/index.d.ts:5260
Checks if the instance has senderChat property
Returns
this is Require<TargetMixin, "senderChat">
isChannel()
isChannel():
this is RequireValue<TargetMixin, "chatType", Channel>
Defined in: contexts/index.d.ts:5289
Is this chat a channel?
Returns
this is RequireValue<TargetMixin, "chatType", Channel>
isGroup()
isGroup():
this is RequireValue<TargetMixin, "chatType", Group>
Defined in: contexts/index.d.ts:5285
Is this chat a group?
Returns
this is RequireValue<TargetMixin, "chatType", Group>
isPM()
isPM():
this is RequireValue<TargetMixin, "chatType", Private>
Defined in: contexts/index.d.ts:5283
Is this chat a private one?
Returns
this is RequireValue<TargetMixin, "chatType", Private>
isSupergroup()
isSupergroup():
this is RequireValue<TargetMixin, "chatType", Supergroup>
Defined in: contexts/index.d.ts:5287
Is this chat a supergroup?
Returns
this is RequireValue<TargetMixin, "chatType", Supergroup>