Chat

class bale.Chat(chat_id, type, title=None, username=None, first_name=None, last_name=None, pinned_message=None, all_members_are_administrators=None, invite_link=None, bot=None)

Bases: object

This object indicates a chat.

chat_id

Unique identifier for this chat.

Type:

str

type

Type of chat.

Type:

str

title

Title, for channels and group chats.

Type:

Optional[str]

username

Username, for private chats, supergroups and channels if available.

Type:

Optional[str]

first_name

First name of the other party in a private chat.

Type:

Optional[str]

last_name

Last name of the other party in a private chat.

Type:

Optional[str]

pinned_message

Pinned messages in chat. Defaults to None.

Type:

Optional[bale.Message]

Primary invite link, for groups and channel. Returned only in bale.Bot.get_chat().

Type:

Optional[str]

all_members_are_administrators

Does everyone have admin access?. Defaults to True. (for Group)

Type:

bool

async add_user(user)

For the documentation of the arguments, please see bale.Bot.invite_user().

async ban_chat_member(user)

For the documentation of the arguments, please see bale.Bot.ban_chat_member().

async get_chat_administrators()

For the documentation of the arguments, please see bale.Bot.get_chat_administrators().

async get_chat_member(user)

For the documentation of the arguments, please see bale.Bot.get_chat_member().

async get_chat_members_count()

For the documentation of the arguments, please see bale.Bot.get_chat_members_count().

async leave()

For the documentation of the method, please see bale.Bot.leave_chat().

property parsed_type

Represents the parsed type of chat.

Type:

bale.ChatType

async send(text, components=None)

For the documentation of the arguments, please see bale.Bot.send_message().

async send_audio(audio, *, caption=None, components=None)

For the documentation of the arguments, please see bale.Bot.send_audio().

async send_contact(contact)

For the documentation of the arguments, please see bale.Bot.send_contact().

async send_document(document, *, caption=None, components=None)

For the documentation of the arguments, please see bale.Bot.send_document().

async send_invoice(title, description, provider_token, prices, *, payload=None, photo_url=None, need_name=False, need_phone_number=False, need_email=False, need_shipping_address=False, is_flexible=True)

For the documentation of the arguments, please see bale.Bot.send_invoice()

async send_location(location)

For the documentation of the arguments, please see bale.Bot.send_location().

async send_photo(photo, *, caption=None, components=None)

For the documentation of the arguments, please see bale.Bot.send_photo().

async send_video(video, *, caption=None, components=None)

For the documentation of the arguments, please see bale.Bot.send_video().