Перейти к содержанию

Types⚓︎

You can import all types at once:

from trueconf.types import *

trueconf.types.AddedChatParticipant dataclass ⚓︎

AddedChatParticipant(timestamp, chat_id, user_id, added_by)

Bases: BoundToBot, DataClassDictMixin

Event type: a new participant was added to a chat.

This object is received in the handler when a user is added to a personal chat, group chat, channel, or conference chat.

Notes

This class is used as the event type in handler functions decorated with @<router>.added_chat_participant().

Source

trueconf.com/docs/chatbot-connector/en/chats/#addedChatParticipant

Attributes:

Name Type Description
timestamp int

Unix timestamp (milliseconds) of when the event occurred.

chat_id str

Unique identifier of the chat where the participant was added.

user_id str

TrueConf ID of the participant who was added.

added_by EnvelopeAuthor

Information about the user who added the participant.

Examples:

from trueconf.types import AddedChatParticipant

@<router>.added_chat_participant()
async def on_added(event: AddedChatParticipant):
    print(event.user_id)

added_by class-attribute instance-attribute ⚓︎

added_by = field(metadata={'alias': 'addedBy'})

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

timestamp instance-attribute ⚓︎

timestamp

user_id class-attribute instance-attribute ⚓︎

user_id = field(metadata={'alias': 'userId'})

trueconf.types.ChangedParticipantRole dataclass ⚓︎

ChangedParticipantRole(timestamp, role, chat_id, user_id)

Bases: BoundToBot, DataClassDictMixin

Event type: a participant's role was changed in a chat.

This object is received in the handler when a participant's role is changed in a personal chat, group chat, channel, or conference chat.

Notes

This class is used as the event type in handler functions decorated with @<router>.changed_chat_participant_role().

Source

trueconf.com/docs/chatbot-connector/en/chats/#changedParticipantRole

Attributes:

Name Type Description
timestamp int

Unix timestamp (in milliseconds) when the role change occurred.

role str

New role assigned to the participant.

chat_id str

Identifier of the chat where the role change occurred.

user_id str

TrueConf ID of the participant whose role was changed.

Example
from trueconf.types import ChangedParticipantRole

@router.changed_chat_participant_role()
async def on_role_changed(event: ChangedParticipantRole):
    print(f"User {event.user_id} now has role {event.role} in chat {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

role instance-attribute ⚓︎

role

timestamp instance-attribute ⚓︎

timestamp

user_id class-attribute instance-attribute ⚓︎

user_id = field(metadata={'alias': 'userId'})

trueconf.types.CreatedChannel dataclass ⚓︎

CreatedChannel(chat_id, title, chat_type, last_message, unread_messages)

Bases: BoundToBot, DataClassDictMixin

Event type: a new channel chat was created.

This object is received in the handler when a channel is created in TrueConf.

Notes

This class is used as the event type in handler functions decorated with @<router>.created_channel().

Source

trueconf.com/docs/chatbot-connector/en/chats/#createdChannel

Attributes:

Name Type Description
chat_id str

Unique identifier of the created channel.

title str

Title of the channel.

chat_type ChatType

Type of the chat (should be channel).

last_message LastMessage | None

The last message in the channel, if available.

unread_messages int

Number of unread messages in the channel.

Examples:

from trueconf.types import CreatedChannel

@<router>.created_channel()
async def on_created(event: CreatedChannel):
    print(f"Channel {event.title} created with id {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

chat_type class-attribute instance-attribute ⚓︎

chat_type = field(metadata={'alias': 'chatType'})

last_message class-attribute instance-attribute ⚓︎

last_message = field(metadata={'alias': 'lastMessage'})

title instance-attribute ⚓︎

title

unread_messages class-attribute instance-attribute ⚓︎

unread_messages = field(metadata={'alias': 'unreadMessages'})

trueconf.types.CreatedGroupChat dataclass ⚓︎

CreatedGroupChat(chat_id, title, chat_type, last_message, unread_messages)

Bases: BoundToBot, DataClassDictMixin

Event type: a new group chat was created.

This object is received in the handler when a group chat is created in TrueConf.

Notes

This class is used as the event type in handler functions decorated with @<router>.created_group_chat().

Source

trueconf.com/docs/chatbot-connector/en/chats/#createdGroupChat

Attributes:

Name Type Description
chat_id str

Unique identifier of the group chat.

title str

Title of the group chat.

chat_type ChatType

Type of the chat (should be group).

last_message LastMessage | None

The last message in the chat, if available.

unread_messages int

Number of unread messages in the group chat.

Examples:

from trueconf.types import CreatedGroupChat

@<router>.created_group_chat()
async def on_created(event: CreatedGroupChat):
    print(f"Group chat {event.title} created with id {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

chat_type class-attribute instance-attribute ⚓︎

chat_type = field(metadata={'alias': 'chatType'})

last_message class-attribute instance-attribute ⚓︎

last_message = field(metadata={'alias': 'lastMessage'})

title instance-attribute ⚓︎

title

unread_messages class-attribute instance-attribute ⚓︎

unread_messages = field(metadata={'alias': 'unreadMessages'})

trueconf.types.CreatedPersonalChat dataclass ⚓︎

CreatedPersonalChat(chat_id, title, chat_type, last_message, unread_messages)

Bases: BoundToBot, DataClassDictMixin

Event type: a new personal chat was created.

This object is received in the handler when a personal chat is created in TrueConf.

Notes

This class is used as the event type in handler functions decorated with @<router>.created_personal_chat().

Source

trueconf.com/docs/chatbot-connector/en/chats/#createdP2PChat

Attributes:

Name Type Description
chat_id str

Unique identifier of the personal chat.

title str

Title of the chat (usually the participant’s name).

chat_type ChatType

Type of the chat (should be p2p).

last_message LastMessage | None

The last message in the chat, if available.

unread_messages int

Number of unread messages in the personal chat.

Examples:

from trueconf.types import CreatedPersonalChat

@<router>.created_personal_chat()
async def on_created(event: CreatedPersonalChat):
    print(f"Personal chat created with id {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

chat_type class-attribute instance-attribute ⚓︎

chat_type = field(metadata={'alias': 'chatType'})

last_message class-attribute instance-attribute ⚓︎

last_message = field(metadata={'alias': 'lastMessage'})

title instance-attribute ⚓︎

title

unread_messages class-attribute instance-attribute ⚓︎

unread_messages = field(metadata={'alias': 'unreadMessages'})

trueconf.types.EditedMessage dataclass ⚓︎

EditedMessage(timestamp, content, chat_id)

Bases: BoundToBot, DataClassDictMixin

Event type: a message was edited.

This object is received in the handler when a previously sent message is edited in a chat.

Notes

This class is used as the event type in handler functions decorated with @<router>.edited_message().

Source

trueconf.com/docs/chatbot-connector/en/messages/#editMessage

Attributes:

Name Type Description
timestamp int

Unix timestamp (milliseconds) of when the edit occurred.

content TextContent

The updated content of the edited message.

chat_id str

Unique identifier of the chat where the message was edited.

Examples:

from trueconf.types import EditedMessage

@<router>.edited_message()
async def on_edited(event: EditedMessage):
    print(f"Message in chat {event.chat_id} was edited: {event.content.text}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

content instance-attribute ⚓︎

content

timestamp instance-attribute ⚓︎

timestamp

trueconf.types.InputFile ⚓︎

InputFile(filename=None, file_size=None, mimetype=None)

Bases: ABC

Base abstract class representing uploadable files.

This class defines a common interface for all file types that can be uploaded to the TrueConf Server. It should not be used directly. Instead, use one of its subclasses:

  • BufferedInputFile — for in-memory byte data
  • FSInputFile — for files from the local filesystem
  • URLInputFile — for downloading files from a URL

Each subclass implements the read() and clone() methods required for asynchronous uploads and reusability of the same file object.

Source

trueconf.com/docs/chatbot-connector/en/files/#upload-file-to-server-storage

Parameters:

Name Type Description Default
filename str | None

Name of the file to display when sending.

None
file_size int | None

File size in bytes (optional).

None
mimetype str | None

MIME type of the file. Can be detected automatically.

None
Abstract Methods

read(): Asynchronously reads the file content. clone(): Creates a new copy of the file object. Useful for reuse (e.g., preview uploads).

Example
file = FSInputFile("example.pdf")
await bot.send_document(chat_id="...", file=file)

file_size instance-attribute ⚓︎

file_size = file_size

filename instance-attribute ⚓︎

filename = filename

mimetype instance-attribute ⚓︎

mimetype = mimetype

clone abstractmethod ⚓︎

clone()

read abstractmethod async ⚓︎

read()

trueconf.types.BufferedInputFile ⚓︎

BufferedInputFile(file, filename, file_size=None, mimetype=None)

Bases: InputFile

Represents a file uploaded from a bytes buffer.

This class is useful when the file is already available as a bytes object, for example, if it was retrieved from a database, memory, or downloaded from an external source. Automatically detects MIME type and file size if not provided.

Example
file = BufferedInputFile(file=data_bytes, filename="example.txt")
await bot.send_document(chat_id="...", file=file)
Note

Use BufferedInputFile.from_file(...) for convenient file loading from disk.

Initializes a file from a bytes buffer.

Parameters:

Name Type Description Default
file bytes

Raw file content in bytes.

required
filename str

The name of the file.

required
file_size Optional[int]

Size of the file in bytes. Auto-detected if not specified.

None
mimetype Optional[str]

MIME type of the file. Auto-detected if not specified.

None

data instance-attribute ⚓︎

data = file

file_size instance-attribute ⚓︎

file_size = file_size

filename instance-attribute ⚓︎

filename = filename

mimetype instance-attribute ⚓︎

mimetype = mimetype

clone ⚓︎

clone()

Creates a clone of the current file object.

This method is useful when the same file needs to be reused (e.g., as a preview), while keeping the original instance intact.

Returns:

Name Type Description
BufferedInputFile BufferedInputFile

A new instance with identical content.

from_file classmethod ⚓︎

from_file(path, filename=None, file_size=None, mimetype=None)

Creates a BufferedInputFile from a file on disk.

This is a convenient way to load a file into memory if it needs to be reused or processed before sending.

Parameters:

Name Type Description Default
path str | Path

Path to the local file.

required
filename Optional[str]

File name to propagate. Defaults to the name extracted from path.

None
file_size Optional[int]

File size in bytes. Auto-detected if not specified.

None
mimetype Optional[str]

MIME type of the file. Auto-detected if not specified.

None

Returns:

Name Type Description
BufferedInputFile BufferedInputFile

A new instance ready for upload.

read async ⚓︎

read()

Asynchronously returns the file content as a BytesIO stream.

Returns:

Name Type Description
BytesIO

A stream containing the file content.

trueconf.types.FSInputFile ⚓︎

FSInputFile(path, filename=None, file_size=None, mimetype=None)

Bases: InputFile

Represents a file uploaded from the local filesystem.

Used for uploading documents, images, or any other files directly from disk. Automatically detects the file name, size, and MIME type when not explicitly provided.

Example
file = FSInputFile("path/to/file.zip")
await bot.send_document(chat_id="...", file=file)

Initializes an FSInputFile instance from a local file.

If not provided, filename, file_size, and mimetype are automatically detected:

  • filename is extracted from the file path.
  • file_size is determined via os.path.getsize().
  • mimetype is detected from the first 2048 bytes of the file content (using python-magic if available).

Parameters:

Name Type Description Default
path str | Path

Path to the local file.

required
filename Optional[str]

File name to be propagated in the upload.

None
file_size Optional[int]

File size in bytes.

None
mimetype Optional[str]

File MIME type.

None

file_size instance-attribute ⚓︎

file_size = file_size

filename instance-attribute ⚓︎

filename = filename

mimetype instance-attribute ⚓︎

mimetype = mimetype

path instance-attribute ⚓︎

path = path

clone ⚓︎

clone()

Creates a clone of the current FSInputFile instance.

Useful when the same file needs to be reused, for example, when sending preview images. The cloned object retains the same path, name, size, and MIME type but is a separate instance in memory.

Returns:

Name Type Description
FSInputFile FSInputFile

A new instance of FSInputFile with identical properties.

read async ⚓︎

read()

Asynchronously reads the file content from the local filesystem.

Returns:

Name Type Description
bytes

The file content as raw bytes.

trueconf.types.URLInputFile ⚓︎

URLInputFile(url, headers=None, filename=None, file_size=None, mimetype=None, timeout=30)

Bases: InputFile

Represents a file to be downloaded and uploaded from a remote URL.

Used for uploading files from external sources (e.g., public file links, APIs). Automatically handles MIME type detection and file size parsing from HTTP headers.

Example
file = URLInputFile("https://example.com/file.pdf")
await bot.send_document(chat_id="...", file=file)

Initializes a URLInputFile instance from a remote URL.

Parameters:

Name Type Description Default
url str

URL of the file to download.

required
headers Optional[Dict[str, Any]]

Optional HTTP headers for the request.

None
filename Optional[str]

Optional file name to propagate in the upload.

None
file_size Optional[int]

Optional file size in bytes.

None
mimetype Optional[str]

Optional MIME type of the file.

None
timeout int

Timeout (in seconds) for the HTTP request.

30

file_size instance-attribute ⚓︎

file_size = file_size

filename instance-attribute ⚓︎

filename = filename

headers instance-attribute ⚓︎

headers = headers

mimetype instance-attribute ⚓︎

mimetype = mimetype

timeout instance-attribute ⚓︎

timeout = timeout

url instance-attribute ⚓︎

url = url

clone ⚓︎

clone()

Creates a clone of the current URLInputFile instance.

Useful when the same file needs to be reused (e.g., sending a preview). The cloned object retains the same URL, headers, and metadata.

Returns:

Name Type Description
URLInputFile URLInputFile

A new instance with identical parameters.

prepare async ⚓︎

prepare()

Prepares file metadata by sending a HEAD request to the specified URL.

This method attempts to detect:

  • MIME type from the Content-Type header.
  • File size from the Content-Length header.
  • File name from the Content-Disposition header or URL path.

Raises:

Type Description
ValueError

If the server does not provide a valid Content-Length.

read async ⚓︎

read()

Downloads the file content from the remote URL.

Performs a full GET request and returns the content as raw bytes.

Returns:

Name Type Description
bytes

File content.

trueconf.types.Message dataclass ⚓︎

Message(timestamp, type, author, box, content, message_id, chat_id, is_edited, reply_message_id=None)

Bases: BoundToBot, DataClassDictMixin

Represents a single chat message within TrueConf Chatbot Connector.

The Message object is automatically created for each incoming update and contains metadata (author, chat, timestamp, type) along with the actual message content. It also provides helper properties and shortcut methods to interact with the message (e.g., replying, forwarding, deleting, sending media files).

Source

trueconf.com/docs/chatbot-connector/en/messages/#sendMessage

Attributes:

Name Type Description
timestamp int

Unix timestamp of the message.

type MessageType

Type of the message (e.g., TEXT, ATTACHMENT).

author EnvelopeAuthor

Information about the user who sent the message.

box EnvelopeBox

Information about the chat (box) where the message was sent.

message_id str

Unique identifier of the message.

chat_id str

Unique identifier of the chat where the message was sent.

is_edited bool

Indicates whether the message was edited.

reply_message_id Optional[str]

Identifier of the message this one replies to.

from_user EnvelopeAuthor

Shortcut for accessing the message author.

content_type MessageType

Returns the type of the message.

text Optional[str]

Returns the message text if it contains text, else None.

document Optional[Document]

Returns a document attachment if the message contains a non-media file (not photo, video, sticker).

photo Optional[Photo]

Returns a photo attachment if available.

video Optional[Video]

Returns a video attachment if available.

sticker Optional[Sticker]

Returns a sticker attachment if available.

Methods:

Name Description
answer

Sends a text message in the same chat.

reply

Sends a reply message referencing the current one.

forward

Forwards the current message to another chat.

copy_to

Sends a copy of the current message (text-only).

answer_photo

Sends a photo to the current chat.

answer_document

Sends a document to the current chat.

answer_sticker

Sends a sticker to the current chat.

delete

Deletes the current message from the chat.

author instance-attribute ⚓︎

author

box instance-attribute ⚓︎

box

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

content instance-attribute ⚓︎

content

content_type property ⚓︎

content_type

Returns the type of the current message content.

Returns:

Name Type Description
MessageType MessageType

Message content type (e.g., TEXT, ATTACHMENT).

document property ⚓︎

document

Returns the attached document if the message contains a non-media file.

Use this property only for documents that are not photos, videos, or stickers. For media attachments, use the corresponding properties: photo, video, or sticker. If you need to handle any attached file (including media), use message.content directly.

Returns:

Type Description
Optional['Document']

Optional[Document]: Document attachment bound to the bot, or None if not applicable.

from_user property ⚓︎

from_user

Returns the author of the current message.

Returns:

Name Type Description
EnvelopeAuthor EnvelopeAuthor

Shortcut for accessing the message author.

is_edited class-attribute instance-attribute ⚓︎

is_edited = field(metadata={'alias': 'isEdited'})

message_id class-attribute instance-attribute ⚓︎

message_id = field(metadata={'alias': 'messageId'})

photo property ⚓︎

photo

Returns the attached photo object if the current message contains an image.

This is a shortcut for accessing photo metadata from image attachments.

Returns:

Type Description
Optional['Photo']

Optional[Photo]: A Photo object bound to the bot, or None if the message does not contain an image.

reply_message_id class-attribute instance-attribute ⚓︎

reply_message_id = field(default=None, metadata={'alias': 'replyMessageId'})

sticker property ⚓︎

sticker

Returns the attached sticker object if the current message contains a sticker.

Returns:

Type Description
Optional['Sticker']

Optional[Sticker]: A Sticker object bound to the bot, or None if the message does not contain a sticker.

text property ⚓︎

text

Returns the text of the current message if present.

Returns:

Type Description
str | None

Optional[str]: Message text, or None if the message has no text content.

timestamp instance-attribute ⚓︎

timestamp

type instance-attribute ⚓︎

type

video property ⚓︎

video

Returns the attached video object if the current message contains a video.

This is a shortcut for accessing video metadata from video attachments.

Returns:

Type Description
Optional['Video']

Optional[Video]: A Video object bound to the bot, or None if the message does not contain a video.

answer async ⚓︎

answer(text, parse_mode=HTML)

Shortcut for the send_message method of the bot instance. Use this method to send a text message to the current chat.

Automatically fills the following attributes
  • chat_id
Source

trueconf.com/docs/chatbot-connector/en/messages/#sendMessage

Parameters:

Name Type Description Default
text str

Text of the message to be sent.

required
parse_mode ParseMode | str

Text formatting mode. Defaults to HTML.

HTML

Returns:

Name Type Description
SendMessageResponse object

Object containing the result of the message delivery.

Examples:

>>> @<router>.message()
>>> async def on_message(message:Message):
>>>     await message.answer("Hi, there!")
>>> @<router>.message()
>>> async def on_message(message:Message):
>>>     await message.answer("Hi, **there!**", parse_mode=ParseMode.MARKDOWN)

answer_document async ⚓︎

answer_document(file_path)

Shortcut for the send_document method of the bot instance. Use this method to send a document in response to the current message.

Automatically fills the following attributes
  • chat_id
Source

trueconf.com/docs/chatbot-connector/en/files/#working-with-files

Parameters:

Name Type Description Default
file_path str

Path to the document file.

required

Returns:

Name Type Description
SendFileResponse object

Object containing the result of the document upload.

Examples:

>>> @<router>.message()
>>> async def on_message(message:Message):
>>>     await message.answer_sticker(file_path='/path/to/file.webp')

answer_photo async ⚓︎

answer_photo(file_path, preview_path)

Shortcut for the send_photo method of the bot instance. Use this method to send a photo in response to the current message.

Automatically fills the following attributes
  • chat_id
Source

trueconf.com/docs/chatbot-connector/en/files/#sending-an-image

Parameters:

Name Type Description Default
file_path str

Path to the image file (supported formats: .jpg, .jpeg, .png, .webp, .bmp, .gif, .tiff).

required
preview_path str | None

Path to the preview image.

required

Returns:

Name Type Description
SendFileResponse object

Object containing the result of the photo upload.

Examples:

>>> @<router>.message()
>>> async def on_message(message:Message):
>>>     await message.answer_photo(file_path='/path/to/file.jpg', preview_path='/path/to/preview.jpg')

answer_sticker async ⚓︎

answer_sticker(file_path)

Shortcut for the send_sticker method of the bot instance. Use this method to send a sticker in response to the current message.

Automatically fills the following attributes
  • chat_id
Source

trueconf.com/docs/chatbot-connector/en/files/#upload-file-to-server-storage

Parameters:

Name Type Description Default
file_path str

Path to the sticker file (must be in WebP format).

required

Returns:

Name Type Description
SendFileResponse object

Object containing the result of the sticker delivery.

Examples:

>>> @<router>.message()
>>> async def on_message(message:Message):
>>>     await message.answer_sticker(file_path='/path/to/file.webp')

copy_to async ⚓︎

copy_to(chat_id)

Shortcut for the send_message method of the bot instance. Use this method to send a copy of the current message (without metadata or reply context) to another chat.

Automatically fills the following attributes
  • text
  • parse_mode
Source

trueconf.com/docs/chatbot-connector/en/messages/#sendMessage

Parameters:

Name Type Description Default
chat_id str

Identifier of the target chat to send the copied message to.

required

Returns:

Name Type Description
SendMessageResponse object

Object containing the result of the message delivery.

delete async ⚓︎

delete(for_all=False)

Shortcut for the remove_message method of the bot instance. Use this method to delete the current message from the chat.

Automatically fills the following attributes
  • message_id
Source

trueconf.com/docs/chatbot-connector/en/messages/#removeMessage

Parameters:

Name Type Description Default
for_all bool

If True, delete the message for all participants. Defaults to False (deletes only for the bot).

False

Returns:

Name Type Description
RemoveMessageResponse object

Object containing the result of the message deletion.

forward async ⚓︎

forward(chat_id)

Shortcut for the forward_message method of the bot instance. Use this method to forward the current message to another chat.

Automatically fills the following attributes
  • message_id
Source

trueconf.com/docs/chatbot-connector/en/messages/#forwardMessage

Parameters:

Name Type Description Default
chat_id str

Identifier of the target chat to forward the message to.

required

Returns:

Name Type Description
ForwardMessageResponse object

Object containing the result of the message forwarding.

reply async ⚓︎

reply(text, parse_mode=HTML)

Shortcut for the reply_message method of the bot instance. Use this method to send a reply message to the current chat.

Automatically fills the following attributes
  • chat_id
  • reply_message_id

Source: trueconf.com/docs/chatbot-connector/en/messages/#replyMessage

Parameters:

Name Type Description Default
text str

Text of the reply message.

required
parse_mode ParseMode | str

Text formatting mode. Defaults to HTML.

HTML

Returns:

Name Type Description
SendMessageResponse object

Object containing the result of the message delivery.

save_to_favorites async ⚓︎

save_to_favorites(copy=False)

Saves the current message to the bot's "Favorites" chat.

By default, the message is forwarded to the bot's personal Favorites chat. If copy=True, the message will be copied instead — only for text messages.

Use this method to store important messages, logs, or media content in the bot’s private space.

Notes
  • The Favorites chat is created automatically on first use.
  • copy=True only works for text messages and does not preserve metadata (like replies or sender info).
  • Non-text messages with copy=True will be ignored with a warning.

Parameters:

Name Type Description Default
copy bool

If True, copies the message instead of forwarding it. Defaults to False.

False

Returns:

Type Description
object

SendMessageResponse | ForwardMessageResponse | None:

object

Result of sending or forwarding the message. Returns None if copying is not supported for the message type.

Example
@router.message()
async def on_message(msg: Message):
    await msg.save_to_favorites()           # forwards message
    await msg.save_to_favorites(copy=True)  # copies if possible

trueconf.types.RemovedChat dataclass ⚓︎

RemovedChat(chat_id)

Bases: BoundToBot, DataClassDictMixin

Event type: a chat was removed.

This object is received in the handler when a private, group, channel, or conference chat is deleted.

Notes

This class is used as the event type in handler functions decorated with @<router>.removed_chat().

Source

trueconf.com/docs/chatbot-connector/en/chats/#removedChat

Attributes:

Name Type Description
chat_id str

Unique identifier of the chat that was removed.

Examples:

from trueconf.types import RemovedChat

@<router>.removed_chat()
async def on_removed(event: RemovedChat):
    print(f"Chat removed: {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

trueconf.types.RemovedChatParticipant dataclass ⚓︎

RemovedChatParticipant(timestamp, chat_id, user_id, removed_by)

Bases: BoundToBot, DataClassDictMixin

Event type: a participant was removed from a chat.

This object is received in the handler when a user is removed from a group, channel, or conference chat.

Notes

This class is used as the event type in handler functions decorated with @<router>.removed_chat_participant().

Source

trueconf.com/docs/chatbot-connector/en/chats/#removedChatParticipant

Attributes:

Name Type Description
timestamp int

Unix timestamp (milliseconds) of when the event occurred.

chat_id str

Unique identifier of the chat where the participant was removed.

user_id str

TrueConf ID of the participant who was removed.

removed_by EnvelopeAuthor

Information about the user who removed the participant.

Examples:

from trueconf.types import RemovedChatParticipant

@<router>.removed_chat_participant()
async def on_removed(event: RemovedChatParticipant):
    print(event.user_id)

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

removed_by class-attribute instance-attribute ⚓︎

removed_by = field(metadata={'alias': 'removedBy'})

timestamp instance-attribute ⚓︎

timestamp

user_id class-attribute instance-attribute ⚓︎

user_id = field(metadata={'alias': 'userId'})

trueconf.types.RemovedMessage dataclass ⚓︎

RemovedMessage(chat_id, message_id, removed_by)

Bases: BoundToBot, DataClassDictMixin

Event type: a message was removed.

This object is received in the handler when a message is deleted from a chat.

Notes

This class is used as the event type in handler functions decorated with @<router>.removed_message().

Source

trueconf.com/docs/chatbot-connector/en/messages/#removedMessage

Attributes:

Name Type Description
chat_id str

Unique identifier of the chat from which the message was removed.

message_id str

Unique identifier of the removed message.

removed_by EnvelopeAuthor

Information about the user who removed the message.

Examples:

from trueconf.types import RemovedMessage

@<router>.removed_message()
async def on_removed(event: RemovedMessage):
    print(f"Message {event.message_id} removed from chat {event.chat_id}")

chat_id class-attribute instance-attribute ⚓︎

chat_id = field(metadata={'alias': 'chatId'})

message_id class-attribute instance-attribute ⚓︎

message_id = field(metadata={'alias': 'messageId'})

removed_by class-attribute instance-attribute ⚓︎

removed_by = field(metadata={'alias': 'removedBy'})

trueconf.types.Update dataclass ⚓︎

Update(method, type, id, payload)

Bases: BoundToBot, DataClassDictMixin

id instance-attribute ⚓︎

id

method instance-attribute ⚓︎

method

payload instance-attribute ⚓︎

payload

type instance-attribute ⚓︎

type

trueconf.types.UploadingProgress dataclass ⚓︎

UploadingProgress(file_id, progress)

Bases: BoundToBot, DataClassDictMixin

Event type: file upload progress.

This object is received in the handler when a file is being uploaded and the upload progress is updated.

Notes

This class is used as the event type in handler functions decorated with @<router>.uploading_progress().

Source

trueconf.com/docs/chatbot-connector/en/files/#uploadingProgress

Attributes:

Name Type Description
file_id str

Unique identifier of the file being uploaded.

progress int

Number of bytes uploaded to the server.

Examples:

from trueconf.types import UploadingProgress

@<router>.uploading_progress()
async def on_progress(event: UploadingProgress):
    print(f"File {event.file_id}: uploaded {event.progress} bytes")

file_id class-attribute instance-attribute ⚓︎

file_id = field(metadata={'alias': 'fileId'})

progress instance-attribute ⚓︎

progress