class TelegramBot::Bot

Defined in:

telegram_bot/bot.cr
telegram_bot/bot/methods/chat.cr
telegram_bot/bot/methods/files.cr
telegram_bot/bot/methods/games.cr
telegram_bot/bot/methods/gifts_business.cr
telegram_bot/bot/methods/inline.cr
telegram_bot/bot/methods/payments.cr
telegram_bot/bot/methods/profile.cr
telegram_bot/bot/methods/sending.cr
telegram_bot/bot/methods/stickers.cr
telegram_bot/bot/methods/webhooks.cr
telegram_bot/bot/requests.cr
telegram_bot/bot/updates.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, token : String, allowlist : Array(String) | Nil = nil, blocklist : Array(String) | Nil = nil, updates_timeout : Int32 | Nil = nil, allowed_updates : Array(String) | Nil = nil) #

Instance Method Detail

def add_sticker_to_set(user_id : Int, name : String, sticker : InputSticker) #

Adds a sticker to an existing sticker set.

See: https://core.telegram.org/bots/api#addstickertoset


def answer_callback_query(callback_query_id : String, text : String | Nil = nil, show_alert : Bool | Nil = nil, url : String | Nil = nil, cache_time : Int32 | Nil = nil) #

Sends an answer to a callback query.

See: https://core.telegram.org/bots/api#answercallbackquery


def answer_guest_query(guest_query_id : String, result : InlineQueryResult) : SentGuestMessage #

Sends an answer to a guest query.

See: https://core.telegram.org/bots/api#answerguestquery


def answer_inline_query(inline_query_id : String, results : Array(InlineQueryResult), cache_time : Int32 | Nil = nil, is_personal : Bool | Nil = nil, next_offset : String | Nil = nil, button : InlineQueryResultsButton | Nil = nil) : Bool | Nil #

Sends answers to an inline query.

See: https://core.telegram.org/bots/api#answerinlinequery


def answer_pre_checkout_query(pre_checkout_query_id : String, ok : Bool, error_message : String | Nil = nil) : Bool | Nil #

Sends an answer to a pre-checkout query.

See: https://core.telegram.org/bots/api#answerprecheckoutquery


def answer_shipping_query(shipping_query_id : String, ok : Bool, shipping_options : Array(ShippingOption) | Nil = nil, error_message : String | Nil = nil) : Bool | Nil #

Sends an answer to a shipping query.

See: https://core.telegram.org/bots/api#answershippingquery


def answer_web_app_query(web_app_query_id : String, result : InlineQueryResult) : SentWebAppMessage #

Sends an answer to a Web App query.

See: https://core.telegram.org/bots/api#answerwebappquery


def approve_chat_join_request(chat_id : Int | String, user_id : Int) #

def approve_suggested_post(chat_id : Int, message_id : Int32, send_date : Int32 | Time | Nil = nil) : Bool | Nil #

Approves a suggested post in a direct messages chat.

See: https://core.telegram.org/bots/api#approvesuggestedpost


def attach(name : String, file : ::File) : AttachedFile #

Creates a named multipart attachment reference for nested JSON request objects.


def ban_chat_member(chat_id : Int | String, user_id : Int, until_date : Int | Time | Nil = nil, revoke_messages : Bool | Nil = nil) #

Bans a user from a chat.

See: https://core.telegram.org/bots/api#banchatmember


def ban_chat_sender_chat(chat_id : Int | String, sender_chat_id : Int) #

Bans a channel chat in a supergroup or channel.

See: https://core.telegram.org/bots/api#banchatsenderchat


def close : Bool | Nil #

Closes the bot instance before moving it from one local server to another.

See: https://core.telegram.org/bots/api#close


def close_forum_topic(chat_id : Int | String, message_thread_id : Int) #

def close_general_forum_topic(chat_id : Int | String) #

Closes the general forum topic.

See: https://core.telegram.org/bots/api#closegeneralforumtopic


def convert_gift_to_stars(business_connection_id : String, owned_gift_id : String) #

Converts a regular gift owned by a business account to Stars.

See: https://core.telegram.org/bots/api#convertgifttostars


def copy_message(chat_id : Int | String, from_chat_id : Int | String, message_id : Int32, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, video_start_timestamp : Int32 | Nil = nil, show_caption_above_media : Bool | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, message_effect_id : String | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil, reply_parameters : ReplyParameters | Nil = nil) : MessageId | Nil #

Copies a message without a link to the original message.

See: https://core.telegram.org/bots/api#copymessage


def copy_messages(chat_id : Int | String, from_chat_id : Int | String, message_ids : Array(Int32), disable_notification : Bool | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, remove_caption : Bool | Nil = nil, protect_content : Bool | Nil = nil) : Array(MessageId) #

Copies multiple messages without links to the original messages.

See: https://core.telegram.org/bots/api#copymessages


def create_chat_invite_link(chat_id : Int | String, name : String | Nil = nil, expire_date : Int | Time | Nil = nil, member_limit : Int32 | Nil = nil, creates_join_request : Bool | Nil = nil) : ChatInviteLink | Nil #

Creates an additional invite link for a chat.

See: https://core.telegram.org/bots/api#createchatinvitelink


def create_chat_subscription_invite_link(chat_id : Int | String, subscription_period : Int, subscription_price : Int, name : String | Nil = nil) : ChatInviteLink | Nil #

Creates a subscription invite link for a channel chat.

See: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink


def create_forum_topic(chat_id : Int | String, name : String, icon_color : Int32 | Nil = nil, icon_custom_emoji_id : String | Nil = nil) : ForumTopic | Nil #

def create_invoice_link(title : String, description : String, payload : String, currency : String, prices : Array(LabeledPrice), business_connection_id : String | Nil = nil, provider_token : String | Nil = nil, subscription_period : Int32 | Nil = nil, max_tip_amount : Int32 | Nil = nil, suggested_tip_amounts : Array(Int32) | Nil = nil, provider_data : String | Nil = nil, photo_url : String | Nil = nil, photo_size : Int32 | Nil = nil, photo_width : Int32 | Nil = nil, photo_height : Int32 | Nil = nil, need_name : Bool | Nil = nil, need_phone_number : Bool | Nil = nil, need_email : Bool | Nil = nil, need_shipping_address : Bool | Nil = nil, send_phone_number_to_provider : Bool | Nil = nil, send_email_to_provider : Bool | Nil = nil, is_flexible : Bool | Nil = nil) : String #

Creates a link for an invoice.

See: https://core.telegram.org/bots/api#createinvoicelink


def create_new_sticker_set(user_id : Int, name : String, title : String, stickers : Array(InputSticker), sticker_type : String | Nil = nil, needs_repainting : Bool | Nil = nil) #

Creates a new sticker set for a user.

See: https://core.telegram.org/bots/api#createnewstickerset


def decline_chat_join_request(chat_id : Int | String, user_id : Int) #

def decline_suggested_post(chat_id : Int, message_id : Int32, comment : String | Nil = nil) : Bool | Nil #

Declines a suggested post in a direct messages chat.

See: https://core.telegram.org/bots/api#declinesuggestedpost


def delete_all_message_reactions(chat_id : Int | String, user_id : Int | Nil = nil, actor_chat_id : Int | Nil = nil) #

Deletes all reactions from a message.

See: https://core.telegram.org/bots/api#deleteallmessagereactions


def delete_business_messages(business_connection_id : String, message_ids : Array(Int32)) #

Deletes messages on behalf of a business account.

See: https://core.telegram.org/bots/api#deletebusinessmessages


def delete_chat_photo(chat_id : Int | String) #

def delete_chat_sticker_set(chat_id : Int | String) #

Deletes the group sticker set from a supergroup.

See: https://core.telegram.org/bots/api#deletechatstickerset


def delete_forum_topic(chat_id : Int | String, message_thread_id : Int) #

def delete_message(chat_id : Int | String, message_id : Int32) : Bool | Nil #

def delete_message_reaction(chat_id : Int | String, message_id : Int, user_id : Int | Nil = nil, actor_chat_id : Int | Nil = nil) #

Deletes one reaction from a message.

See: https://core.telegram.org/bots/api#deletemessagereaction


def delete_messages(chat_id : Int | String, message_ids : Array(Int32)) : Bool | Nil #

Deletes multiple messages.

See: https://core.telegram.org/bots/api#deletemessages


def delete_my_commands(scope : BotCommandScope | Nil = nil, language_code : String | Nil = nil) #

Deletes the bot's command list.

See: https://core.telegram.org/bots/api#deletemycommands


def delete_sticker_from_set(sticker : String) #

Deletes a sticker from a sticker set.

See: https://core.telegram.org/bots/api#deletestickerfromset


def delete_sticker_set(name : String) #

Deletes a sticker set created by the bot.

See: https://core.telegram.org/bots/api#deletestickerset


def delete_story(business_connection_id : String, story_id : Int) #

Deletes a story posted on behalf of a managed business account.

See: https://core.telegram.org/bots/api#deletestory


def delete_webhook(drop_pending_updates : Bool | Nil = nil) : Bool | Nil #

Removes webhook integration.

See: https://core.telegram.org/bots/api#deletewebhook


def download(file : File) #

Downloads a file returned by Telegram.


def download(file_path : String) #

Downloads a file returned by Telegram.


def download(media) #

Downloads a file returned by Telegram.


def edit_chat_invite_link(chat_id : Int | String, invite_link : String, name : String | Nil = nil, expire_date : Int | Time | Nil = nil, member_limit : Int32 | Nil = nil, creates_join_request : Bool | Nil = nil) : ChatInviteLink | Nil #

Edits a non-primary invite link for a chat.

See: https://core.telegram.org/bots/api#editchatinvitelink


def edit_chat_subscription_invite_link(chat_id : Int | String, invite_link : String, name : String | Nil = nil) : ChatInviteLink | Nil #

Edits a subscription invite link for a channel chat.

See: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink


def edit_forum_topic(chat_id : Int | String, message_thread_id : Int, name : String | Nil = nil, icon_custom_emoji_id : String | Nil = nil) #

def edit_general_forum_topic(chat_id : Int | String, name : String) #

Edits the general forum topic.

See: https://core.telegram.org/bots/api#editgeneralforumtopic


def edit_message_caption(business_connection_id : String | Nil = nil, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Bool | Nil #

def edit_message_checklist(business_connection_id : String, chat_id : Int | String, message_id : Int32, checklist : InputChecklist, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Nil #

Edits checklists on behalf of a connected business account.

See: https://core.telegram.org/bots/api#editmessagechecklist


def edit_message_live_location(latitude : Float, longitude : Float, business_connection_id : String | Nil = nil, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, live_period : Int32 | Time::Span | Nil = nil, horizontal_accuracy : Float | Nil = nil, heading : Int32 | Nil = nil, proximity_alert_radius : Int32 | Nil = nil, reply_markup : ReplyMarkup | Nil = nil) #

def edit_message_media(media : InputMedia, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, business_connection_id : String | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Bool | Nil #

Edits animation, audio, document, live photo, photo, or video messages.

See: https://core.telegram.org/bots/api#editmessagemedia


def edit_message_reply_markup(business_connection_id : String | Nil = nil, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Bool | Nil #

Edits only the reply markup of messages.

See: https://core.telegram.org/bots/api#editmessagereplymarkup


def edit_message_text(business_connection_id : String | Nil = nil, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, text : String | Nil = nil, parse_mode : String | Nil = nil, entities : Array(MessageEntity) | Nil = nil, link_preview_options : LinkPreviewOptions | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Bool | Nil #

Edits text and game messages.

See: https://core.telegram.org/bots/api#editmessagetext


def edit_story(business_connection_id : String, story_id : Int, content : InputStoryContent, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, areas : Array(StoryArea) | Nil = nil) : Story #

Edits a story posted on behalf of a managed business account.

See: https://core.telegram.org/bots/api#editstory


def edit_user_star_subscription(user_id : Int, telegram_payment_charge_id : String, is_canceled : Bool) #

Edits a user's Telegram Star subscription.

See: https://core.telegram.org/bots/api#edituserstarsubscription


def export_chat_invite_link(chat_id : Int | String) #

Exports the primary invite link for a chat.

See: https://core.telegram.org/bots/api#exportchatinvitelink


def forward_message(chat_id : Int | String, from_chat_id : Int | String, message_id : Int32, disable_notification : Bool | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, video_start_timestamp : Int32 | Nil = nil, protect_content : Bool | Nil = nil, message_effect_id : String | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def forward_messages(chat_id : Int | String, from_chat_id : Int | String, message_ids : Array(Int32), disable_notification : Bool | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, protect_content : Bool | Nil = nil) : Array(MessageId) #

Forwards multiple messages.

See: https://core.telegram.org/bots/api#forwardmessages


def get_available_gifts : Gifts #

Returns gifts that can be sent by the bot.

See: https://core.telegram.org/bots/api#getavailablegifts


def get_business_account_gifts(business_connection_id : String, exclude_unsaved : Bool | Nil = nil, exclude_saved : Bool | Nil = nil, exclude_unlimited : Bool | Nil = nil, exclude_limited_upgradable : Bool | Nil = nil, exclude_limited_non_upgradable : Bool | Nil = nil, exclude_from_blockchain : Bool | Nil = nil, exclude_unique : Bool | Nil = nil, sort_by_price : Bool | Nil = nil, offset : String | Nil = nil, limit : Int32 | Nil = nil) : OwnedGifts #

Returns gifts owned by a managed business account.

See: https://core.telegram.org/bots/api#getbusinessaccountgifts


def get_business_account_star_balance(business_connection_id : String) : StarAmount #

Returns the Star balance of a managed business account.

See: https://core.telegram.org/bots/api#getbusinessaccountstarbalance


def get_business_connection(business_connection_id : String) : BusinessConnection #

Returns information about a business connection.

See: https://core.telegram.org/bots/api#getbusinessconnection


def get_chat(chat_id : Int | String) #

Returns information about a chat.

See: https://core.telegram.org/bots/api#getchat


def get_chat_administrators(chat_id : Int | String, return_bots : Bool | Nil = nil) : Array(ChatMember) #

Returns the list of chat administrators.

See: https://core.telegram.org/bots/api#getchatadministrators


def get_chat_gifts(chat_id : Int | String, exclude_unsaved : Bool | Nil = nil, exclude_saved : Bool | Nil = nil, exclude_unlimited : Bool | Nil = nil, exclude_limited_upgradable : Bool | Nil = nil, exclude_limited_non_upgradable : Bool | Nil = nil, exclude_from_blockchain : Bool | Nil = nil, exclude_unique : Bool | Nil = nil, sort_by_price : Bool | Nil = nil, offset : String | Nil = nil, limit : Int32 | Nil = nil) : OwnedGifts #

Returns gifts owned by a chat.

See: https://core.telegram.org/bots/api#getchatgifts


def get_chat_member(chat_id : Int | String, user_id : Int) #

Returns information about a chat member.

See: https://core.telegram.org/bots/api#getchatmember


def get_chat_member_count(chat_id : Int | String) #

Returns the number of members in a chat.

See: https://core.telegram.org/bots/api#getchatmembercount


def get_chat_menu_button(chat_id : Int | Nil = nil) : MenuButton #

Returns the bot's menu button in a private chat or globally.

See: https://core.telegram.org/bots/api#getchatmenubutton


def get_custom_emoji_stickers(custom_emoji_ids : Array(String)) : Array(Sticker) #

Returns custom emoji stickers by identifier.

See: https://core.telegram.org/bots/api#getcustomemojistickers


def get_file(file_id : String) : File #

Returns file metadata and a download path.

See: https://core.telegram.org/bots/api#getfile


def get_forum_topic_icon_stickers : Array(Sticker) #

Returns custom emoji stickers available as forum topic icons.

See: https://core.telegram.org/bots/api#getforumtopiciconstickers


def get_game_high_scores(user_id : Int, chat_id : Int | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil) : Array(GameHighScore) #

Returns high scores for a game.

See: https://core.telegram.org/bots/api#getgamehighscores


def get_managed_bot_access_settings(user_id : Int) : BotAccessSettings #

Returns access settings for a managed bot.

See: https://core.telegram.org/bots/api#getmanagedbotaccesssettings


def get_managed_bot_token(user_id : Int) : String #

Returns a token for a managed bot.

See: https://core.telegram.org/bots/api#getmanagedbottoken


def get_me #

Returns basic information about the bot.

See: https://core.telegram.org/bots/api#getme


def get_my_commands(scope : BotCommandScope | Nil = nil, language_code : String | Nil = nil) : Array(BotCommand) #

Returns the bot's command list.

See: https://core.telegram.org/bots/api#getmycommands


def get_my_default_administrator_rights(for_channels : Bool | Nil = nil) : ChatAdministratorRights #

Returns the bot's default administrator rights.

See: https://core.telegram.org/bots/api#getmydefaultadministratorrights


def get_my_description(language_code : String | Nil = nil) : BotDescription #

Returns the bot's description.

See: https://core.telegram.org/bots/api#getmydescription


def get_my_name(language_code : String | Nil = nil) : BotName #

Returns the bot's name.

See: https://core.telegram.org/bots/api#getmyname


def get_my_short_description(language_code : String | Nil = nil) : BotShortDescription #

Returns the bot's short description.

See: https://core.telegram.org/bots/api#getmyshortdescription


def get_my_star_balance : StarAmount #

Returns the bot's Telegram Star balance.

See: https://core.telegram.org/bots/api#getmystarbalance


def get_star_transactions(offset : Int32 | Nil = nil, limit : Int32 | Nil = nil) : StarTransactions #

Returns the bot's Telegram Star transactions.

See: https://core.telegram.org/bots/api#getstartransactions


def get_sticker_set(name : String) #

def get_user_chat_boosts(chat_id : Int | String, user_id : Int) : UserChatBoosts #

Returns boosts added to a chat by a user.

See: https://core.telegram.org/bots/api#getuserchatboosts


def get_user_gifts(user_id : Int, exclude_unlimited : Bool | Nil = nil, exclude_limited_upgradable : Bool | Nil = nil, exclude_limited_non_upgradable : Bool | Nil = nil, exclude_from_blockchain : Bool | Nil = nil, exclude_unique : Bool | Nil = nil, sort_by_price : Bool | Nil = nil, offset : String | Nil = nil, limit : Int32 | Nil = nil) : OwnedGifts #

Returns gifts owned and hosted by a user.

See: https://core.telegram.org/bots/api#getusergifts


def get_user_personal_chat_messages(user_id : Int, limit : Int32) : Array(Message) #

Returns recent messages from a user's personal chat.

See: https://core.telegram.org/bots/api#getuserpersonalchatmessages


def get_user_profile_audios(user_id : Int, offset : Int32 | Nil = nil, limit : Int32 | Nil = nil) #

Returns profile audios for a user.

See: https://core.telegram.org/bots/api#getuserprofileaudios


def get_user_profile_photos(user_id : Int, offset : Int32 | Nil = nil, limit : Int32 | Nil = nil) #

Returns profile photos for a user.

See: https://core.telegram.org/bots/api#getuserprofilephotos


def get_webhook_info : WebhookInfo #

Returns current webhook status.

See: https://core.telegram.org/bots/api#getwebhookinfo


def gift_premium_subscription(user_id : Int, month_count : Int, star_count : Int, text : String | Nil = nil, text_parse_mode : String | Nil = nil, text_entities : Array(MessageEntity) | Nil = nil) #

Gifts a Telegram Premium subscription to a user.

See: https://core.telegram.org/bots/api#giftpremiumsubscription


def handle(message : Message) #

handle messages


def handle(inline_query : InlineQuery) #

handle inline query


def handle(chosen_inline_result : ChosenInlineResult) #

handle chosen inlien query


def handle(callback_query : CallbackQuery) #

handle callback query


def handle(message_reaction : MessageReactionUpdated) #

handle message reaction updates


def handle(message_reaction_count : MessageReactionCountUpdated) #

handle message reaction count updates


def handle(shipping_query : ShippingQuery) #

handle shipping query


def handle(pre_checkout_query : PreCheckoutQuery) #

handle pre-checkout query


def handle(purchased_paid_media : PaidMediaPurchased) #

handle purchased paid media updates


def handle(poll : Poll) #

handle poll updates


def handle(poll_answer : PollAnswer) #

handle poll answer updates


def handle(chat_member : ChatMemberUpdated) #

handle chat member status updates


def handle(chat_join_request : ChatJoinRequest) #

handle chat join requests


def handle(chat_boost : ChatBoostUpdated) #

handle chat boost updates


def handle(removed_chat_boost : ChatBoostRemoved) #

handle removed chat boost updates


def handle(managed_bot : ManagedBotUpdated) #

handle managed bot updates


def handle_business_connection(business_connection : BusinessConnection) #

handle business connection updates


def handle_business_message(message : Message) #

handle business messages


def handle_channel_post(message : Message) #

def handle_deleted_business_messages(deleted_business_messages : BusinessMessagesDeleted) #

handle deleted business messages


def handle_edited(message : Message) #

handle edited messages


def handle_edited_business_message(message : Message) #

handle edited business messages


def handle_edited_channel_post(message : Message) #

def handle_guest_message(message : Message) #

handle guest messages


def handle_my_chat_member(my_chat_member : ChatMemberUpdated) #

handle bot chat member status updates


def handle_update(u) #

def hide_general_forum_topic(chat_id : Int | String) #

Hides the general forum topic.

See: https://core.telegram.org/bots/api#hidegeneralforumtopic


def leave_chat(chat_id : Int | String) #

def log_out : Bool | Nil #

Logs out from the cloud Bot API server before launching the bot locally.

See: https://core.telegram.org/bots/api#logout


def on_business_connection(&block : BusinessConnection -> _) #

Registers a block handler for business connection updates.


def on_business_message(&block : Message -> _) #

Registers a block handler for business messages.


def on_callback_query(&block : CallbackQuery -> _) #

Registers a block handler for callback queries.


def on_channel_post(&block : Message -> _) #

Registers a block handler for channel posts.


def on_chat_boost(&block : ChatBoostUpdated -> _) #

Registers a block handler for chat boost updates.


def on_chat_join_request(&block : ChatJoinRequest -> _) #

Registers a block handler for chat join requests.


def on_chat_member(&block : ChatMemberUpdated -> _) #

Registers a block handler for chat member status updates.


def on_chosen_inline_result(&block : ChosenInlineResult -> _) #

Registers a block handler for chosen inline results.


def on_deleted_business_messages(&block : BusinessMessagesDeleted -> _) #

Registers a block handler for deleted business message updates.


def on_edited_business_message(&block : Message -> _) #

Registers a block handler for edited business messages.


def on_edited_channel_post(&block : Message -> _) #

Registers a block handler for edited channel posts.


def on_edited_message(&block : Message -> _) #

Registers a block handler for edited messages.


def on_guest_message(&block : Message -> _) #

Registers a block handler for guest messages.


def on_inline_query(&block : InlineQuery -> _) #

Registers a block handler for inline queries.


def on_managed_bot(&block : ManagedBotUpdated -> _) #

Registers a block handler for managed bot updates.


def on_message(&block : Message -> _) #

Registers a block handler for incoming messages.


def on_message_reaction(&block : MessageReactionUpdated -> _) #

Registers a block handler for message reaction updates.


def on_message_reaction_count(&block : MessageReactionCountUpdated -> _) #

Registers a block handler for message reaction count updates.


def on_my_chat_member(&block : ChatMemberUpdated -> _) #

Registers a block handler for bot chat member status updates.


def on_poll(&block : Poll -> _) #

Registers a block handler for poll updates.


def on_poll_answer(&block : PollAnswer -> _) #

Registers a block handler for poll answer updates.


def on_pre_checkout_query(&block : PreCheckoutQuery -> _) #

Registers a block handler for pre-checkout queries.


def on_purchased_paid_media(&block : PaidMediaPurchased -> _) #

Registers a block handler for purchased paid media updates.


def on_removed_chat_boost(&block : ChatBoostRemoved -> _) #

Registers a block handler for removed chat boost updates.


def on_shipping_query(&block : ShippingQuery -> _) #

Registers a block handler for shipping queries.


def pin_chat_message(chat_id : Int | String, message_id : Int, business_connection_id : String | Nil = nil, disable_notification : Bool | Nil = nil) #

Pins a message in a chat.

See: https://core.telegram.org/bots/api#pinchatmessage


def polling #

run long polling in a loop and call handlers for messages


def post_story(business_connection_id : String, content : InputStoryContent, active_period : Int | Time::Span, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, areas : Array(StoryArea) | Nil = nil, post_to_chat_page : Bool | Nil = nil, protect_content : Bool | Nil = nil) : Story #

Posts a story on behalf of a managed business account.

See: https://core.telegram.org/bots/api#poststory


def promote_chat_member(chat_id : Int | String, user_id : Int, is_anonymous : Bool | Nil = nil, can_manage_chat : Bool | Nil = nil, can_change_info : Bool | Nil = nil, can_post_messages : Bool | Nil = nil, can_edit_messages : Bool | Nil = nil, can_delete_messages : Bool | Nil = nil, can_manage_video_chats : Bool | Nil = nil, can_invite_users : Bool | Nil = nil, can_restrict_members : Bool | Nil = nil, can_pin_messages : Bool | Nil = nil, can_promote_members : Bool | Nil = nil, can_manage_topics : Bool | Nil = nil, can_manage_direct_messages : Bool | Nil = nil, can_post_stories : Bool | Nil = nil, can_edit_stories : Bool | Nil = nil, can_delete_stories : Bool | Nil = nil, can_manage_tags : Bool | Nil = nil) #

Promotes or demotes a user in a supergroup or channel.

See: https://core.telegram.org/bots/api#promotechatmember


def read_business_message(business_connection_id : String, chat_id : Int | String, message_id : Int) #

Marks a business message as read.

See: https://core.telegram.org/bots/api#readbusinessmessage


def refund_star_payment(user_id : Int, telegram_payment_charge_id : String) #

Refunds a Telegram Star payment.

See: https://core.telegram.org/bots/api#refundstarpayment


def remove_business_account_profile_photo(business_connection_id : String, is_public : Bool | Nil = nil) #

Removes a business account profile photo.

See: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto


def remove_chat_verification(chat_id : Int | String) #

Removes verification from a chat.

See: https://core.telegram.org/bots/api#removechatverification


def remove_my_profile_photo #

Removes the bot's profile photo.

See: https://core.telegram.org/bots/api#removemyprofilephoto


def remove_user_verification(user_id : Int) #

Removes verification from a user.

See: https://core.telegram.org/bots/api#removeuserverification


def reopen_forum_topic(chat_id : Int | String, message_thread_id : Int) #

def reopen_general_forum_topic(chat_id : Int | String) #

Reopens the general forum topic.

See: https://core.telegram.org/bots/api#reopengeneralforumtopic


def replace_managed_bot_token(user_id : Int) : String #

Replaces the token for a managed bot.

See: https://core.telegram.org/bots/api#replacemanagedbottoken


def replace_sticker_in_set(user_id : Int, name : String, old_sticker : String, sticker : InputSticker) #

Replaces an existing sticker in a set.

See: https://core.telegram.org/bots/api#replacestickerinset


def reply(message : Message, text : String) : Message | Nil #

Replies to a message with text using sendMessage.


def repost_story(business_connection_id : String, from_chat_id : Int, from_story_id : Int, active_period : Int | Time::Span, post_to_chat_page : Bool | Nil = nil, protect_content : Bool | Nil = nil) : Story #

Reposts a story on behalf of a managed business account.

See: https://core.telegram.org/bots/api#repoststory


def restrict_chat_member(chat_id : Int | String, user_id : Int, permissions : ChatPermissions, until_date : Int | Time | Nil = nil, use_independent_chat_permissions : Bool | Nil = nil) #

Restricts a user in a supergroup.

See: https://core.telegram.org/bots/api#restrictchatmember


def revoke_chat_invite_link(chat_id : Int | String, invite_link : String) : ChatInviteLink | Nil #

Revokes an invite link created by the bot.

See: https://core.telegram.org/bots/api#revokechatinvitelink


def save_prepared_inline_message(user_id : Int, result : InlineQueryResult, allow_user_chats : Bool | Nil = nil, allow_bot_chats : Bool | Nil = nil, allow_group_chats : Bool | Nil = nil, allow_channel_chats : Bool | Nil = nil) : PreparedInlineMessage #

Stores an inline message for later use.

See: https://core.telegram.org/bots/api#savepreparedinlinemessage


def save_prepared_keyboard_button(user_id : Int, button : KeyboardButton) : PreparedKeyboardButton #

Stores a keyboard button for later use.

See: https://core.telegram.org/bots/api#savepreparedkeyboardbutton


def send_animation(chat_id : Int | String, animation : ::File | String, duration : Int32 | Time::Span | Nil = nil, width : Int32 | Nil = nil, height : Int32 | Nil = nil, caption : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, thumbnail : ::File | String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, has_spoiler : Bool | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_audio(chat_id : Int | String, audio : ::File | String, duration : Int32 | Time::Span | Nil = nil, performer : String | Nil = nil, title : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, thumbnail : ::File | String | Nil = nil, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_chat_action(chat_id : Int | String, action : String, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil) #

Sends a chat action indicator.

See: https://core.telegram.org/bots/api#sendchataction


def send_checklist(business_connection_id : String, chat_id : Int | String, checklist : InputChecklist, disable_notification : Bool | Nil = nil, protect_content : Bool | Nil = nil, message_effect_id : String | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Nil #

Sends checklists on behalf of a connected business account.

See: https://core.telegram.org/bots/api#sendchecklist


def send_contact(chat_id : Int | String, phone_number : String, first_name : String, last_name : String | Nil = nil, reply_markup : ReplyMarkup = nil, disable_notification : Bool | Nil = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, vcard : String | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_dice(chat_id : Int | String, emoji : String | Nil = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, disable_notification : Bool | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, message_effect_id : String | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, reply_markup : ReplyMarkup = nil) : Message | Nil #

Sends an animated dice message.

See: https://core.telegram.org/bots/api#senddice


def send_document(chat_id : Int | String, document : ::File | String, caption : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, thumbnail : ::File | String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, disable_content_type_detection : Bool | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_game(chat_id : Int | String, game_short_name : String, disable_notification : Bool | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil, *, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, message_effect_id : String | Nil = nil, reply_parameters : ReplyParameters | Nil = nil) : Message | Nil #

def send_gift(gift_id : String, user_id : Int | Nil = nil, chat_id : Int | String | Nil = nil, pay_for_upgrade : Bool | Nil = nil, text : String | Nil = nil, text_parse_mode : String | Nil = nil, text_entities : Array(MessageEntity) | Nil = nil) #

Sends a gift to a user or chat.

See: https://core.telegram.org/bots/api#sendgift


def send_invoice(chat_id : Int | String, title : String, description : String, payload : String, provider_token : String, start_parameter : String, currency : String, prices : Array(LabeledPrice), business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, subscription_period : Int32 | Nil = nil, max_tip_amount : Int32 | Nil = nil, suggested_tip_amounts : Array(Int32) | Nil = nil, provider_data : String | Nil = nil, photo_url : String | Nil = nil, photo_size : Int32 | Nil = nil, photo_width : Int32 | Nil = nil, photo_height : Int32 | Nil = nil, need_name : Bool | Nil = nil, need_phone_number : Bool | Nil = nil, need_email : Bool | Nil = nil, need_shipping_address : Bool | Nil = nil, send_phone_number_to_provider : Bool | Nil = nil, send_email_to_provider : Bool | Nil = nil, is_flexible : Bool | Nil = nil, disable_notification : Bool | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, message_effect_id : String | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Nil #

def send_live_photo(chat_id : Int | String, live_photo : ::File | String, photo : ::File | String, caption : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, has_spoiler : Bool | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_location(chat_id : Int | String, latitude : Float, longitude : Float, live_period : Int32 | Time::Span | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, horizontal_accuracy : Float | Nil = nil, heading : Int32 | Nil = nil, proximity_alert_radius : Int32 | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_media_group(chat_id : Int | String, media : Array(InputMedia), disable_notification : Bool | Nil = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil) : Array(Message) #

Sends a group of photos, videos, documents, or audios.

See: https://core.telegram.org/bots/api#sendmediagroup


def send_message(chat_id : Int | String, text : String, parse_mode : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, entities : Array(MessageEntity) | Nil = nil, link_preview_options : LinkPreviewOptions | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_message_draft(chat_id : Int, draft_id : Int, text : String | Nil = nil, message_thread_id : Int32 | Nil = nil, parse_mode : String | Nil = nil, entities : Array(MessageEntity) | Nil = nil) : Bool | Nil #

def send_paid_media(chat_id : Int | String, star_count : Int, media : Array(InputPaidMedia), business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, payload : String | Nil = nil, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, disable_notification : Bool | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, reply_markup : ReplyMarkup = nil) : Message | Nil #

Sends paid media messages.

See: https://core.telegram.org/bots/api#sendpaidmedia


def send_photo(chat_id : Int | String, photo : ::File | String, caption : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, has_spoiler : Bool | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_poll(chat_id : Int | String, question : String, options : Array(InputPollOption) | Array(String), business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, question_parse_mode : String | Nil = nil, question_entities : Array(MessageEntity) | Nil = nil, is_anonymous : Bool | Nil = nil, type : String | Nil = nil, allows_multiple_answers : Bool | Nil = nil, allows_revoting : Bool | Nil = nil, shuffle_options : Bool | Nil = nil, allow_adding_options : Bool | Nil = nil, hide_results_until_closes : Bool | Nil = nil, members_only : Bool | Nil = nil, country_codes : Array(String) | Nil = nil, correct_option_ids : Array(Int32) | Nil = nil, explanation : String | Nil = nil, explanation_parse_mode : String | Nil = nil, explanation_entities : Array(MessageEntity) | Nil = nil, explanation_media : InputPollMedia | Nil = nil, open_period : Int32 | Time::Span | Nil = nil, close_date : Int32 | Time | Nil = nil, is_closed : Bool | Nil = nil, description : String | Nil = nil, description_parse_mode : String | Nil = nil, description_entities : Array(MessageEntity) | Nil = nil, media : InputPollMedia | Nil = nil, disable_notification : Bool | Nil = nil, protect_content : Bool | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, message_effect_id : String | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, reply_markup : ReplyMarkup = nil) : Message | Nil #

def send_sticker(chat_id : Int | String, sticker : ::File | String, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, emoji : String | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_venue(chat_id : Int | String, latitude : Float, longitude : Float, title : String, address : String, foursquare_id : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup | Nil = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, foursquare_type : String | Nil = nil, google_place_id : String | Nil = nil, google_place_type : String | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

Sends venue information.

See: https://core.telegram.org/bots/api#sendvenue


def send_video(chat_id : Int | String, video : ::File | String, duration : Int32 | Time::Span | Nil = nil, width : Int32 | Nil = nil, height : Int32 | Nil = nil, caption : String | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, thumbnail : ::File | String | Nil = nil, cover : ::File | String | Nil = nil, start_timestamp : Int32 | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, show_caption_above_media : Bool | Nil = nil, has_spoiler : Bool | Nil = nil, supports_streaming : Bool | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_video_note(chat_id : Int | String, video_note : ::File | String, duration : Int32 | Time::Span | Nil = nil, length : Int32 | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, thumbnail : ::File | String | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def send_voice(chat_id : Int | String, voice : ::File | String, duration : Int32 | Time::Span | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil, business_connection_id : String | Nil = nil, message_thread_id : Int32 | Nil = nil, direct_messages_topic_id : Int64 | Nil = nil, caption : String | Nil = nil, parse_mode : String | Nil = nil, caption_entities : Array(MessageEntity) | Nil = nil, protect_content : Bool | Nil = nil, reply_parameters : ReplyParameters | Nil = nil, message_effect_id : String | Nil = nil, allow_paid_broadcast : Bool | Nil = nil, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Message | Nil #

def serve(bind_address : String = "127.0.0.1", bind_port : Int32 = 80, ssl_certificate_path : String | Nil = nil, ssl_key_path : String | Nil = nil) #

def set_business_account_bio(business_connection_id : String, bio : String | Nil = nil) #

Sets the bio of a business account.

See: https://core.telegram.org/bots/api#setbusinessaccountbio


def set_business_account_gift_settings(business_connection_id : String, show_gift_button : Bool, accepted_gift_types : AcceptedGiftTypes) #

Sets gift settings for a business account.

See: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings


def set_business_account_name(business_connection_id : String, first_name : String, last_name : String | Nil = nil) #

Sets the name of a business account.

See: https://core.telegram.org/bots/api#setbusinessaccountname


def set_business_account_profile_photo(business_connection_id : String, photo : InputProfilePhoto, is_public : Bool | Nil = nil) #

Sets a business account profile photo.

See: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto


def set_business_account_username(business_connection_id : String, username : String | Nil = nil) #

Sets the username of a business account.

See: https://core.telegram.org/bots/api#setbusinessaccountusername


def set_chat_administrator_custom_title(chat_id : Int | String, user_id : Int, custom_title : String) #

Sets a custom title for an administrator in a supergroup.

See: https://core.telegram.org/bots/api#setchatadministratorcustomtitle


def set_chat_description(chat_id : Int | String, description : String | Nil = nil) #

def set_chat_member_tag(chat_id : Int | String, user_id : Int, tag : String | Nil = nil) #

Sets a tag for a regular member in a group or supergroup.

See: https://core.telegram.org/bots/api#setchatmembertag


def set_chat_menu_button(chat_id : Int | Nil = nil, menu_button : MenuButton | Nil = nil) #

Sets the bot's menu button in a private chat or globally.

See: https://core.telegram.org/bots/api#setchatmenubutton


def set_chat_permissions(chat_id : Int | String, permissions : ChatPermissions, use_independent_chat_permissions : Bool | Nil = nil) #

Sets default chat permissions for all members.

See: https://core.telegram.org/bots/api#setchatpermissions


def set_chat_photo(chat_id : Int | String, photo : ::File) #

def set_chat_sticker_set(chat_id : Int | String, sticker_set_name : String) #

Sets a group sticker set for a supergroup.

See: https://core.telegram.org/bots/api#setchatstickerset


def set_chat_title(chat_id : Int | String, title : String) #

def set_custom_emoji_sticker_set_thumbnail(name : String, custom_emoji_id : String | Nil = nil) #

Sets the thumbnail of a custom emoji sticker set.

See: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail


def set_game_score(user_id : Int, score : Int, force : Bool | Nil = nil, disable_edit_message : Bool | Nil = nil, chat_id : Int | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil) : Message | Bool | Nil #

Sets a user's score in a game.

See: https://core.telegram.org/bots/api#setgamescore


def set_managed_bot_access_settings(user_id : Int, is_access_restricted : Bool, added_user_ids : Array(Int64) | Nil = nil) #

Sets access settings for a managed bot.

See: https://core.telegram.org/bots/api#setmanagedbotaccesssettings


def set_message_reaction(chat_id : Int | String, message_id : Int, reaction : Array(ReactionType) | Nil = nil, is_big : Bool | Nil = nil) #

Sets reactions on a message.

See: https://core.telegram.org/bots/api#setmessagereaction


def set_my_commands(commands : Array(BotCommand), scope : BotCommandScope | Nil = nil, language_code : String | Nil = nil) #

Sets the bot's command list.

See: https://core.telegram.org/bots/api#setmycommands


def set_my_default_administrator_rights(rights : ChatAdministratorRights | Nil = nil, for_channels : Bool | Nil = nil) #

Sets the bot's default administrator rights.

See: https://core.telegram.org/bots/api#setmydefaultadministratorrights


def set_my_description(description : String | Nil = nil, language_code : String | Nil = nil) #

Sets the bot's description.

See: https://core.telegram.org/bots/api#setmydescription


def set_my_name(name : String | Nil = nil, language_code : String | Nil = nil) #

def set_my_profile_photo(photo : InputProfilePhoto) #

Sets the bot's profile photo.

See: https://core.telegram.org/bots/api#setmyprofilephoto


def set_my_short_description(short_description : String | Nil = nil, language_code : String | Nil = nil) #

Sets the bot's short description.

See: https://core.telegram.org/bots/api#setmyshortdescription


def set_passport_data_errors(user_id : Int, errors : Array(PassportElementError)) #

Reports validation errors in submitted Telegram Passport data.

See: https://core.telegram.org/bots/api#setpassportdataerrors


def set_sticker_emoji_list(sticker : String, emoji_list : Array(String)) #

Changes the emoji list assigned to a sticker.

See: https://core.telegram.org/bots/api#setstickeremojilist


def set_sticker_keywords(sticker : String, keywords : Array(String) | Nil = nil) #

Changes search keywords assigned to a sticker.

See: https://core.telegram.org/bots/api#setstickerkeywords


def set_sticker_mask_position(sticker : String, mask_position : MaskPosition | Nil = nil) #

Changes the mask position assigned to a mask sticker.

See: https://core.telegram.org/bots/api#setstickermaskposition


def set_sticker_position_in_set(sticker : String, position : Int) #

Moves a sticker in a sticker set.

See: https://core.telegram.org/bots/api#setstickerpositioninset


def set_sticker_set_thumbnail(name : String, user_id : Int, format : String, thumbnail : ::File | String | Nil = nil) #

Sets the thumbnail of a regular, mask, or custom emoji sticker set.

See: https://core.telegram.org/bots/api#setstickersetthumbnail


def set_sticker_set_title(name : String, title : String) #

Changes a sticker set title.

See: https://core.telegram.org/bots/api#setstickersettitle


def set_user_emoji_status(user_id : Int, emoji_status_custom_emoji_id : String | Nil = nil, emoji_status_expiration_date : Int | Time | Nil = nil) #

Changes a user's emoji status.

See: https://core.telegram.org/bots/api#setuseremojistatus


def set_webhook(url : String, certificate : ::File | Nil = nil, max_connections : Int32 | Nil = nil, allowed_updates : Array(String) | Nil = @allowed_updates, ip_address : String | Nil = nil, drop_pending_updates : Bool | Nil = nil, secret_token : String | Nil = nil) #

Sets a webhook for receiving incoming updates.

See: https://core.telegram.org/bots/api#setwebhook


def stop #

def stop_message_live_location(business_connection_id : String | Nil = nil, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, reply_markup : ReplyMarkup | Nil = nil) #

Stops updating a live location message.

See: https://core.telegram.org/bots/api#stopmessagelivelocation


def stop_poll(chat_id : Int | String, message_id : Int32, business_connection_id : String | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Poll | Nil #

Stops a poll sent by the bot.

See: https://core.telegram.org/bots/api#stoppoll


def transfer_business_account_stars(business_connection_id : String, star_count : Int) #

Transfers Stars from a business account to the bot's balance.

See: https://core.telegram.org/bots/api#transferbusinessaccountstars


def transfer_gift(business_connection_id : String, owned_gift_id : String, new_owner_chat_id : Int, star_count : Int | Nil = nil) #

Transfers a unique gift owned by a business account to another user.

See: https://core.telegram.org/bots/api#transfergift


def unban_chat_member(chat_id : Int | String, user_id : Int, only_if_banned : Bool | Nil = nil) #

Unbans a previously banned user in a chat.

See: https://core.telegram.org/bots/api#unbanchatmember


def unban_chat_sender_chat(chat_id : Int | String, sender_chat_id : Int) #

Unbans a previously banned channel chat in a supergroup or channel.

See: https://core.telegram.org/bots/api#unbanchatsenderchat


def unhide_general_forum_topic(chat_id : Int | String) #

Unhides the general forum topic.

See: https://core.telegram.org/bots/api#unhidegeneralforumtopic


def unpin_all_chat_messages(chat_id : Int | String) #

Clears the list of pinned messages in a chat.

See: https://core.telegram.org/bots/api#unpinallchatmessages


def unpin_all_forum_topic_messages(chat_id : Int | String, message_thread_id : Int) #

Unpins all messages in a forum topic.

See: https://core.telegram.org/bots/api#unpinallforumtopicmessages


def unpin_all_general_forum_topic_messages(chat_id : Int | String) #

Unpins all messages in the general forum topic.

See: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages


def unpin_chat_message(chat_id : Int | String, business_connection_id : String | Nil = nil, message_id : Int | Nil = nil) #

Unpins a message in a chat.

See: https://core.telegram.org/bots/api#unpinchatmessage


def upgrade_gift(business_connection_id : String, owned_gift_id : String, keep_original_details : Bool | Nil = nil, star_count : Int | Nil = nil) #

Upgrades a regular gift owned by a business account to a unique gift.

See: https://core.telegram.org/bots/api#upgradegift


def upload_sticker_file(user_id : Int, sticker : ::File, sticker_format : String) #

Uploads a sticker file for later use.

See: https://core.telegram.org/bots/api#uploadstickerfile


def verify_chat(chat_id : Int | String, custom_description : String | Nil = nil) #

Verifies a chat on behalf of the bot's organization.

See: https://core.telegram.org/bots/api#verifychat


def verify_user(user_id : Int, custom_description : String | Nil = nil) #

Verifies a user on behalf of the bot's organization.

See: https://core.telegram.org/bots/api#verifyuser