telega/api
This module provides an interface for interacting with the Telegram Bot API.
It will be useful if you want to interact with the Telegram Bot API directly, without running a bot.
But it will be more convenient to use the reply
module in bot handlers.
Functions
pub fn answer_callback_query(
client client: TelegramClient,
parameters parameters: AnswerCallbackQueryParameters,
) -> Result(Bool, TelegaError)
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Official reference: https://core.telegram.org/bots/api#answercallbackquery
pub fn approve_chat_join_request(
client client: TelegramClient,
parameters parameters: ApproveChatJoinRequestParameters,
) -> Result(Response(String), TelegaError)
Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users
administrator right. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#approvechatjoinrequest
pub fn ban_chat_member(
client client: TelegramClient,
parameters parameters: BanChatMemberParameters,
) -> Result(Bool, TelegaError)
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
Official reference: https://core.telegram.org/bots/api#banchatmember
pub fn ban_chat_sender_chat(
client client: TelegramClient,
parameters parameters: BanChatSenderChatParameters,
) -> Result(Bool, TelegaError)
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#banchatsenderchat
pub fn close(
client client: TelegramClient,
) -> Result(Bool, TelegaError)
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn’t launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched.
Official reference: https://core.telegram.org/bots/api#close
pub fn copy_message(
client client: TelegramClient,
parameters parameters: CopyMessageParameters,
) -> Result(Message, TelegaError)
Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can’t be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn’t have a link to the original message. Returns the MessageId of the sent message on success.
Official reference: https://core.telegram.org/bots/api#copymessage
pub fn copy_messages(
client client: TelegramClient,
parameters parameters: CopyMessagesParameters,
) -> Result(Message, TelegaError)
Use this method to copy messages of any kind. If some of the specified messages can’t be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can’t be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn’t have a link to the original message. Returns the MessageId of the sent message on success.
Official reference: https://core.telegram.org/bots/api#copymessages
pub fn create_chat_invite_link(
client client: TelegramClient,
parameters parameters: CreateChatInviteLinkParameters,
) -> Result(ChatInviteLink, TelegaError)
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
Official reference: https://core.telegram.org/bots/api#createchatinvitelink
pub fn create_chat_subscription_invite_link(
client client: TelegramClient,
parameters parameters: CreateChatSubscriptionInviteLinkParameters,
) -> Result(ChatInviteLink, TelegaError)
Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users
administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
Official reference: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
pub fn create_invoice_link(
client client: TelegramClient,
parameters parameters: CreateInvoiceLinkParameters,
) -> Result(String, TelegaError)
Use this method to create a link for an invoice.
Official reference: https://core.telegram.org/bots/api#createinvoicelink
pub fn decline_chat_join_request(
client client: TelegramClient,
parameters parameters: DeclineChatJoinRequestParameters,
) -> Result(Bool, TelegaError)
Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users
administrator right. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#declinechatjoinrequest
pub fn delete_chat_photo(
client client: TelegramClient,
parameters parameters: DeleteChatPhotoParameters,
) -> Result(Bool, TelegaError)
Use this method to delete a chat photo. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#deletechatphoto
pub fn delete_message(
client client: TelegramClient,
parameters parameters: DeleteMessageParameters,
) -> Result(Bool, TelegaError)
Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- Service messages about a supergroup, channel, or forum topic creation can’t be deleted.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. Returns True on success.
Official reference: https://core.telegram.org/bots/api#deletemessage
pub fn delete_messages(
client client: TelegramClient,
parameters parameters: DeleteMessagesParameters,
) -> Result(Bool, TelegaError)
Use this method to delete multiple messages simultaneously. If some of the specified messages can’t be found, they are skipped. Returns True on success.
Official reference: https://core.telegram.org/bots/api#deletemessagessimultaneously
pub fn delete_my_commands(
client client: TelegramClient,
parameters parameters: Option(BotCommandParameters),
) -> Result(Bool, TelegaError)
Use this method to delete the list of the bot’s commands for the given scope and user language. After deletion, higher level commands will be shown to affected users.
Official reference: https://core.telegram.org/bots/api#deletemycommands
pub fn delete_webhook(
client client: TelegramClient,
) -> Result(Bool, TelegaError)
Use this method to remove webhook integration if you decide to switch back to getUpdates.
Official reference: https://core.telegram.org/bots/api#deletewebhook
pub fn delete_webhook_and_drop_updates(
client client: TelegramClient,
) -> Result(Bool, TelegaError)
The same as delete_webhook but also drops all pending updates.
pub fn edit_chat_invite_link(
client client: TelegramClient,
parameters parameters: EditChatInviteLinkParameters,
) -> Result(ChatInviteLink, TelegaError)
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
Official reference: https://core.telegram.org/bots/api#editchatinvitelink
pub fn edit_chat_subscription_invite_link(
client client: TelegramClient,
parameters parameters: EditChatSubscriptionInviteLinkParameters,
) -> Result(ChatInviteLink, TelegaError)
Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
Official reference: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
pub fn edit_message_caption(
client client: TelegramClient,
parameters parameters: EditMessageCaptionParameters,
) -> Result(Message, TelegaError)
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
Official reference: https://core.telegram.org/bots/api#editmessagecaption
pub fn edit_message_live_location(
client client: TelegramClient,
parameters parameters: EditMessageLiveLocationParameters,
) -> Result(Message, TelegaError)
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
Official reference: https://core.telegram.org/bots/api#editmessagelivelocation
pub fn edit_message_media(
client client: TelegramClient,
parameters parameters: EditMessageMediaParameters,
) -> Result(Message, TelegaError)
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can’t be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
Official reference: https://core.telegram.org/bots/api#editmessagemedia
pub fn edit_message_reply_markup(
client client: TelegramClient,
parameters parameters: EditMessageReplyMarkupParameters,
) -> Result(Message, TelegaError)
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
Official reference: https://core.telegram.org/bots/api#editmessagereplymarkup
pub fn edit_message_text(
client client: TelegramClient,
parameters parameters: EditMessageTextParameters,
) -> Result(Message, TelegaError)
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
Official reference: https://core.telegram.org/bots/api#editmessagetext
pub fn export_chat_invite_link(
client client: TelegramClient,
parameters parameters: ExportChatInviteLinkParameters,
) -> Result(String, TelegaError)
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
Note: Each administrator in a chat generates their own invite links. Bots can’t use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.
Official reference: https://core.telegram.org/bots/api#exportchatinvitelink
pub fn forward_message(
client client: TelegramClient,
parameters parameters: ForwardMessageParameters,
) -> Result(Message, TelegaError)
Use this method to forward messages of any kind. Service messages and messages with protected content can’t be forwarded. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#forwardmessage
pub fn forward_messages(
client client: TelegramClient,
parameters parameters: ForwardMessagesParameters,
) -> Result(Message, TelegaError)
Use this method to forward multiple messages of any kind. If some of the specified messages can’t be found or forwarded, they are skipped. Service messages and messages with protected content can’t be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
Official reference: https://core.telegram.org/bots/api#forwardmessages
pub fn get_chat(
client client: TelegramClient,
chat_id chat_id: String,
) -> Result(ChatFullInfo, TelegaError)
Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
Official reference: https://core.telegram.org/bots/api#getchat
pub fn get_file(
client client: TelegramClient,
file_id file_id: String,
) -> Result(File, TelegaError)
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>
, where <file_path>
is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
Official reference: https://core.telegram.org/bots/api#getfile
pub fn get_me(
client client: TelegramClient,
) -> Result(User, TelegaError)
A simple method for testing your bot’s authentication token.
Official reference: https://core.telegram.org/bots/api#getme
pub fn get_my_commands(
client client: TelegramClient,
parameters parameters: Option(BotCommandParameters),
) -> Result(BotCommand, TelegaError)
Use this method to get the current list of the bot’s commands for the given scope and user language.
Official reference: https://core.telegram.org/bots/api#getmycommands
pub fn get_sticker_set(
client client: TelegramClient,
parameters parameters: GetStickerSetParameters,
) -> Result(StickerSet, TelegaError)
Use this method to get a sticker set. On success, a StickerSet object is returned.
Official reference: https://core.telegram.org/bots/api#getstickerset
pub fn get_updates(
client client: TelegramClient,
parameters parameters: Option(GetUpdatesParameters),
) -> Result(List(Update), TelegaError)
Use this method to receive incoming updates using long polling (wiki).
Notes
- This method will not work if an outgoing webhook is set up.
- In order to avoid getting duplicate updates, recalculate offset after each server response.
Official reference: https://core.telegram.org/bots/api#getupdates
pub fn get_user_profile_photos(
client client: TelegramClient,
parameters parameters: GetUserProfilePhotosParameters,
) -> Result(UserProfilePhotos, TelegaError)
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
Official reference: https://core.telegram.org/bots/api#getuserprofilephotos
pub fn get_webhook_info(
client client: TelegramClient,
) -> Result(WebhookInfo, TelegaError)
Use this method to get current webhook status.
Official reference: https://core.telegram.org/bots/api#getwebhookinfo
pub fn log_out(
client client: TelegramClient,
) -> Result(Bool, TelegaError)
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes.
Official reference: https://core.telegram.org/bots/api#logout
pub fn promote_chat_member(
client client: TelegramClient,
parameters parameters: PromoteChatMemberParameters,
) -> Result(Bool, TelegaError)
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False
for all boolean parameters to demote a user. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#promotechatmember
pub fn restrict_chat_member(
client client: TelegramClient,
parameters parameters: RestrictChatMemberParameters,
) -> Result(Bool, TelegaError)
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True
for all permissions to lift restrictions from a user. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#restrictchatmember
pub fn revoke_chat_invite_link(
client client: TelegramClient,
parameters parameters: RevokeChatInviteLinkParameters,
) -> Result(ChatInviteLink, TelegaError)
Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
Official reference: https://core.telegram.org/bots/api#revokechatinvitelink
pub fn send_animation(
client client: TelegramClient,
parameters parameters: SendAnimationParameters,
) -> Result(Message, TelegaError)
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
Official reference: https://core.telegram.org/bots/api#sendanimation
pub fn send_audio(
client client: TelegramClient,
parameters parameters: SendAudioParameters,
) -> Result(Response(String), TelegaError)
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
Official reference: https://core.telegram.org/bots/api#sendaudio
pub fn send_chat_action(
client client: TelegramClient,
parameters parameters: SendChatActionParameters,
) -> Result(Message, TelegaError)
Use this method when you need to tell the user that something is happening on the bot’s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Official reference: https://core.telegram.org/bots/api#sendchataction
pub fn send_contact(
client client: TelegramClient,
parameters parameters: SendContactParameters,
) -> Result(Message, TelegaError)
Use this method to send phone contacts. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendcontact
pub fn send_dice(
client client: TelegramClient,
parameters parameters: SendDiceParameters,
) -> Result(Message, TelegaError)
Use this method to send an animated emoji that will display a random value.
Official reference: https://core.telegram.org/bots/api#senddice
pub fn send_document(
client client: TelegramClient,
parameters parameters: SendDocumentParameters,
) -> Result(Message, TelegaError)
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
Official reference: https://core.telegram.org/bots/api#senddocument
pub fn send_invoice(
client client: TelegramClient,
parameters parameters: SendInvoiceParameters,
) -> Result(Message, TelegaError)
Use this method to send invoices. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendinvoice
pub fn send_location(
client client: TelegramClient,
parameters parameters: SendLocationParameters,
) -> Result(Message, TelegaError)
Use this method to send point on the map. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendlocation
pub fn send_media_group(
client client: TelegramClient,
parameters parameters: SendMediaGroupParameters,
) -> Result(Message, TelegaError)
Use this method to send a group of photos, videos, documents or audio files as an album. Documents and audio files can be only grouped in an album with the first item having a filename. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendmediagroup
pub fn send_message(
client client: TelegramClient,
parameters parameters: SendMessageParameters,
) -> Result(Message, TelegaError)
Use this method to send text messages with additional parameters.
Official reference: https://core.telegram.org/bots/api#sendmessage
pub fn send_photo(
client client: TelegramClient,
parameters parameters: SendPhotoParameters,
) -> Result(Message, TelegaError)
Use this method to send photos. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendphoto
pub fn send_poll(
client client: TelegramClient,
parameters parameters: SendPollParameters,
) -> Result(Message, TelegaError)
Use this method to send a native poll. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendpoll
pub fn send_sticker(
client client: TelegramClient,
parameters parameters: SendStickerParameters,
) -> Result(Message, TelegaError)
pub fn send_venue(
client client: TelegramClient,
parameters parameters: SendVenueParameters,
) -> Result(Message, TelegaError)
Use this method to send information about a venue. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendvenue
pub fn send_video(
client client: TelegramClient,
parameters parameters: SendVideoParameters,
) -> Result(Message, TelegaError)
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
Official reference: https://core.telegram.org/bots/api#sendvideo
pub fn send_video_note(
client client: TelegramClient,
parameters parameters: SendVideoNoteParameters,
) -> Result(Message, TelegaError)
Use this method to send video messages. On success, the sent Message is returned.
Official reference: https://core.telegram.org/bots/api#sendvideonote
pub fn send_voice(
client client: TelegramClient,
parameters parameters: SendVoiceParameters,
) -> Result(Message, TelegaError)
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
Official reference: https://core.telegram.org/bots/api#sendvoice
pub fn set_chat_administrator_custom_title(
client client: TelegramClient,
parameters parameters: SetChatAdministratorCustomTitleParameters,
) -> Result(Bool, TelegaError)
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
pub fn set_chat_menu_button(
client client: TelegramClient,
parameters parameters: SetChatMenuButtonParameters,
) -> Result(Bool, TelegaError)
Use this method to change the bot’s menu button in a private chat, or the default menu button. Returns True on success.
Official reference: https://core.telegram.org/bots/api#setchatmenubutton
pub fn set_chat_permissions(
client client: TelegramClient,
parameters parameters: SetChatPermissionsParameters,
) -> Result(Bool, TelegaError)
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members
administrator rights. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#setchatpermissions
pub fn set_chat_photo(
client client: TelegramClient,
parameters parameters: SetChatPhotoParameters,
) -> Result(Bool, TelegaError)
Use this method to set a new profile photo for the chat. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#setchatphoto
pub fn set_message_reaction(
client client: TelegramClient,
parameters parameters: SetMessageReactionParameters,
) -> Result(Bool, TelegaError)
Use this method to change the chosen reactions on a message. Service messages of some types can’t be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can’t use paid reactions. Returns True on success.
Official reference: https://core.telegram.org/bots/api#setmessagereaction
pub fn set_my_commands(
client client: TelegramClient,
commands commands: List(BotCommand),
parameters parameters: Option(BotCommandParameters),
) -> Result(Bool, TelegaError)
Use this method to change the list of the bot’s commands. See commands documentation for more details about bot commands.
Official reference: https://core.telegram.org/bots/api#setmycommands
pub fn set_webhook(
client client: TelegramClient,
parameters parameters: SetWebhookParameters,
) -> Result(Bool, TelegaError)
Set the webhook URL using setWebhook API.
Official reference: https://core.telegram.org/bots/api#setwebhook
pub fn stop_message_live_location(
client client: TelegramClient,
parameters parameters: StopMessageLiveLocationParameters,
) -> Result(Message, TelegaError)
Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
Official reference: https://core.telegram.org/bots/api#stopmessagelivelocation
pub fn stop_poll(
client client: TelegramClient,
parameters parameters: StopPollParameters,
) -> Result(Poll, TelegaError)
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
Official reference: https://core.telegram.org/bots/api#stoppoll
pub fn unban_chat_member(
client client: TelegramClient,
parameters parameters: UnbanChatMemberParameters,
) -> Result(Bool, TelegaError)
Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don’t want this, use the parameter only_if_banned. Returns True on success.
Official reference: https://core.telegram.org/bots/api#unbanchatmember
pub fn unban_chat_sender_chat(
client client: TelegramClient,
parameters parameters: UnbanChatSenderChatParameters,
) -> Result(Bool, TelegaError)
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True
on success.
Official reference: https://core.telegram.org/bots/api#unbanchatsenderchat