class

TelegramBot::Bot

Inherits Reference < Object

Constants

Log = ::Log.for(self)

Constructors

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)
Source

Instance methods

add_sticker_to_set(user_id : Int, name : String, png_sticker : ::File | String, emojis : String, mask_position : MaskPosition | Nil = nil)

Adds a sticker to an existing sticker set.

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

Source
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

Source
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

Source
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, switch_pm_text : String | Nil = nil, switch_pm_parameter : String | Nil = nil) : Bool | Nil

Sends answers to an inline query.

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

Source
answer_pre_checkout_query(pre_checkout_query_id : String, ok : Bool, error_message : String | Nil = nil) : Bool | Message | Nil

Sends an answer to a pre-checkout query.

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

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

Sends an answer to a shipping query.

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

Source
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

Source
approve_chat_join_request(chat_id : Int | String, user_id : Int)
Source
ban_chat_member(chat_id : Int | String, user_id : Int, until_date : Int | Nil = nil, revoke_messages : Bool | Nil = nil)
Source
close_forum_topic(chat_id : Int | String, message_thread_id : Int)
Source
close_general_forum_topic(chat_id : Int | String)

Closes the general forum topic.

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

Source
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

Source
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

Source
create_forum_topic(chat_id : Int | String, name : String, icon_color : Int32 | Nil = nil, icon_custom_emoji_id : String | Nil = nil) : ForumTopic | Nil
Source
create_new_sticker_set(user_id : Int, name : String, title : String, png_sticker : ::File | String, emojis : String, contains_masks : Bool | Nil = nil, mask_position : MaskPosition | Nil = nil)

Creates a new sticker set for a user.

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

Source
decline_chat_join_request(chat_id : Int | String, user_id : Int)
Source
delete_all_message_reactions(chat_id : Int | String, message_id : Int)

Deletes all reactions from a message.

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

Source
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

Source
delete_chat_photo(chat_id : Int | String)
Source
delete_chat_sticker_set(chat_id : Int | String)

Deletes the group sticker set from a supergroup.

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

Source
delete_forum_topic(chat_id : Int | String, message_thread_id : Int)
Source
delete_message(chat_id : Int | String, message_id : Int32) : Message | Bool | Nil
Source
delete_message_reaction(chat_id : Int | String, message_id : Int, reaction : ReactionType)

Deletes one reaction from a message.

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

Source
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

Source
delete_sticker_position_in_set(sticker : String)

Deletes a sticker from a sticker set.

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

Source
delete_webhook(drop_pending_updates : Bool | Nil = nil) : Bool | Nil

Removes webhook integration.

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

Source
download(file : File)

Downloads a file returned by Telegram.

Source
download(file_path : String)

Downloads a file returned by Telegram.

Source
download(media)

Downloads a file returned by Telegram.

Source
edit_forum_topic(chat_id : Int | String, message_thread_id : Int, name : String | Nil = nil, icon_custom_emoji_id : String | Nil = nil)
Source
edit_general_forum_topic(chat_id : Int | String, name : String)
Source
edit_message_caption(chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, caption : String | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Bool | Nil
Source
edit_message_live_location(latitude : Float, longitude : Float, chat_id : Int | String | Nil = nil, message_id : Int32 | Nil = nil, inline_message_id : String | Nil = nil, reply_markup : ReplyMarkup | Nil = nil)
Source
edit_message_reply_markup(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

Source
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

Source
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
Source
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

Source
get_available_gifts

Returns gifts that can be sent by the bot.

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

Source
get_business_connection(business_connection_id : String) : BusinessConnection

Returns information about a business connection.

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

Source
get_chat(chat_id : Int | String)

Returns information about a chat.

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

Source
get_chat_administrators(chat_id : Int | String)

Returns the list of chat administrators.

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

Source
get_chat_member(chat_id : Int | String, user_id : Int32)

Returns information about a chat member.

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

Source
get_chat_member_count(chat_id : Int | String)

Returns the number of members in a chat.

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

Source
get_file(file_id : String) : File

Returns file metadata and a download path.

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

Source
get_forum_topic_icon_stickers

Returns custom emoji stickers available as forum topic icons.

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

Source
get_game_high_scores(user_id : Int32, chat_id : Int | String | 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

Source
get_managed_bot_access_settings(user_id : Int) : BotAccessSettings

Returns access settings for a managed bot.

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

Source
get_managed_bot_token(user_id : Int) : String

Returns a token for a managed bot.

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

Source
get_me

Returns basic information about the bot.

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

Source
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

Source
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

Source
get_my_description(language_code : String | Nil = nil) : BotDescription

Returns the bot's description.

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

Source
get_my_name(language_code : String | Nil = nil) : BotName

Returns the bot's name.

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

Source
get_my_short_description(language_code : String | Nil = nil) : BotShortDescription

Returns the bot's short description.

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

Source
get_my_star_balance

Returns the bot's Telegram Star balance.

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

Source
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

Source
get_sticker_set(name : String)
Source
get_user_profile_photos(user_id : Int32, offset : Int32 | Nil = nil, limit : Int32 | Nil = nil)

Returns profile photos for a user.

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

Source
get_webhook_info

Returns current webhook status.

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

Source
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

Source
handle(message : Message)

handle messages

Source
handle(inline_query : InlineQuery)

handle inline query

Source
handle(chosen_inline_result : ChosenInlineResult)

handle chosen inlien query

Source
handle(callback_query : CallbackQuery)

handle callback query

Source
handle(message_reaction : MessageReactionUpdated)

handle message reaction updates

Source
handle(message_reaction_count : MessageReactionCountUpdated)

handle message reaction count updates

Source
handle(shipping_query : ShippingQuery)

handle shipping query

Source
handle(pre_checkout_query : PreCheckoutQuery)

handle pre-checkout query

Source
handle(purchased_paid_media : PaidMediaPurchased)

handle purchased paid media updates

Source
handle(poll : Poll)

handle poll updates

Source
handle(poll_answer : PollAnswer)

handle poll answer updates

Source
handle(chat_member : ChatMemberUpdated)

handle chat member status updates

Source
handle(chat_join_request : ChatJoinRequest)

handle chat join requests

Source
handle(chat_boost : ChatBoostUpdated)

handle chat boost updates

Source
handle(removed_chat_boost : ChatBoostRemoved)

handle removed chat boost updates

Source
handle(managed_bot : ManagedBotUpdated)

handle managed bot updates

Source
handle_business_connection(business_connection : BusinessConnection)

handle business connection updates

Source
handle_business_message(message : Message)

handle business messages

Source
handle_channel_post(message : Message)
Source
handle_deleted_business_messages(deleted_business_messages : BusinessMessagesDeleted)

handle deleted business messages

Source
handle_edited(message : Message)

handle edited messages

Source
handle_edited_business_message(message : Message)

handle edited business messages

Source
handle_edited_channel_post(message : Message)
Source
handle_guest_message(message : Message)

handle guest messages

Source
handle_my_chat_member(my_chat_member : ChatMemberUpdated)

handle bot chat member status updates

Source
handle_update(u)
Source
hide_general_forum_topic(chat_id : Int | String)
Source
leave_chat(chat_id : Int | String)
Source
pin_chat_message(chat_id : Int | String, message_id : Int, disable_notification : Bool | Nil = nil)
Source
polling

run long polling in a loop and call handlers for messages

Source
promote_chat_member(chat_id : Int | String, user_id : Int, 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_invite_users : Bool | Nil = nil, can_restrict_members : Bool | Nil = nil, can_pin_messages : Bool | Nil = nil, can_promote_members : Bool | Nil = nil)

Promotes or demotes a user in a supergroup or channel.

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

Source
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

Source
refund_star_payment(user_id : Int, telegram_payment_charge_id : String)

Refunds a Telegram Star payment.

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

Source
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

Source
reopen_forum_topic(chat_id : Int | String, message_thread_id : Int)
Source
reopen_general_forum_topic(chat_id : Int | String)

Reopens the general forum topic.

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

Source
replace_managed_bot_token(user_id : Int) : String

Replaces the token for a managed bot.

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

Source
reply(message : Message, text : String) : Message | Nil

Replies to a message with text using sendMessage.

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

Restricts a user in a supergroup.

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

Source
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

Source
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

Source
send_animation(chat_id : Int | String, animation : ::File | String, duration : Int32 | 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
Source
send_audio(chat_id : Int | String, audio : ::File | String, duration : Int32 | 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
Source
send_chat_action(chat_id : Int | String, action : String)

Sends a chat action indicator.

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

Source
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
Source
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

Source
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
Source
send_game(chat_id : Int | String, game_short_name : String, disable_notification : Bool | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil) : Message | Nil
Source
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

Source
send_invoice(chat_id : Int, title : String, description : String, payload : String, provider_token : String, start_parameter : String, currency : String, prices : Array(LabeledPrice), 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, is_flexible : Bool | Nil = nil, disable_notification : Bool | Nil = nil, reply_markup : ReplyMarkup = nil) : Message | Nil
Source
send_location(chat_id : Int | String, latitude : Float, longitude : Float, live_period : 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, 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
Source
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, suggested_post_parameters : SuggestedPostParameters | Nil = nil) : Array(Message)

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

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

Source
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
Source
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
Source
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

Source
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
Source
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 | Nil = nil, close_date : Int32 | 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
Source
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
Source
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

Source
send_video(chat_id : Int | String, video : ::File | String, duration : Int32 | 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
Source
send_video_note(chat_id : Int | String, video_note : ::File | String, duration : Int32 | 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
Source
send_voice(chat_id : Int | String, voice : ::File | String, duration : 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, 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
Source
serve(bind_address : String = "127.0.0.1", bind_port : Int32 = 80, ssl_certificate_path : String | Nil = nil, ssl_key_path : String | Nil = nil)
Source
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

Source
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

Source
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

Source
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

Source
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

Source
set_chat_description(chat_id : Int | String, description : String)
Source
set_chat_photo(chat_id : Int | String, photo : ::File)
Source
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

Source
set_chat_title(chat_id : Int | String, title : String)
Source
set_game_score(user_id : Int32, score : Int32, force : Bool | Nil = nil, disable_edit_message : Bool | Nil = nil, chat_id : Int | String | 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

Source
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

Source
set_message_reaction(chat_id : Int | String, message_id : Int, reaction : Array(ReactionType) | Nil = nil, is_big : Bool | Nil = nil)
Source
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

Source
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

Source
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

Source
set_my_name(name : String | Nil = nil, language_code : String | Nil = nil)
Source
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

Source
set_sticker_position_in_set(sticker : String, position : Int)

Moves a sticker in a sticker set.

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

Source
set_webhook(url : String, certificate : ::File | String | 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

Source
stop
Source
stop_message_live_location(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

Source
unban_chat_member(chat_id : Int | String, user_id : Int32)

Unbans a previously banned user in a chat.

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

Source
unhide_general_forum_topic(chat_id : Int | String)

Unhides the general forum topic.

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

Source
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

Source
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

Source
unpin_chat_message(chat_id : Int | String)

Unpins a message in a chat.

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

Source
upload_sticker_file(user_id : Int, png_sticker : ::File)

Uploads a sticker file for later use.

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

Source

Macros

def_force_request(name, *args)
Source
def_request(name, *args)
Source

Nested types