Skip to content

GramIO API Reference / @gramio/contexts/dist / ChatSenderControlMixin

Class: ChatSenderControlMixin<Bot> ​

Defined in: contexts/index.d.ts:5808

This object is a mixin that does all the chat-sender stuff, right?

Extends ​

Extended by ​

Type Parameters ​

Type Parameter
Bot extends BotLike

Constructors ​

Constructor ​

new ChatSenderControlMixin<Bot>(): ChatSenderControlMixin<Bot>

Returns ​

ChatSenderControlMixin<Bot>

Inherited from ​

Context.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
botpublicBotContext.botcontexts/index.d.ts:5240
payloadpublicRecord<string, any>TargetMixin.payloadcontexts/index.d.ts:5254
update?publicTelegramUpdateContext.updatecontexts/index.d.ts:5242
updateId?publicnumberContext.updateIdcontexts/index.d.ts:5241
updateTypeprotectedUpdateNameContext.updateTypecontexts/index.d.ts:5243

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:5246

MDN

Returns ​

string

Inherited from ​

Context.[toStringTag]


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

Inherited from ​

TargetMixin.businessConnectionId


chat ​

Get Signature ​

get chat(): Chat

Defined in: contexts/index.d.ts:5273

Conversation the message belongs to

Returns ​

Chat

Inherited from ​

TargetMixin.chat


chatId ​

Get Signature ​

get chatId(): number

Defined in: contexts/index.d.ts:5277

Chat ID

Returns ​

number

Inherited from ​

TargetMixin.chatId


chatType ​

Get Signature ​

get chatType(): TelegramChatType

Defined in: contexts/index.d.ts:5281

Chat type

Returns ​

TelegramChatType

Inherited from ​

TargetMixin.chatType


from ​

Get Signature ​

get from(): User

Defined in: contexts/index.d.ts:5258

Sender, empty for messages sent to channels

Returns ​

User

Inherited from ​

TargetMixin.from


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

Inherited from ​

TargetMixin.senderBoostCount


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 ​

Chat

Inherited from ​

TargetMixin.senderChat


senderId ​

Get Signature ​

get senderId(): number

Defined in: contexts/index.d.ts:5275

Sender's ID

Returns ​

number

Inherited from ​

TargetMixin.senderId

Methods ​

banChatSender() ​

banChatSender(senderChatId, params?): Promise<true>

Defined in: contexts/index.d.ts:5810

Bans a channel chat

Parameters ​

ParameterType
senderChatIdnumber
params?Optional<BanChatSenderChatParams, "chat_id" | "sender_chat_id">

Returns ​

Promise<true>


hasFrom() ​

hasFrom(): this is Require<ChatSenderControlMixin<Bot>, "from" | "senderId">

Defined in: contexts/index.d.ts:5256

Checks if the instance has from and senderId properties

Returns ​

this is Require<ChatSenderControlMixin<Bot>, "from" | "senderId">

Inherited from ​

TargetMixin.hasFrom


hasSenderChat() ​

hasSenderChat(): this is Require<ChatSenderControlMixin<Bot>, "senderChat">

Defined in: contexts/index.d.ts:5260

Checks if the instance has senderChat property

Returns ​

this is Require<ChatSenderControlMixin<Bot>, "senderChat">

Inherited from ​

TargetMixin.hasSenderChat


is() ​

is<T>(rawTypes): this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

Defined in: contexts/index.d.ts:5249

Type Parameters ​

Type Parameter
T extends UpdateName

Parameters ​

ParameterType
rawTypesMaybeArray<SoftString<T>>

Returns ​

this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

Inherited from ​

Context.is


isChannel() ​

isChannel(): this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Channel>

Defined in: contexts/index.d.ts:5289

Is this chat a channel?

Returns ​

this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Channel>

Inherited from ​

TargetMixin.isChannel


isGroup() ​

isGroup(): this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Group>

Defined in: contexts/index.d.ts:5285

Is this chat a group?

Returns ​

this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Group>

Inherited from ​

TargetMixin.isGroup


isPM() ​

isPM(): this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Private>

Defined in: contexts/index.d.ts:5283

Is this chat a private one?

Returns ​

this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Private>

Inherited from ​

TargetMixin.isPM


isSupergroup() ​

isSupergroup(): this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Supergroup>

Defined in: contexts/index.d.ts:5287

Is this chat a supergroup?

Returns ​

this is RequireValue<ChatSenderControlMixin<Bot>, "chatType", Supergroup>

Inherited from ​

TargetMixin.isSupergroup


unbanChatSender() ​

unbanChatSender(senderChatId, params?): Promise<true>

Defined in: contexts/index.d.ts:5812

Unbans a channel chat

Parameters ​

ParameterType
senderChatIdnumber
params?Optional<UnbanChatSenderChatParams, "chat_id" | "sender_chat_id">

Returns ​

Promise<true>