ptgb
A complete Telegram Bot API client for Dart

Chat Settings & Info

Part of the API Reference.

setChatPhoto

Future<bool> setChatPhoto(Object chatId, InputFile photo) async =>

Sets a new chat photo, uploaded fresh (not reused via file_id).

deleteChatPhoto

Future<bool> deleteChatPhoto(Object chatId) async =>

Deletes the chat’s current photo.

setChatTitle

Future<bool> setChatTitle(Object chatId, String title) async =>

Renames the chat.

setChatDescription

Future<bool> setChatDescription(Object chatId, {String? description}) async =>

Sets or clears the chat’s description.

pinChatMessage

Future<bool> pinChatMessage(
    Object chatId,
    int messageId, {
    String? businessConnectionId,
    bool? disableNotification,
  }) async =>

Pins a message at the top of the chat.

unpinChatMessage

Future<bool> unpinChatMessage(
    Object chatId, {
    String? businessConnectionId,
    int? messageId,
  }) async =>

Unpins a message. If [messageId] is omitted, unpins the most recently pinned message.

unpinAllChatMessages

Future<bool> unpinAllChatMessages(Object chatId) async =>

Unpins every currently pinned message in the chat.

leaveChat

Future<bool> leaveChat(Object chatId) async => _b(await call('leaveChat', {'chat_id': chatId}));

Makes the bot leave the given group, supergroup, or channel.

getChat

Future<Json> getChat(Object chatId) async => _o(await call('getChat', {'chat_id': chatId}));

Fetches up-to-date information about a chat (title, description, permissions, etc).

getChatAdministrators

Future<List<Json>> getChatAdministrators(Object chatId) async =>

Lists every administrator (and the owner) of the chat.

getChatMemberCount

Future<int> getChatMemberCount(Object chatId) async =>

Returns the number of members in the chat.

getChatMember

Future<Json> getChatMember(Object chatId, int userId) async =>

Fetches a specific member’s status and permissions within the chat.

setChatStickerSet

Future<bool> setChatStickerSet(Object chatId, String stickerSetName) async =>

Sets the group’s custom sticker set (supergroups only).

deleteChatStickerSet

Future<bool> deleteChatStickerSet(Object chatId) async =>

Removes the group’s custom sticker set.