-module(telega@api). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/telega/api.gleam"). -export([set_webhook/2, get_webhook_info/1, delete_webhook/1, delete_webhook_and_drop_updates/1, log_out/1, close/1, send_message/2, send_dice/2, get_me/1, answer_callback_query/2, forward_message/2, get_updates/2, forward_messages/2, copy_message/2, copy_messages/2, send_photo/2, send_audio/2, send_document/2, send_video/2, send_animation/2, send_voice/2, send_video_note/2, send_media_group/2, send_location/2, send_venue/2, send_contact/2, send_poll/2, send_chat_action/2, set_message_reaction/2, get_user_profile_photos/2, get_user_profile_audios/2, set_my_profile_photo/2, remove_my_profile_photo/1, edit_message_text/2, edit_message_caption/2, edit_message_media/2, edit_message_live_location/2, stop_message_live_location/2, edit_message_reply_markup/2, stop_poll/2, delete_message/2, delete_messages/2, get_available_gifts/1, send_gift/2, gift_premium/2, verify_user/2, verify_chat/2, remove_user_verification/2, remove_chat_verification/2, read_business_message/2, delete_business_messages/2, set_business_account_username/2, set_business_account_bio/2, set_business_account_name/2, set_business_account_profile_photo/2, remove_business_account_profile_photo/2, set_business_account_gift_settings/2, get_business_account_star_balance/2, transfer_business_account_stars/2, get_business_account_gifts/2, convert_gift_to_stars/2, upgrade_gift/2, transfer_gift/2, post_business_story/2, edit_story/2, delete_story/2, get_chat/2, get_file/2, ban_chat_member/2, unban_chat_member/2, restrict_chat_member/2, promote_chat_member/2, set_chat_administrator_custom_title/2, ban_chat_sender_chat/2, unban_chat_sender_chat/2, set_chat_permissions/2, export_chat_invite_link/2, create_chat_invite_link/2, edit_chat_invite_link/2, create_chat_subscription_invite_link/2, edit_chat_subscription_invite_link/2, revoke_chat_invite_link/2, approve_chat_join_request/2, decline_chat_join_request/2, set_chat_photo/2, delete_chat_photo/2, set_chat_title/2, set_chat_description/2, pin_chat_message/2, unpin_chat_message/2, unpin_all_chat_messages/2, leave_chat/2, get_chat_administrators/2, get_chat_member_count/2, get_chat_member/2, set_chat_sticker_set/2, delete_chat_sticker_set/2, get_forum_topic_icon_stickers/1, create_forum_topic/2, edit_forum_topic/2, close_forum_topic/2, reopen_forum_topic/2, delete_forum_topic/2, unpin_all_forum_topic_pinned_messages/2, edit_general_forum_topic/2, close_general_forum_topic/2, reopen_general_forum_topic/2, hide_general_forum_topic/2, unhide_general_forum_topic/2, unpin_all_general_forum_topic_messages/2, get_user_chat_boosts/2, get_business_connection/2, set_my_commands/3, delete_my_commands/2, get_my_commands/2, set_my_name/2, get_my_name/2, set_my_description/2, get_my_description/2, set_my_short_description/2, get_my_short_description/2, set_chat_menu_button/2, get_chat_menu_button/2, set_my_default_administrator_rights/2, get_my_default_administrator_rights/2, send_sticker/2, get_sticker_set/2, get_custom_emoji_stickers/2, upload_sticker_file/2, create_new_sticker_set/2, add_sticker_to_set/2, set_sticker_position_in_set/2, delete_sticker_from_set/2, replace_sticker_in_set/2, set_sticker_emoji_list/2, set_sticker_keywords/2, set_sticker_mask_position/2, set_sticker_set_title/2, set_sticker_set_thumbnail/2, set_custom_emoji_sticker_set_thumbnail/2, delete_sticker_set/2, answer_inline_query/2, send_invoice/2, send_paid_media/2, create_invoice_link/2, answer_shipping_query/2, answer_pre_checkout_query/2, get_star_transactions/2, refund_star_payment/2, edit_user_star_subscription/2, send_game/2, set_game_score/2, get_game_high_scores/2, send_message_draft/2, get_user_gifts/2, get_chat_gifts/2, repost_story/2, answer_guest_query/2, delete_message_reaction/2, delete_all_message_reactions/2, send_live_photo/2, get_managed_bot_access_settings/2, set_managed_bot_access_settings/2, get_user_personal_chat_messages/2, send_rich_message/2, send_rich_message_draft/2, delete_ephemeral_message/2, edit_ephemeral_message_text/2, edit_ephemeral_message_caption/2, edit_ephemeral_message_media/2, edit_ephemeral_message_reply_markup/2, answer_chat_join_request_query/2, send_chat_join_request_web_app/2]). -export_type([api_response/1]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC( " This module provides an interface for interacting with the Telegram Bot API.\n" " It will be useful if you want to interact with the Telegram Bot API directly, without running a bot.\n" " But it will be more convenient to use the `reply` module in bot handlers.\n" ). -type api_response(AFWO) :: {api_success_response, boolean(), AFWO} | {api_error_response, boolean(), integer(), binary()}. -file("src/telega/api.gleam", 3212). -spec response_decoder(gleam@dynamic@decode:decoder(AGKQ)) -> gleam@dynamic@decode:decoder(api_response(AGKQ)). response_decoder(Result_decoder) -> gleam@dynamic@decode:field( <<"ok"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Ok) -> case Ok of true -> gleam@dynamic@decode:field( <<"result"/utf8>>, Result_decoder, fun(Result) -> gleam@dynamic@decode:success( {api_success_response, Ok, Result} ) end ); false -> gleam@dynamic@decode:field( <<"error_code"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Error_code) -> gleam@dynamic@decode:field( <<"description"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Description) -> gleam@dynamic@decode:success( {api_error_response, Ok, Error_code, Description} ) end ) end ) end end ). -file("src/telega/api.gleam", 3192). -spec map_response( {ok, gleam@http@response:response(binary())} | {error, telega@error:telega_error()}, gleam@dynamic@decode:decoder(AGKM) ) -> {ok, AGKM} | {error, telega@error:telega_error()}. map_response(Response, Result_decoder) -> gleam@result:'try'( Response, fun(Response@1) -> _pipe = gleam@json:parse( erlang:element(4, Response@1), response_decoder(Result_decoder) ), _pipe@1 = gleam@result:map_error( _pipe, fun(Field@0) -> {json_decode_error, Field@0} end ), gleam@result:'try'(_pipe@1, fun(Response@2) -> case Response@2 of {api_success_response, _, Result} -> {ok, Result}; {api_error_response, _, Error_code, Description} -> {error, {telegram_api_error, Error_code, Description}} end end) end ). -file("src/telega/api.gleam", 124). ?DOC( " Set the webhook URL using [setWebhook](https://core.telegram.org/bots/api#setwebhook) API.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setwebhook\n" ). -spec set_webhook( telega@client:telegram_client(), telega@model@types:set_webhook_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_webhook(Client, Parameters) -> Body = telega@model@encoder:encode_set_webhook_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"setWebhook"/utf8>>, gleam@json:to_string(Body) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 138). ?DOC( " Use this method to get current webhook status.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getwebhookinfo\n" ). -spec get_webhook_info(telega@client:telegram_client()) -> {ok, telega@model@types:webhook_info()} | {error, telega@error:telega_error()}. get_webhook_info(Client) -> _pipe = telega@client:new_get_request( Client, <<"getWebhookInfo"/utf8>>, none ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:webhook_info_decoder()). -file("src/telega/api.gleam", 149). ?DOC( " Use this method to remove webhook integration if you decide to switch back to [getUpdates](https://core.telegram.org/bots/api#getupdates).\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletewebhook\n" ). -spec delete_webhook(telega@client:telegram_client()) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_webhook(Client) -> _pipe = telega@client:new_get_request( Client, <<"deleteWebhook"/utf8>>, none ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 158). ?DOC(" The same as [delete_webhook](#delete_webhook) but also drops all pending updates.\n"). -spec delete_webhook_and_drop_updates(telega@client:telegram_client()) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_webhook_and_drop_updates(Client) -> _pipe = telega@client:new_get_request( Client, <<"deleteWebhook"/utf8>>, {some, [{<<"drop_pending_updates"/utf8>>, <<"true"/utf8>>}]} ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 175). ?DOC( " Use this method to log out from the cloud Bot API server before launching the bot locally.\n" " You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.\n" " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#logout\n" ). -spec log_out(telega@client:telegram_client()) -> {ok, boolean()} | {error, telega@error:telega_error()}. log_out(Client) -> _pipe = telega@client:new_get_request(Client, <<"logOut"/utf8>>, none), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 188). ?DOC( " Use this method to close the bot instance before moving it from one local server to another.\n" " You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart.\n" " The method will return error 429 in the first 10 minutes after the bot is launched.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#close\n" ). -spec close(telega@client:telegram_client()) -> {ok, boolean()} | {error, telega@error:telega_error()}. close(Client) -> _pipe = telega@client:new_get_request(Client, <<"close"/utf8>>, none), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 199). ?DOC( " Use this method to send text messages with additional parameters.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendmessage\n" ). -spec send_message( telega@client:telegram_client(), telega@model@types:send_message_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_message_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 217). ?DOC( " Use this method to send an animated emoji that will display a random value.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#senddice\n" ). -spec send_dice( telega@client:telegram_client(), telega@model@types:send_dice_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_dice(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_dice_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendDice"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 231). ?DOC( " A simple method for testing your bot's authentication token.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getme\n" ). -spec get_me(telega@client:telegram_client()) -> {ok, telega@model@types:user()} | {error, telega@error:telega_error()}. get_me(Client) -> _pipe = telega@client:new_get_request(Client, <<"getMe"/utf8>>, none), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:user_decoder()). -file("src/telega/api.gleam", 244). ?DOC( " Use this method to send answers to callback queries sent from [inline keyboards](https://core.telegram.org/bots/features#inline-keyboards).\n" " The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.\n" " On success, _True_ is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answercallbackquery\n" ). -spec answer_callback_query( telega@client:telegram_client(), telega@model@types:answer_callback_query_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. answer_callback_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_callback_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerCallbackQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 263). ?DOC( " Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded.\n" " On success, the sent Message is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#forwardmessage\n" ). -spec forward_message( telega@client:telegram_client(), telega@model@types:forward_message_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. forward_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_forward_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"forwardMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 285). ?DOC( " Use this method to receive incoming updates using long polling ([wiki](https://en.wikipedia.org/wiki/Push_technology#Long_polling)).\n" "\n" " > Notes\n" " > 1. This method will not work if an outgoing webhook is set up.\n" " > 2. In order to avoid getting duplicate updates, recalculate offset after each server response.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getupdates\n" ). -spec get_updates( telega@client:telegram_client(), gleam@option:option(telega@model@types:get_updates_parameters()) ) -> {ok, list(telega@model@types:update())} | {error, telega@error:telega_error()}. get_updates(Client, Parameters) -> Query = case Parameters of {some, Params} -> {some, telega@model@encoder:encode_get_updates_parameters_as_query( Params )}; none -> none end, _pipe = telega@client:new_get_request(Client, <<"getUpdates"/utf8>>, Query), _pipe@1 = telega@client:fetch(_pipe, Client), map_response( _pipe@1, gleam@dynamic@decode:list(telega@model@decoder:update_decoder()) ). -file("src/telega/api.gleam", 301). ?DOC( " 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](https://core.telegram.org/bots/api#messageid) of the sent messages is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#forwardmessages\n" ). -spec forward_messages( telega@client:telegram_client(), telega@model@types:forward_messages_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. forward_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_forward_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"forwardMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 319). ?DOC( " 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](https://core.telegram.org/bots/api#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](https://core.telegram.org/bots/api#forwardmessage), but the copied message doesn't have a link to the original message. Returns the [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#copymessage\n" ). -spec copy_message( telega@client:telegram_client(), telega@model@types:copy_message_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. copy_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_copy_message_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"copyMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 337). ?DOC( " 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](https://core.telegram.org/bots/api#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](https://core.telegram.org/bots/api#forwardmessage), but the copied message doesn't have a link to the original message. Returns the [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#copymessages\n" ). -spec copy_messages( telega@client:telegram_client(), telega@model@types:copy_messages_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. copy_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_copy_messages_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"copyMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 355). ?DOC( " Use this method to send photos. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendphoto\n" ). -spec send_photo( telega@client:telegram_client(), telega@model@types:send_photo_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_photo_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendPhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 371). ?DOC( " 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](https://core.telegram.org/bots/api#message) is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.\n" "\n" " For sending voice messages, use the [sendVoice](https://core.telegram.org/bots/api#sendvoice) method instead.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendaudio\n" ). -spec send_audio( telega@client:telegram_client(), telega@model@types:send_audio_parameters() ) -> {ok, gleam@http@response:response(binary())} | {error, telega@error:telega_error()}. send_audio(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_audio_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendAudio"/utf8>>, gleam@json:to_string(Body_json) ), telega@client:fetch(_pipe, Client). -file("src/telega/api.gleam", 384). ?DOC( " Use this method to send general files. On success, the sent [Message](https://core.telegram.org/bots/api#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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#senddocument\n" ). -spec send_document( telega@client:telegram_client(), telega@model@types:send_document_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_document(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_document_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendDocument"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 402). ?DOC( " Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendvideo\n" ). -spec send_video( telega@client:telegram_client(), telega@model@types:send_video_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_video(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_video_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendVideo"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 416). ?DOC( " Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendanimation\n" ). -spec send_animation( telega@client:telegram_client(), telega@model@types:send_animation_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_animation(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_animation_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendAnimation"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 434). ?DOC( " 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](https://core.telegram.org/bots/api#message) is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendvoice\n" ). -spec send_voice( telega@client:telegram_client(), telega@model@types:send_voice_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_voice(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_voice_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendVoice"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 448). ?DOC( " Use this method to send video messages. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendvideonote\n" ). -spec send_video_note( telega@client:telegram_client(), telega@model@types:send_video_note_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_video_note(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_video_note_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendVideoNote"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 466). ?DOC( " 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, an array of the sent Messages is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendmediagroup\n" ). -spec send_media_group( telega@client:telegram_client(), telega@model@types:send_media_group_parameters() ) -> {ok, list(telega@model@types:message())} | {error, telega@error:telega_error()}. send_media_group(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_media_group_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendMediaGroup"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:messages_array_decoder()). -file("src/telega/api.gleam", 484). ?DOC( " Use this method to send point on the map. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendlocation\n" ). -spec send_location( telega@client:telegram_client(), telega@model@types:send_location_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_location(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_location_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendLocation"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 502). ?DOC( " Use this method to send information about a venue. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendvenue\n" ). -spec send_venue( telega@client:telegram_client(), telega@model@types:send_venue_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_venue(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_venue_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendVenue"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 516). ?DOC( " Use this method to send phone contacts. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendcontact\n" ). -spec send_contact( telega@client:telegram_client(), telega@model@types:send_contact_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_contact(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_contact_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendContact"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 534). ?DOC( " Use this method to send a native poll. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendpoll\n" ). -spec send_poll( telega@client:telegram_client(), telega@model@types:send_poll_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_poll(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_poll_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendPoll"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 552). ?DOC( " 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.\n" "\n" " > Example: The [ImageBot](https://t.me/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](https://core.telegram.org/bots/api#sendchataction) with action = upload_photo. The user will see a \"sending photo\" status for the bot.\n" "\n" " We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendchataction\n" ). -spec send_chat_action( telega@client:telegram_client(), telega@model@types:send_chat_action_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. send_chat_action(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_chat_action_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendChatAction"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 570). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmessagereaction\n" ). -spec set_message_reaction( telega@client:telegram_client(), telega@model@types:set_message_reaction_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_message_reaction(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_message_reaction_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setMessageReaction"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 588). ?DOC( " Use this method to get a list of profile pictures for a user. Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getuserprofilephotos\n" ). -spec get_user_profile_photos( telega@client:telegram_client(), telega@model@types:get_user_profile_photos_parameters() ) -> {ok, telega@model@types:user_profile_photos()} | {error, telega@error:telega_error()}. get_user_profile_photos(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_user_profile_photos_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getUserProfilePhotos"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:user_profile_photos_decoder()). -file("src/telega/api.gleam", 606). ?DOC( " Use this method to get a list of profile audios of a user.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getuserprofileaudios\n" ). -spec get_user_profile_audios( telega@client:telegram_client(), telega@model@types:get_user_profile_audios_parameters() ) -> {ok, telega@model@types:user_profile_audios()} | {error, telega@error:telega_error()}. get_user_profile_audios(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_user_profile_audios_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getUserProfileAudios"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:user_profile_audios_decoder()). -file("src/telega/api.gleam", 624). ?DOC( " Use this method to set the bot's profile photo. Returns True on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmyprofilephoto\n" ). -spec set_my_profile_photo( telega@client:telegram_client(), telega@model@types:set_my_profile_photo_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_profile_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_my_profile_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setMyProfilePhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 642). ?DOC( " Use this method to remove the bot's profile photo. Returns True on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#removemyprofilephoto\n" ). -spec remove_my_profile_photo(telega@client:telegram_client()) -> {ok, boolean()} | {error, telega@error:telega_error()}. remove_my_profile_photo(Client) -> _pipe = telega@client:new_post_request( Client, <<"removeMyProfilePhoto"/utf8>>, <<"{}"/utf8>> ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 653). ?DOC( " Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editmessagetext\n" ). -spec edit_message_text( telega@client:telegram_client(), telega@model@types:edit_message_text_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. edit_message_text(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_message_text_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editMessageText"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 671). ?DOC( " Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editmessagecaption\n" ). -spec edit_message_caption( telega@client:telegram_client(), telega@model@types:edit_message_caption_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. edit_message_caption(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_message_caption_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editMessageCaption"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 689). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editmessagemedia\n" ). -spec edit_message_media( telega@client:telegram_client(), telega@model@types:edit_message_media_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. edit_message_media(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_message_media_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editMessageMedia"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 707). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editmessagelivelocation\n" ). -spec edit_message_live_location( telega@client:telegram_client(), telega@model@types:edit_message_live_location_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. edit_message_live_location(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_message_live_location_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editMessageLiveLocation"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 726). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#stopmessagelivelocation\n" ). -spec stop_message_live_location( telega@client:telegram_client(), telega@model@types:stop_message_live_location_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. stop_message_live_location(Client, Parameters) -> Body_json = telega@model@encoder:encode_stop_message_live_location_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"stopMessageLiveLocation"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 745). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editmessagereplymarkup\n" ). -spec edit_message_reply_markup( telega@client:telegram_client(), telega@model@types:edit_message_reply_markup_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. edit_message_reply_markup(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_message_reply_markup_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editMessageReplyMarkup"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 764). ?DOC( " Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#stoppoll\n" ). -spec stop_poll( telega@client:telegram_client(), telega@model@types:stop_poll_parameters() ) -> {ok, telega@model@types:poll()} | {error, telega@error:telega_error()}. stop_poll(Client, Parameters) -> Body_json = telega@model@encoder:encode_stop_poll_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"stopPoll"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:poll_decoder()). -file("src/telega/api.gleam", 787). ?DOC( " Use this method to delete a message, including service messages, with the following limitations:\n" " - A message can only be deleted if it was sent less than 48 hours ago.\n" " - Service messages about a supergroup, channel, or forum topic creation can't be deleted.\n" " - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.\n" " - Bots can delete outgoing messages in private chats, groups, and supergroups.\n" " - Bots can delete incoming messages in private chats.\n" " - Bots granted can_post_messages permissions can delete outgoing messages in channels.\n" " - If the bot is an administrator of a group, it can delete any message there.\n" " - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.\n" " Returns True on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletemessage\n" ). -spec delete_message( telega@client:telegram_client(), telega@model@types:delete_message_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 805). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletemessagessimultaneously\n" ). -spec delete_messages( telega@client:telegram_client(), telega@model@types:delete_messages_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 823). ?DOC( " Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getavailablegifts\n" ). -spec get_available_gifts(telega@client:telegram_client()) -> {ok, telega@model@types:gifts()} | {error, telega@error:telega_error()}. get_available_gifts(Client) -> _pipe = telega@client:new_get_request( Client, <<"getAvailableGifts"/utf8>>, none ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:gifts_decoder()). -file("src/telega/api.gleam", 834). ?DOC( " Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendgift\n" ). -spec send_gift( telega@client:telegram_client(), telega@model@types:send_gift_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. send_gift(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_gift_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendGift"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 848). ?DOC( " Gifts a Telegram Premium subscription to the given user. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#giftpremium\n" ). -spec gift_premium( telega@client:telegram_client(), telega@model@types:gift_premium_subscription_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. gift_premium(Client, Parameters) -> Body_json = telega@model@encoder:encode_gift_premium_subscription_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"giftPremium"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 867). ?DOC( " Verifies a user [on behalf of the organization](https://core.telegram.org/bots/api#verifyuser) which is represented by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#verifyuser\n" ). -spec verify_user( telega@client:telegram_client(), telega@model@types:verify_user_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. verify_user(Client, Parameters) -> Body_json = telega@model@encoder:encode_verify_user_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"verifyUser"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 881). ?DOC( " Verifies a chat [on behalf of the organization](https://core.telegram.org/bots/api#verifychat) which is represented by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#verifychat\n" ). -spec verify_chat( telega@client:telegram_client(), telega@model@types:verify_chat_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. verify_chat(Client, Parameters) -> Body_json = telega@model@encoder:encode_verify_chat_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"verifyChat"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 895). ?DOC( " Removes verification from a user who is currently verified [on behalf of the organization](https://core.telegram.org/bots/api#removeuserverification) represented by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#removeuserverification\n" ). -spec remove_user_verification( telega@client:telegram_client(), telega@model@types:remove_user_verification_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. remove_user_verification(Client, Parameters) -> Body_json = telega@model@encoder:encode_remove_user_verification_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"removeUserVerification"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 913). ?DOC( " Removes verification from a chat that is currently verified [on behalf of the organization](https://core.telegram.org/bots/api#removechatverification) represented by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#removechatverification\n" ). -spec remove_chat_verification( telega@client:telegram_client(), telega@model@types:remove_chat_verification_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. remove_chat_verification(Client, Parameters) -> Body_json = telega@model@encoder:encode_remove_chat_verification_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"removeChatVerification"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 931). ?DOC( " Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#readbusinessmessage\n" ). -spec read_business_message( telega@client:telegram_client(), telega@model@types:read_business_message_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. read_business_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_read_business_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"readBusinessMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 949). ?DOC( " Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletebusinessmessages\n" ). -spec delete_business_messages( telega@client:telegram_client(), telega@model@types:delete_business_messages_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_business_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_business_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteBusinessMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 967). ?DOC( " Changes the username of a managed business account. Requires the can_change_username business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountusername\n" ). -spec set_business_account_username( telega@client:telegram_client(), telega@model@types:set_business_account_username_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_business_account_username(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_business_account_username_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setBusinessAccountUsername"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 986). ?DOC( " Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountbio\n" ). -spec set_business_account_bio( telega@client:telegram_client(), telega@model@types:set_business_account_bio_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_business_account_bio(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_business_account_bio_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setBusinessAccountBio"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1004). ?DOC( " Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountname\n" ). -spec set_business_account_name( telega@client:telegram_client(), telega@model@types:set_business_account_name_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_business_account_name(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_business_account_name_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setBusinessAccountName"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1023). ?DOC( " Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountprofilephoto\n" ). -spec set_business_account_profile_photo( telega@client:telegram_client(), telega@model@types:set_business_account_profile_photo_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_business_account_profile_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_business_account_profile_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setBusinessAccountProfilePhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1042). ?DOC( " Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#removebusinessaccountprofilephoto\n" ). -spec remove_business_account_profile_photo( telega@client:telegram_client(), telega@model@types:remove_business_account_profile_photo_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. remove_business_account_profile_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_remove_business_account_profile_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"removeBusinessAccountProfilePhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1061). ?DOC( " Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountgiftsettings\n" ). -spec set_business_account_gift_settings( telega@client:telegram_client(), telega@model@types:set_business_account_gift_settings_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_business_account_gift_settings(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_business_account_gift_settings_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setBusinessAccountGiftSettings"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1080). ?DOC( " Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns [StarAmount](https://core.telegram.org/bots/api#staramount) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountstarbalance\n" ). -spec get_business_account_star_balance( telega@client:telegram_client(), telega@model@types:get_business_account_star_balance_parameters() ) -> {ok, telega@model@types:star_amount()} | {error, telega@error:telega_error()}. get_business_account_star_balance(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_business_account_star_balance_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getBusinessAccountStarBalance"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:star_amount_decoder()). -file("src/telega/api.gleam", 1099). ?DOC( " Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#transferbusinessaccountstars\n" ). -spec transfer_business_account_stars( telega@client:telegram_client(), telega@model@types:transfer_business_account_stars_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. transfer_business_account_stars(Client, Parameters) -> Body_json = telega@model@encoder:encode_transfer_business_account_stars_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"transferBusinessAccountStars"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1118). ?DOC( " Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountgifts\n" ). -spec get_business_account_gifts( telega@client:telegram_client(), telega@model@types:get_business_account_gifts_parameters() ) -> {ok, telega@model@types:owned_gifts()} | {error, telega@error:telega_error()}. get_business_account_gifts(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_business_account_gifts_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getBusinessAccountGifts"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:owned_gifts_decoder()). -file("src/telega/api.gleam", 1137). ?DOC( " Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#convertgifttostars\n" ). -spec convert_gift_to_stars( telega@client:telegram_client(), telega@model@types:convert_gift_to_stars_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. convert_gift_to_stars(Client, Parameters) -> Body_json = telega@model@encoder:encode_convert_gift_to_stars_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"convertGiftToStars"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1155). ?DOC( " Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#upgradegift\n" ). -spec upgrade_gift( telega@client:telegram_client(), telega@model@types:upgrade_gift_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. upgrade_gift(Client, Parameters) -> Body_json = telega@model@encoder:encode_upgrade_gift_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"upgradeGift"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1173). ?DOC( " Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#transfergift\n" ). -spec transfer_gift( telega@client:telegram_client(), telega@model@types:transfer_gift_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. transfer_gift(Client, Parameters) -> Body_json = telega@model@encoder:encode_transfer_gift_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"transferGift"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1191). ?DOC( " Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns [Story](https://core.telegram.org/bots/api#story) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#poststory\n" ). -spec post_business_story( telega@client:telegram_client(), telega@model@types:post_story_parameters() ) -> {ok, telega@model@types:story()} | {error, telega@error:telega_error()}. post_business_story(Client, Parameters) -> Body_json = telega@model@encoder:encode_post_story_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"postStory"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:story_decoder()). -file("src/telega/api.gleam", 1205). ?DOC( " Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns [Story](https://core.telegram.org/bots/api#story) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editstory\n" ). -spec edit_story( telega@client:telegram_client(), telega@model@types:edit_story_parameters() ) -> {ok, telega@model@types:story()} | {error, telega@error:telega_error()}. edit_story(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_story_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"editStory"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:story_decoder()). -file("src/telega/api.gleam", 1219). ?DOC( " Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletestory\n" ). -spec delete_story( telega@client:telegram_client(), telega@model@types:delete_story_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_story(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_story_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"deleteStory"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1237). ?DOC( " Use this method to get up-to-date information about the chat. Returns a [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchat\n" ). -spec get_chat(telega@client:telegram_client(), binary()) -> {ok, telega@model@types:chat_full_info()} | {error, telega@error:telega_error()}. get_chat(Client, Chat_id) -> _pipe = telega@client:new_get_request( Client, <<"getChat"/utf8>>, {some, [{<<"chat_id"/utf8>>, Chat_id}]} ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_full_info_decoder()). -file("src/telega/api.gleam", 1249). ?DOC( " 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/`, where `` 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getfile\n" ). -spec get_file(telega@client:telegram_client(), binary()) -> {ok, telega@model@types:file()} | {error, telega@error:telega_error()}. get_file(Client, File_id) -> _pipe = telega@client:new_get_request( Client, <<"getFile"/utf8>>, {some, [{<<"file_id"/utf8>>, File_id}]} ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:file_decoder()). -file("src/telega/api.gleam", 1261). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#banchatmember\n" ). -spec ban_chat_member( telega@client:telegram_client(), telega@model@types:ban_chat_member_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. ban_chat_member(Client, Parameters) -> Body_json = telega@model@encoder:encode_ban_chat_member_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"banChatMember"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1279). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unbanchatmember\n" ). -spec unban_chat_member( telega@client:telegram_client(), telega@model@types:unban_chat_member_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unban_chat_member(Client, Parameters) -> Body_json = telega@model@encoder:encode_unban_chat_member_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unbanChatMember"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1297). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#restrictchatmember\n" ). -spec restrict_chat_member( telega@client:telegram_client(), telega@model@types:restrict_chat_member_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. restrict_chat_member(Client, Parameters) -> Body_json = telega@model@encoder:encode_restrict_chat_member_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"restrictChatMember"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1315). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#promotechatmember\n" ). -spec promote_chat_member( telega@client:telegram_client(), telega@model@types:promote_chat_member_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. promote_chat_member(Client, Parameters) -> Body_json = telega@model@encoder:encode_promote_chat_member_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"promoteChatMember"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1333). ?DOC( " Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatadministratorcustomtitle\n" ). -spec set_chat_administrator_custom_title( telega@client:telegram_client(), telega@model@types:set_chat_administrator_custom_title_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_administrator_custom_title(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_administrator_custom_title_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatAdministratorCustomTitle"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1352). ?DOC( " Use this method to ban a channel chat in a supergroup or a channel. Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#banchatsenderchat\n" ). -spec ban_chat_sender_chat( telega@client:telegram_client(), telega@model@types:ban_chat_sender_chat_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. ban_chat_sender_chat(Client, Parameters) -> Body_json = telega@model@encoder:encode_ban_chat_sender_chat_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"banChatSenderChat"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1370). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unbanchatsenderchat\n" ). -spec unban_chat_sender_chat( telega@client:telegram_client(), telega@model@types:unban_chat_sender_chat_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unban_chat_sender_chat(Client, Parameters) -> Body_json = telega@model@encoder:encode_unban_chat_sender_chat_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unbanChatSenderChat"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1388). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatpermissions\n" ). -spec set_chat_permissions( telega@client:telegram_client(), telega@model@types:set_chat_permissions_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_permissions(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_permissions_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatPermissions"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1408). ?DOC( " 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.\n" "\n" " > 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](https://core.telegram.org/bots/api#exportchatinvitelink) or by calling the [getChat](https://core.telegram.org/bots/api#getchat) method. If your bot needs to generate a new primary invite link replacing its previous one, use [exportChatInviteLink](https://core.telegram.org/bots/api#exportchatinvitelink) again.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#exportchatinvitelink\n" ). -spec export_chat_invite_link( telega@client:telegram_client(), telega@model@types:export_chat_invite_link_parameters() ) -> {ok, binary()} | {error, telega@error:telega_error()}. export_chat_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_export_chat_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"exportChatInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_string/1}). -file("src/telega/api.gleam", 1426). ?DOC( " 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](https://core.telegram.org/bots/api#revokechatinvitelink). Returns the new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#createchatinvitelink\n" ). -spec create_chat_invite_link( telega@client:telegram_client(), telega@model@types:create_chat_invite_link_parameters() ) -> {ok, telega@model@types:chat_invite_link()} | {error, telega@error:telega_error()}. create_chat_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_create_chat_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"createChatInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_invite_link_decoder()). -file("src/telega/api.gleam", 1444). ?DOC( " 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](https://core.telegram.org/bots/api#chatinvitelink) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editchatinvitelink\n" ). -spec edit_chat_invite_link( telega@client:telegram_client(), telega@model@types:edit_chat_invite_link_parameters() ) -> {ok, telega@model@types:chat_invite_link()} | {error, telega@error:telega_error()}. edit_chat_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_chat_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editChatInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_invite_link_decoder()). -file("src/telega/api.gleam", 1462). ?DOC( " Use this method to create a [subscription invite link](https://core.telegram.org/bots/api#chatinvitelink) for a channel chat. The bot must have the `can_invite_users` administrator rights. The link can be edited using the method [editChatSubscriptionInviteLink](https://core.telegram.org/bots/api#editchatsubscriptioninvitelink) or revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink). Returns the new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#createchatsubscriptioninvitelink\n" ). -spec create_chat_subscription_invite_link( telega@client:telegram_client(), telega@model@types:create_chat_subscription_invite_link_parameters() ) -> {ok, telega@model@types:chat_invite_link()} | {error, telega@error:telega_error()}. create_chat_subscription_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_create_chat_subscription_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"createChatSubscriptionInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_invite_link_decoder()). -file("src/telega/api.gleam", 1481). ?DOC( " 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](https://core.telegram.org/bots/api#chatinvitelink) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editchatsubscriptioninvitelink\n" ). -spec edit_chat_subscription_invite_link( telega@client:telegram_client(), telega@model@types:edit_chat_subscription_invite_link_parameters() ) -> {ok, telega@model@types:chat_invite_link()} | {error, telega@error:telega_error()}. edit_chat_subscription_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_chat_subscription_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editChatSubscriptionInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_invite_link_decoder()). -file("src/telega/api.gleam", 1500). ?DOC( " 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](https://core.telegram.org/bots/api#chatinvitelink) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#revokechatinvitelink\n" ). -spec revoke_chat_invite_link( telega@client:telegram_client(), telega@model@types:revoke_chat_invite_link_parameters() ) -> {ok, telega@model@types:chat_invite_link()} | {error, telega@error:telega_error()}. revoke_chat_invite_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_revoke_chat_invite_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"revokeChatInviteLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_invite_link_decoder()). -file("src/telega/api.gleam", 1518). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#approvechatjoinrequest\n" ). -spec approve_chat_join_request( telega@client:telegram_client(), telega@model@types:approve_chat_join_request_parameters() ) -> {ok, gleam@http@response:response(binary())} | {error, telega@error:telega_error()}. approve_chat_join_request(Client, Parameters) -> Body_json = telega@model@encoder:encode_approve_chat_join_request_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"approveChatJoinRequest"/utf8>>, gleam@json:to_string(Body_json) ), telega@client:fetch(_pipe, Client). -file("src/telega/api.gleam", 1536). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#declinechatjoinrequest\n" ). -spec decline_chat_join_request( telega@client:telegram_client(), telega@model@types:decline_chat_join_request_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. decline_chat_join_request(Client, Parameters) -> Body_json = telega@model@encoder:encode_decline_chat_join_request_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"declineChatJoinRequest"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1555). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatphoto\n" ). -spec set_chat_photo( telega@client:telegram_client(), telega@model@types:set_chat_photo_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatPhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1573). ?DOC( " 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletechatphoto\n" ). -spec delete_chat_photo( telega@client:telegram_client(), telega@model@types:delete_chat_photo_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_chat_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_chat_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteChatPhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1591). ?DOC( " Use this method to change the title of a chat. Titles 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.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchattitle\n" ). -spec set_chat_title( telega@client:telegram_client(), telega@model@types:set_chat_title_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_title(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_title_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatTitle"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1609). ?DOC( " Use this method to change the description of a group, 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. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatdescription\n" ). -spec set_chat_description( telega@client:telegram_client(), telega@model@types:set_chat_description_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_description(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_description_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatDescription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1627). ?DOC( " Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#pinchatmessage\n" ). -spec pin_chat_message( telega@client:telegram_client(), telega@model@types:pin_chat_message_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. pin_chat_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_pin_chat_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"pinChatMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1645). ?DOC( " Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unpinchatmessage\n" ). -spec unpin_chat_message( telega@client:telegram_client(), telega@model@types:unpin_chat_message_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unpin_chat_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_unpin_chat_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unpinChatMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1663). ?DOC( " Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#clearchatpinnedmessages\n" ). -spec unpin_all_chat_messages( telega@client:telegram_client(), telega@model@types:unpin_all_chat_messages_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unpin_all_chat_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_unpin_all_chat_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unpinAllChatMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1681). ?DOC( " Use this method for your bot to leave a group, supergroup or channel. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#leavechat\n" ). -spec leave_chat( telega@client:telegram_client(), telega@model@types:leave_chat_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. leave_chat(Client, Parameters) -> Body_json = telega@model@encoder:encode_leave_chat_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"leaveChat"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1695). ?DOC( " Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchatadministrators\n" ). -spec get_chat_administrators( telega@client:telegram_client(), telega@model@types:get_chat_administrators_parameters() ) -> {ok, list(telega@model@types:chat_member())} | {error, telega@error:telega_error()}. get_chat_administrators(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_chat_administrators_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getChatAdministrators"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response( _pipe@1, gleam@dynamic@decode:list(telega@model@decoder:chat_member_decoder()) ). -file("src/telega/api.gleam", 1713). ?DOC( " Use this method to get the number of members in a chat. Returns `Int` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchatmembercount\n" ). -spec get_chat_member_count( telega@client:telegram_client(), telega@model@types:get_chat_member_count_parameters() ) -> {ok, integer()} | {error, telega@error:telega_error()}. get_chat_member_count(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_chat_member_count_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getChatMemberCount"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_int/1}). -file("src/telega/api.gleam", 1731). ?DOC( " Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchatmember\n" ). -spec get_chat_member( telega@client:telegram_client(), telega@model@types:get_chat_member_parameters() ) -> {ok, telega@model@types:chat_member()} | {error, telega@error:telega_error()}. get_chat_member(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_chat_member_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getChatMember"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:chat_member_decoder()). -file("src/telega/api.gleam", 1749). ?DOC( " Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field `can_set_sticker_set` optionally returned in `getChat` requests to check if the bot can use this method. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatstickerset\n" ). -spec set_chat_sticker_set( telega@client:telegram_client(), telega@model@types:set_chat_sticker_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_sticker_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_chat_sticker_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setChatStickerSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1767). ?DOC( " Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field `can_set_sticker_set` optionally returned in `getChat` requests to check if the bot can use this method. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletechatstickerset\n" ). -spec delete_chat_sticker_set( telega@client:telegram_client(), telega@model@types:delete_chat_sticker_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_chat_sticker_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_chat_sticker_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteChatStickerSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1785). ?DOC( " Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getforumtopiciconstickers\n" ). -spec get_forum_topic_icon_stickers(telega@client:telegram_client()) -> {ok, list(telega@model@types:sticker())} | {error, telega@error:telega_error()}. get_forum_topic_icon_stickers(Client) -> _pipe = telega@client:new_get_request( Client, <<"getForumTopicIconStickers"/utf8>>, none ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response( _pipe@1, gleam@dynamic@decode:list(telega@model@decoder:sticker_decoder()) ). -file("src/telega/api.gleam", 1796). ?DOC( " Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#createforumtopic\n" ). -spec create_forum_topic( telega@client:telegram_client(), telega@model@types:create_forum_topic_parameters() ) -> {ok, telega@model@types:forum_topic()} | {error, telega@error:telega_error()}. create_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_create_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"createForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:forum_topic_decoder()). -file("src/telega/api.gleam", 1814). ?DOC( " Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights, unless it is the creator of the topic. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editforumtopic\n" ). -spec edit_forum_topic( telega@client:telegram_client(), telega@model@types:edit_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1832). ?DOC( " Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights, unless it is the creator of the topic. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#closeforumtopic\n" ). -spec close_forum_topic( telega@client:telegram_client(), telega@model@types:close_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. close_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_close_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"closeForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1850). ?DOC( " Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights, unless it is the creator of the topic. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#reopenforumtopic\n" ). -spec reopen_forum_topic( telega@client:telegram_client(), telega@model@types:reopen_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. reopen_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_reopen_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"reopenForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1868). ?DOC( " Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_delete_messages` administrator rights. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deleteforumtopic\n" ). -spec delete_forum_topic( telega@client:telegram_client(), telega@model@types:delete_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1886). ?DOC( " Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the `can_pin_messages` administrator right in the supergroup. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unpinallforumtopicpinnedmessages\n" ). -spec unpin_all_forum_topic_pinned_messages( telega@client:telegram_client(), telega@model@types:unpin_all_forum_topic_messages_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unpin_all_forum_topic_pinned_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_unpin_all_forum_topic_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unpinAllForumTopicMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1905). ?DOC( " Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editgeneralforumtopic\n" ). -spec edit_general_forum_topic( telega@client:telegram_client(), telega@model@types:edit_general_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_general_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_general_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editGeneralForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1923). ?DOC( " Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#closegeneralforumtopic\n" ). -spec close_general_forum_topic( telega@client:telegram_client(), telega@model@types:close_general_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. close_general_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_close_general_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"closeGeneralForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1942). ?DOC( " Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. The topic will be automatically unhidden if it was hidden. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#reopengeneralforumtopic\n" ). -spec reopen_general_forum_topic( telega@client:telegram_client(), telega@model@types:reopen_general_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. reopen_general_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_reopen_general_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"reopenGeneralForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1961). ?DOC( " Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. The topic will be automatically closed if it was open. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#hidegeneralforumtopic\n" ). -spec hide_general_forum_topic( telega@client:telegram_client(), telega@model@types:hide_general_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. hide_general_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_hide_general_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"hideGeneralForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1979). ?DOC( " Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the `can_manage_topics` administrator rights. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unhidegeneralforumtopic\n" ). -spec unhide_general_forum_topic( telega@client:telegram_client(), telega@model@types:unhide_general_forum_topic_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unhide_general_forum_topic(Client, Parameters) -> Body_json = telega@model@encoder:encode_unhide_general_forum_topic_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unhideGeneralForumTopic"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 1998). ?DOC( " Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the `can_pin_messages` administrator right in the supergroup. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages\n" ). -spec unpin_all_general_forum_topic_messages( telega@client:telegram_client(), telega@model@types:unpin_all_general_forum_topic_pinned_messages_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. unpin_all_general_forum_topic_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_unpin_all_general_forum_topic_pinned_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"unpinAllGeneralForumTopicMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2019). ?DOC( " Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getuserchatboosts\n" ). -spec get_user_chat_boosts( telega@client:telegram_client(), telega@model@types:get_user_chat_boosts_parameters() ) -> {ok, telega@model@types:user_chat_boosts()} | {error, telega@error:telega_error()}. get_user_chat_boosts(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_user_chat_boosts_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getUserChatBoosts"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:user_chat_boosts_decoder()). -file("src/telega/api.gleam", 2037). ?DOC( " Use this method to get information about the connection of the bot with a business account. Returns a [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getbusinessconnection\n" ). -spec get_business_connection( telega@client:telegram_client(), telega@model@types:get_business_connection_parameters() ) -> {ok, telega@model@types:business_connection()} | {error, telega@error:telega_error()}. get_business_connection(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_business_connection_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getBusinessConnection"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:business_connection_decoder()). -file("src/telega/api.gleam", 2055). ?DOC( " Use this method to change the list of the bot's commands. See [commands documentation](https://core.telegram.org/bots/features#commands) for more details about bot commands.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmycommands\n" ). -spec set_my_commands( telega@client:telegram_client(), list(telega@model@types:bot_command()), gleam@option:option(telega@model@types:bot_command_parameters()) ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_commands(Client, Commands, Parameters) -> Parameters@1 = begin _pipe = gleam@option:unwrap( Parameters, telega@model@types:default_bot_command_parameters() ), telega@model@encoder:encode_bot_command_parameters(_pipe) end, Body_json = gleam@json:object( [{<<"commands"/utf8>>, gleam@json:array( Commands, fun(Command) -> gleam@json:object( [{<<"command"/utf8>>, gleam@json:string( erlang:element(2, Command) )}, {<<"description"/utf8>>, gleam@json:string( erlang:element(3, Command) )} | Parameters@1] ) end )}] ), _pipe@1 = telega@client:new_post_request( Client, <<"setMyCommands"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@2 = telega@client:fetch(_pipe@1, Client), map_response(_pipe@2, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2091). ?DOC( " Use this method to delete the list of the bot's commands for the given scope and user language.\n" " After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletemycommands\n" ). -spec delete_my_commands( telega@client:telegram_client(), gleam@option:option(telega@model@types:bot_command_parameters()) ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_my_commands(Client, Parameters) -> Parameters@1 = begin _pipe = gleam@option:unwrap( Parameters, telega@model@types:default_bot_command_parameters() ), telega@model@encoder:encode_bot_command_parameters(_pipe) end, Body_json = gleam@json:object(Parameters@1), _pipe@1 = telega@client:new_post_request( Client, <<"deleteMyCommands"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@2 = telega@client:fetch(_pipe@1, Client), map_response(_pipe@2, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2113). ?DOC( " Use this method to get the current list of the bot's commands for the given scope and user language.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmycommands\n" ). -spec get_my_commands( telega@client:telegram_client(), gleam@option:option(telega@model@types:bot_command_parameters()) ) -> {ok, telega@model@types:bot_command()} | {error, telega@error:telega_error()}. get_my_commands(Client, Parameters) -> Parameters@1 = begin _pipe = gleam@option:unwrap( Parameters, telega@model@types:default_bot_command_parameters() ), telega@model@encoder:encode_bot_command_parameters(_pipe) end, Body_json = gleam@json:object(Parameters@1), _pipe@1 = telega@client:new_post_request( Client, <<"getMyCommands"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@2 = telega@client:fetch(_pipe@1, Client), map_response(_pipe@2, telega@model@decoder:bot_command_decoder()). -file("src/telega/api.gleam", 2135). ?DOC( " Use this method to change the bot's name. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmyname\n" ). -spec set_my_name( telega@client:telegram_client(), telega@model@types:set_my_name_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_name(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_my_name_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"setMyName"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2149). ?DOC( " Use this method to get the current bot name for the given user language. Returns [BotName](https://core.telegram.org/bots/api#botname) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmyname\n" ). -spec get_my_name( telega@client:telegram_client(), telega@model@types:get_my_name_parameters() ) -> {ok, telega@model@types:bot_name()} | {error, telega@error:telega_error()}. get_my_name(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_my_name_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"getMyName"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:bot_name_decoder()). -file("src/telega/api.gleam", 2163). ?DOC( " Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmydescription\n" ). -spec set_my_description( telega@client:telegram_client(), telega@model@types:set_my_description_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_description(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_my_description_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setMyDescription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2181). ?DOC( " Use this method to get the current bot description for the given user language. Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmydescription\n" ). -spec get_my_description( telega@client:telegram_client(), telega@model@types:get_my_description_parameters() ) -> {ok, telega@model@types:bot_description()} | {error, telega@error:telega_error()}. get_my_description(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_my_description_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getMyDescription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:bot_description_decoder()). -file("src/telega/api.gleam", 2199). ?DOC( " Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmyshortdescription\n" ). -spec set_my_short_description( telega@client:telegram_client(), telega@model@types:set_my_short_description_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_short_description(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_my_short_description_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setMyShortDescription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2217). ?DOC( " Use this method to get the current bot short description for the given user language. Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmyshortdescription\n" ). -spec get_my_short_description( telega@client:telegram_client(), telega@model@types:get_my_short_description_parameters() ) -> {ok, telega@model@types:bot_short_description()} | {error, telega@error:telega_error()}. get_my_short_description(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_my_short_description_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getMyShortDescription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:bot_short_description_decoder()). -file("src/telega/api.gleam", 2235). ?DOC( " Use this method to change the bot's menu button in a private chat, or the default menu button. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setchatmenubutton\n" ). -spec set_chat_menu_button( telega@client:telegram_client(), telega@model@types:set_chat_menu_button_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_chat_menu_button(Client, Parameters) -> _pipe@1 = telega@client:new_post_request( Client, <<"setChatMenuButton"/utf8>>, begin _pipe = telega@model@encoder:encode_set_chat_menu_button_parameters( Parameters ), gleam@json:to_string(_pipe) end ), _pipe@2 = telega@client:fetch(_pipe@1, Client), map_response(_pipe@2, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2252). ?DOC( " Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns [MenuButton](https://core.telegram.org/bots/api#menubutton) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchatmenubutton\n" ). -spec get_chat_menu_button( telega@client:telegram_client(), telega@model@types:get_chat_menu_button_parameters() ) -> {ok, telega@model@types:menu_button()} | {error, telega@error:telega_error()}. get_chat_menu_button(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_chat_menu_button_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getChatMenuButton"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:menu_button_decoder()). -file("src/telega/api.gleam", 2270). ?DOC( " Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmydefaultadministratorrights\n" ). -spec set_my_default_administrator_rights( telega@client:telegram_client(), telega@model@types:set_my_default_administrator_rights_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_my_default_administrator_rights(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_my_default_administrator_rights_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setMyDefaultAdministratorRights"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2289). ?DOC( " Use this method to get the current default administrator rights of the bot. Returns [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmydefaultadministratorrights\n" ). -spec get_my_default_administrator_rights( telega@client:telegram_client(), telega@model@types:get_my_default_administrator_rights_parameters() ) -> {ok, telega@model@types:chat_administrator_rights()} | {error, telega@error:telega_error()}. get_my_default_administrator_rights(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_my_default_administrator_rights_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getMyDefaultAdministratorRights"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response( _pipe@1, telega@model@decoder:chat_administrator_rights_decoder() ). -file("src/telega/api.gleam", 2308). ?DOC( " Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS, or [video](https://telegram.org/blog/video-stickers-better-reactions/ru?ln=a) .WEBM stickers. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendsticker\n" ). -spec send_sticker( telega@client:telegram_client(), telega@model@types:send_sticker_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_sticker(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_sticker_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendSticker"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2326). ?DOC( " Use this method to get a sticker set. On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getstickerset\n" ). -spec get_sticker_set( telega@client:telegram_client(), telega@model@types:get_sticker_set_parameters() ) -> {ok, telega@model@types:sticker_set()} | {error, telega@error:telega_error()}. get_sticker_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_sticker_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getStickerSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:sticker_set_decoder()). -file("src/telega/api.gleam", 2344). ?DOC( " Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getcustomemojistickers\n" ). -spec get_custom_emoji_stickers( telega@client:telegram_client(), telega@model@types:get_custom_emoji_stickers_parameters() ) -> {ok, telega@model@types:sticker()} | {error, telega@error:telega_error()}. get_custom_emoji_stickers(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_custom_emoji_stickers_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getCustomEmojiStickers"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:sticker_decoder()). -file("src/telega/api.gleam", 2363). ?DOC( " Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api#createnewstickerset), [addStickerToSet](https://core.telegram.org/bots/api#addstickertoset), or [replaceStickerInSet](https://core.telegram.org/bots/api#replacestickerinset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api#file) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#uploadstickerfile\n" ). -spec upload_sticker_file( telega@client:telegram_client(), telega@model@types:upload_sticker_file_parameters() ) -> {ok, telega@model@types:file()} | {error, telega@error:telega_error()}. upload_sticker_file(Client, Parameters) -> Body_json = telega@model@encoder:encode_upload_sticker_file_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"uploadStickerFile"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:file_decoder()). -file("src/telega/api.gleam", 2381). ?DOC( " Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#createnewstickerset\n" ). -spec create_new_sticker_set( telega@client:telegram_client(), telega@model@types:create_new_sticker_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. create_new_sticker_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_create_new_sticker_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"createNewStickerSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2399). ?DOC( " Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#addstickertoset\n" ). -spec add_sticker_to_set( telega@client:telegram_client(), telega@model@types:add_sticker_to_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. add_sticker_to_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_add_sticker_to_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"addStickerToSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2417). ?DOC( " Use this method to move a sticker in a set to a specific position. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickerpositioninset\n" ). -spec set_sticker_position_in_set( telega@client:telegram_client(), telega@model@types:set_sticker_position_in_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_position_in_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_position_in_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerPositionInSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2436). ?DOC( " Use this method to delete a sticker from a set created by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletestickerfromset\n" ). -spec delete_sticker_from_set( telega@client:telegram_client(), telega@model@types:delete_sticker_from_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_sticker_from_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_sticker_from_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteStickerFromSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2454). ?DOC( " Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#replacestickerinset\n" ). -spec replace_sticker_in_set( telega@client:telegram_client(), telega@model@types:replace_sticker_in_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. replace_sticker_in_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_replace_sticker_in_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"replaceStickerInSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2472). ?DOC( " Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickeremojilist\n" ). -spec set_sticker_emoji_list( telega@client:telegram_client(), telega@model@types:set_sticker_emoji_list_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_emoji_list(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_emoji_list_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerEmojiList"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2490). ?DOC( " Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickerkeywords\n" ). -spec set_sticker_keywords( telega@client:telegram_client(), telega@model@types:set_sticker_keywords_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_keywords(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_keywords_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerKeywords"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2508). ?DOC( " Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickermaskposition\n" ). -spec set_sticker_mask_position( telega@client:telegram_client(), telega@model@types:set_sticker_mask_position_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_mask_position(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_mask_position_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerMaskPosition"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2527). ?DOC( " Use this method to set the title of a created sticker set. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickersettitle\n" ). -spec set_sticker_set_title( telega@client:telegram_client(), telega@model@types:set_sticker_set_title_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_set_title(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_set_title_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerSetTitle"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2545). ?DOC( " Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setstickersetthumbnail\n" ). -spec set_sticker_set_thumbnail( telega@client:telegram_client(), telega@model@types:set_sticker_set_thumbnail_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_sticker_set_thumbnail(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_sticker_set_thumbnail_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setStickerSetThumbnail"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2564). ?DOC( " Use this method to set the thumbnail of a custom emoji sticker set. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail\n" ). -spec set_custom_emoji_sticker_set_thumbnail( telega@client:telegram_client(), telega@model@types:set_custom_emoji_sticker_set_thumbnail_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_custom_emoji_sticker_set_thumbnail(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_custom_emoji_sticker_set_thumbnail_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setCustomEmojiStickerSetThumbnail"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2583). ?DOC( " Use this method to delete a sticker set that was created by the bot. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletestickerset\n" ). -spec delete_sticker_set( telega@client:telegram_client(), telega@model@types:delete_sticker_set_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_sticker_set(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_sticker_set_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteStickerSet"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2602). ?DOC( " Use this method to send answers to an inline query. On success, True is returned.\n" " No more than 50 results per query are allowed.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answerinlinequery\n" ). -spec answer_inline_query( telega@client:telegram_client(), telega@model@types:answer_inline_query_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. answer_inline_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_inline_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerInlineQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2620). ?DOC( " Use this method to send invoices. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendinvoice\n" ). -spec send_invoice( telega@client:telegram_client(), telega@model@types:send_invoice_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_invoice(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_invoice_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendInvoice"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2638). ?DOC( " Use this method to send paid media. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendpaidmedia\n" ). -spec send_paid_media( telega@client:telegram_client(), telega@model@types:send_paid_media_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_paid_media(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_paid_media_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendPaidMedia"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2656). ?DOC( " Use this method to create a link for an invoice.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#createinvoicelink\n" ). -spec create_invoice_link( telega@client:telegram_client(), telega@model@types:create_invoice_link_parameters() ) -> {ok, binary()} | {error, telega@error:telega_error()}. create_invoice_link(Client, Parameters) -> Body_json = telega@model@encoder:encode_create_invoice_link_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"createInvoiceLink"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_string/1}). -file("src/telega/api.gleam", 2674). ?DOC( " If you sent an invoice requesting a shipping address and the parameter `is_flexible` was specified, the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a `shipping_query` field to the bot. Use this method to reply to shipping queries. On success, `True` is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answershippingquery\n" ). -spec answer_shipping_query( telega@client:telegram_client(), telega@model@types:answer_shipping_query_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. answer_shipping_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_shipping_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerShippingQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2693). ?DOC( " Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an [Update](https://core.telegram.org/bots/api#update) with the field `pre_checkout_query`. Use this method to respond to such pre-checkout queries. On success, `True` is returned.\n" " > **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answerprecheckoutquery\n" ). -spec answer_pre_checkout_query( telega@client:telegram_client(), telega@model@types:answer_pre_checkout_query_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. answer_pre_checkout_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_pre_checkout_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerPreCheckoutQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2712). ?DOC( " Returns the bot's Telegram Star transactions in chronological order. On success, returns a [StarTransactions](https://core.telegram.org/bots/api#startransactions) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmystartransactions\n" ). -spec get_star_transactions( telega@client:telegram_client(), telega@model@types:get_star_transactions_parameters() ) -> {ok, telega@model@types:star_transactions()} | {error, telega@error:telega_error()}. get_star_transactions(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_star_transactions_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getStarTransactions"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:star_transactions_decoder()). -file("src/telega/api.gleam", 2730). ?DOC( " Refunds a successful payment in Telegram Stars. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#refundstars\n" ). -spec refund_star_payment( telega@client:telegram_client(), telega@model@types:refund_star_payment_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. refund_star_payment(Client, Parameters) -> Body_json = telega@model@encoder:encode_refund_star_payment_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"refundStarPayment"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2748). ?DOC( " Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns `True` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#edituserstarsubscription\n" ). -spec edit_user_star_subscription( telega@client:telegram_client(), telega@model@types:edit_user_star_subscription_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_user_star_subscription(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_user_star_subscription_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editUserStarSubscription"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2767). ?DOC( " Use this method to send a game. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendgame\n" ). -spec send_game( telega@client:telegram_client(), telega@model@types:send_game_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_game(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_game_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"sendGame"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2781). ?DOC( " Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise `True` is returned. Returns an error, if the new score is not greater than the user's current score in the chat and `force` is `False`.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setgamescore\n" ). -spec set_game_score( telega@client:telegram_client(), telega@model@types:set_game_score_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. set_game_score(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_game_score_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setGameScore"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2801). ?DOC( " Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects.\n" "\n" " > This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getgamehighscores\n" ). -spec get_game_high_scores( telega@client:telegram_client(), telega@model@types:get_game_high_scores_parameters() ) -> {ok, telega@model@types:game_high_score()} | {error, telega@error:telega_error()}. get_game_high_scores(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_game_high_scores_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getGameHighScores"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:game_high_score_decoder()). -file("src/telega/api.gleam", 2819). ?DOC( " Use this method to send a draft message created by the user in a chat managed by the bot. Requires the `can_post_messages` administrator right. Returns `MessageId` on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendmessagedraft\n" ). -spec send_message_draft( telega@client:telegram_client(), telega@model@types:send_message_draft_parameters() ) -> {ok, telega@model@types:message_id()} | {error, telega@error:telega_error()}. send_message_draft(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_message_draft_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendMessageDraft"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_id_decoder()). -file("src/telega/api.gleam", 2837). ?DOC( " Use this method to get the list of gifts owned by a user. Requires no authorization if the user's gift list is public. Returns an [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getusergifts\n" ). -spec get_user_gifts( telega@client:telegram_client(), telega@model@types:get_user_gifts_parameters() ) -> {ok, telega@model@types:owned_gifts()} | {error, telega@error:telega_error()}. get_user_gifts(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_user_gifts_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getUserGifts"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:owned_gifts_decoder()). -file("src/telega/api.gleam", 2855). ?DOC( " Use this method to get the list of gifts received by a channel chat or a business account managed by the bot. Requires the `can_view_gifts_and_stars` administrator right if the chat is a channel. Returns an [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getchatgifts\n" ). -spec get_chat_gifts( telega@client:telegram_client(), telega@model@types:get_chat_gifts_parameters() ) -> {ok, telega@model@types:owned_gifts()} | {error, telega@error:telega_error()}. get_chat_gifts(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_chat_gifts_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getChatGifts"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:owned_gifts_decoder()). -file("src/telega/api.gleam", 2873). ?DOC( " Use this method to repost a story to another chat. The story must have been originally posted by the bot or must be a repostable chat story. Returns [Story](https://core.telegram.org/bots/api#story) on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#repoststory\n" ). -spec repost_story( telega@client:telegram_client(), telega@model@types:repost_story_parameters() ) -> {ok, telega@model@types:story()} | {error, telega@error:telega_error()}. repost_story(Client, Parameters) -> Body_json = telega@model@encoder:encode_repost_story_parameters(Parameters), _pipe = telega@client:new_post_request( Client, <<"repostStory"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:story_decoder()). -file("src/telega/api.gleam", 2893). ?DOC( " Use this method to send a response to a guest query. Returns a [SentGuestMessage](https://core.telegram.org/bots/api#sentguestmessage).\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answerguestquery\n" ). -spec answer_guest_query( telega@client:telegram_client(), telega@model@types:answer_guest_query_parameters() ) -> {ok, telega@model@types:sent_guest_message()} | {error, telega@error:telega_error()}. answer_guest_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_guest_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerGuestQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:sent_guest_message_decoder()). -file("src/telega/api.gleam", 2911). ?DOC( " Use this method to delete a specific reaction from a message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deletemessagereaction\n" ). -spec delete_message_reaction( telega@client:telegram_client(), telega@model@types:delete_message_reaction_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_message_reaction(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_message_reaction_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteMessageReaction"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2929). ?DOC( " Use this method to remove all reactions from a message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deleteallmessagereactions\n" ). -spec delete_all_message_reactions( telega@client:telegram_client(), telega@model@types:delete_all_message_reactions_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_all_message_reactions(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_all_message_reactions_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteAllMessageReactions"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 2948). ?DOC( " Use this method to send a live photo. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendlivephoto\n" ). -spec send_live_photo( telega@client:telegram_client(), telega@model@types:send_live_photo_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_live_photo(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_live_photo_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendLivePhoto"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 2966). ?DOC( " Use this method to get the access settings of a bot managed by the current bot. Returns a [BotAccessSettings](https://core.telegram.org/bots/api#botaccesssettings) object.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getmanagedbotaccesssettings\n" ). -spec get_managed_bot_access_settings( telega@client:telegram_client(), telega@model@types:get_managed_bot_access_settings_parameters() ) -> {ok, telega@model@types:bot_access_settings()} | {error, telega@error:telega_error()}. get_managed_bot_access_settings(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_managed_bot_access_settings_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getManagedBotAccessSettings"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:bot_access_settings_decoder()). -file("src/telega/api.gleam", 2985). ?DOC( " Use this method to change the access settings of a bot managed by the current bot. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#setmanagedbotaccesssettings\n" ). -spec set_managed_bot_access_settings( telega@client:telegram_client(), telega@model@types:set_managed_bot_access_settings_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. set_managed_bot_access_settings(Client, Parameters) -> Body_json = telega@model@encoder:encode_set_managed_bot_access_settings_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"setManagedBotAccessSettings"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3004). ?DOC( " Use this method to fetch messages sent by the bot in the personal chat of a user. Returns a list of [Message](https://core.telegram.org/bots/api#message) objects.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#getuserpersonalchatmessages\n" ). -spec get_user_personal_chat_messages( telega@client:telegram_client(), telega@model@types:get_user_personal_chat_messages_parameters() ) -> {ok, list(telega@model@types:message())} | {error, telega@error:telega_error()}. get_user_personal_chat_messages(Client, Parameters) -> Body_json = telega@model@encoder:encode_get_user_personal_chat_messages_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"getUserPersonalChatMessages"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response( _pipe@1, gleam@dynamic@decode:list(telega@model@decoder:message_decoder()) ). -file("src/telega/api.gleam", 3025). ?DOC( " Use this method to send a rich message. On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendrichmessage\n" ). -spec send_rich_message( telega@client:telegram_client(), telega@model@types:send_rich_message_parameters() ) -> {ok, telega@model@types:message()} | {error, telega@error:telega_error()}. send_rich_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_rich_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendRichMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, telega@model@decoder:message_decoder()). -file("src/telega/api.gleam", 3043). ?DOC( " Use this method to send a draft of a rich message to a private chat. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendrichmessagedraft\n" ). -spec send_rich_message_draft( telega@client:telegram_client(), telega@model@types:send_rich_message_draft_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. send_rich_message_draft(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_rich_message_draft_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendRichMessageDraft"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3061). ?DOC( " Use this method to delete an ephemeral message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#deleteephemeralmessage\n" ). -spec delete_ephemeral_message( telega@client:telegram_client(), telega@model@types:delete_ephemeral_message_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. delete_ephemeral_message(Client, Parameters) -> Body_json = telega@model@encoder:encode_delete_ephemeral_message_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"deleteEphemeralMessage"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3079). ?DOC( " Use this method to edit the text of an ephemeral message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editephemeralmessagetext\n" ). -spec edit_ephemeral_message_text( telega@client:telegram_client(), telega@model@types:edit_ephemeral_message_text_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_ephemeral_message_text(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_ephemeral_message_text_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editEphemeralMessageText"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3098). ?DOC( " Use this method to edit the caption of an ephemeral message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editephemeralmessagecaption\n" ). -spec edit_ephemeral_message_caption( telega@client:telegram_client(), telega@model@types:edit_ephemeral_message_caption_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_ephemeral_message_caption(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_ephemeral_message_caption_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editEphemeralMessageCaption"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3117). ?DOC( " Use this method to edit the media content of an ephemeral message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editephemeralmessagemedia\n" ). -spec edit_ephemeral_message_media( telega@client:telegram_client(), telega@model@types:edit_ephemeral_message_media_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_ephemeral_message_media(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_ephemeral_message_media_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editEphemeralMessageMedia"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3136). ?DOC( " Use this method to edit only the reply markup of an ephemeral message. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#editephemeralmessagereplymarkup\n" ). -spec edit_ephemeral_message_reply_markup( telega@client:telegram_client(), telega@model@types:edit_ephemeral_message_reply_markup_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. edit_ephemeral_message_reply_markup(Client, Parameters) -> Body_json = telega@model@encoder:encode_edit_ephemeral_message_reply_markup_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"editEphemeralMessageReplyMarkup"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3155). ?DOC( " Use this method to answer a chat join request query. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#answerchatjoinrequestquery\n" ). -spec answer_chat_join_request_query( telega@client:telegram_client(), telega@model@types:answer_chat_join_request_query_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. answer_chat_join_request_query(Client, Parameters) -> Body_json = telega@model@encoder:encode_answer_chat_join_request_query_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"answerChatJoinRequestQuery"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}). -file("src/telega/api.gleam", 3174). ?DOC( " Use this method to open a Web App to process a chat join request. Returns _True_ on success.\n" "\n" " **Official reference:** https://core.telegram.org/bots/api#sendchatjoinrequestwebapp\n" ). -spec send_chat_join_request_web_app( telega@client:telegram_client(), telega@model@types:send_chat_join_request_web_app_parameters() ) -> {ok, boolean()} | {error, telega@error:telega_error()}. send_chat_join_request_web_app(Client, Parameters) -> Body_json = telega@model@encoder:encode_send_chat_join_request_web_app_parameters( Parameters ), _pipe = telega@client:new_post_request( Client, <<"sendChatJoinRequestWebApp"/utf8>>, gleam@json:to_string(Body_json) ), _pipe@1 = telega@client:fetch(_pipe, Client), map_response(_pipe@1, {decoder, fun gleam@dynamic@decode:decode_bool/1}).