Nadia (nadia v1.6.0)
View SourceProvides access to Telegram Bot API.
Reference
https://core.telegram.org/bots/api#available-methods
Explicit clients
Public Bot API wrappers accept a %Nadia.Client{} as the first argument when
a call should use a specific bot identity:
client = Nadia.Client.new(token: System.fetch_env!("TELEGRAM_BOT_TOKEN"))
Nadia.send_message(client, 123, "hello")Legacy application config based calls remain supported:
Nadia.send_message(123, "hello")
Summary
Updates And Files
Use this method to remove webhook integration if you decide to switch back to Nadia.get_updates/1.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.delete_webhook/1.
Callback implementation for Nadia.Behaviour.delete_webhook/2.
Downloads a Telegram file to an application-chosen path without buffering the complete response.
Downloads with either an explicit client or default-client options.
Downloads with an explicit client and options.
Use this method to get basic info about a file and prepare it for downloading.
For the moment, bots can download files of up to 20MB in size.
On success, a File object is returned.
The file can then be downloaded via the link
https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken
from the response. It is guaranteed that the link will be valid for at least 1 hour.
When the link expires, a new one can be requested by calling get_file again.
Callback implementation for Nadia.Behaviour.get_file/2.
Use this method to get link for file for subsequent use.
This method is an extension of the get_file method.
Callback implementation for Nadia.Behaviour.get_file_link/2.
Use this method to receive incoming updates using long polling. An Array of Update objects is returned.
Callback implementation for Nadia.Behaviour.get_updates/1.
Callback implementation for Nadia.Behaviour.get_updates/2.
Use this method to get current webhook status. Requires no parameters.
On success, returns a Nadia.Model.WebhookInfo.t() object with webhook details.
If the bot is using getUpdates, will return an object with the url field empty.
Callback implementation for Nadia.Behaviour.get_webhook_info/1.
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
Callback implementation for Nadia.Behaviour.set_webhook/1.
Callback implementation for Nadia.Behaviour.set_webhook/2.
Interactions And Editing
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Callback implementation for Nadia.Behaviour.answer_callback_query/2.
Callback implementation for Nadia.Behaviour.answer_callback_query/3.
Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.
Callback implementation for Nadia.Behaviour.answer_guest_query/3.
Callback implementation for Nadia.Behaviour.answer_guest_query/4.
Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.
Callback implementation for Nadia.Behaviour.answer_inline_query/3.
Callback implementation for Nadia.Behaviour.answer_inline_query/4.
Use this method to set the result of an interaction with a Web App. On success, a SentWebAppMessage object is returned.
Callback implementation for Nadia.Behaviour.answer_web_app_query/3.
Use this method to approve a suggested post in a direct messages chat.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.approve_suggested_post/3.
Callback implementation for Nadia.Behaviour.approve_suggested_post/4.
Use this method to decline a suggested post in a direct messages chat.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.decline_suggested_post/3.
Callback implementation for Nadia.Behaviour.decline_suggested_post/4.
Use this method to remove recent reactions added by a given user or chat. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_all_message_reactions/2.
Callback implementation for Nadia.Behaviour.delete_all_message_reactions/3.
Use this method to delete message from a chat. Bot should have admin permission to do that, and remember you can't delete messages that are more than 48 hours old.
Use this method to remove a reaction from a message. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_message_reaction/3.
Callback implementation for Nadia.Behaviour.delete_message_reaction/4.
Use this method to delete multiple messages simultaneously. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_messages/3.
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned.
Callback implementation for Nadia.Behaviour.edit_message_caption/4.
Callback implementation for Nadia.Behaviour.edit_message_caption/5.
Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
Callback implementation for Nadia.Behaviour.edit_message_checklist/5.
Callback implementation for Nadia.Behaviour.edit_message_checklist/6.
Use this method to edit live location messages. On success, the edited Message
is returned, or :ok is returned when editing an inline message.
Callback implementation for Nadia.Behaviour.edit_message_live_location/4.
Use this method to edit animation, audio, document, live photo, photo, or video
messages, or to add media to text messages. On success, the edited Message is
returned, or :ok is returned when editing an inline message.
Callback implementation for Nadia.Behaviour.edit_message_media/3.
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned.
Callback implementation for Nadia.Behaviour.edit_message_reply_markup/4.
Callback implementation for Nadia.Behaviour.edit_message_reply_markup/5.
Use this method to edit text messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned
Callback implementation for Nadia.Behaviour.edit_message_text/5.
Callback implementation for Nadia.Behaviour.edit_message_text/6.
Use this method to store a message that can be sent by a user of a Mini App. On success, a PreparedInlineMessage object is returned.
Callback implementation for Nadia.Behaviour.save_prepared_inline_message/3.
Callback implementation for Nadia.Behaviour.save_prepared_inline_message/4.
Use this method to store a keyboard button that can be used by a user within a Mini App. On success, a PreparedKeyboardButton object is returned.
Callback implementation for Nadia.Behaviour.save_prepared_keyboard_button/3.
Use this method to change the chosen reactions on a message. Returns True on success.
Callback implementation for Nadia.Behaviour.set_message_reaction/3.
Callback implementation for Nadia.Behaviour.set_message_reaction/4.
Use this method to inform a user that Telegram Passport elements they provided
contain errors.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_passport_data_errors/3.
Use this method to stop updating a live location message before live_period
expires. On success, the edited Message is returned, or :ok is returned
when editing an inline message.
Callback implementation for Nadia.Behaviour.stop_message_live_location/2.
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
Callback implementation for Nadia.Behaviour.stop_poll/3.
Callback implementation for Nadia.Behaviour.stop_poll/4.
Chats And Administration
Use this method to process a received chat join request query.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.answer_chat_join_request_query/3.
Use this method to approve a chat join request. Returns True on success.
Callback implementation for Nadia.Behaviour.approve_chat_join_request/3.
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.
Callback implementation for Nadia.Behaviour.ban_chat_member/3.
Use this method to ban a channel chat in a supergroup or a channel. Returns True on success.
Callback implementation for Nadia.Behaviour.ban_chat_sender_chat/3.
Use this method to close an open forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.close_forum_topic/3.
Use this method to close an open General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.close_general_forum_topic/2.
Use this method to create an additional invite link for a chat. Returns the new invite link as a ChatInviteLink object.
Callback implementation for Nadia.Behaviour.create_chat_invite_link/2.
Callback implementation for Nadia.Behaviour.create_chat_invite_link/3.
Use this method to create a subscription invite link for a channel chat. Returns the new invite link as a ChatInviteLink object.
Callback implementation for Nadia.Behaviour.create_chat_subscription_invite_link/4.
Callback implementation for Nadia.Behaviour.create_chat_subscription_invite_link/5.
Use this method to create a topic in a forum supergroup chat or private chat. Returns information about the created topic as a ForumTopic object.
Callback implementation for Nadia.Behaviour.create_forum_topic/3.
Callback implementation for Nadia.Behaviour.create_forum_topic/4.
Use this method to decline a chat join request. Returns True on success.
Callback implementation for Nadia.Behaviour.decline_chat_join_request/3.
Use this method to delete a chat photo. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_chat_photo/2.
Use this method to delete a group sticker set from a supergroup. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_chat_sticker_set/2.
Use this method to delete a forum topic and all its messages. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_forum_topic/3.
Use this method to edit a non-primary invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.
Callback implementation for Nadia.Behaviour.edit_chat_invite_link/3.
Callback implementation for Nadia.Behaviour.edit_chat_invite_link/4.
Use this method to edit a subscription invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.
Callback implementation for Nadia.Behaviour.edit_chat_subscription_invite_link/3.
Callback implementation for Nadia.Behaviour.edit_chat_subscription_invite_link/4.
Use this method to edit name and icon of a forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.edit_forum_topic/3.
Callback implementation for Nadia.Behaviour.edit_forum_topic/4.
Use this method to edit the name of the General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.edit_general_forum_topic/3.
Use this method to generate a new primary invite link for a chat. Returns the new invite link as String on success.
Callback implementation for Nadia.Behaviour.export_chat_invite_link/2.
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.) Returns a Chat object on success.
Callback implementation for Nadia.Behaviour.get_chat/2.
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
Callback implementation for Nadia.Behaviour.get_chat_administrators/2.
Callback implementation for Nadia.Behaviour.get_chat_administrators/3.
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
Callback implementation for Nadia.Behaviour.get_chat_member/3.
Use this method to get the number of members in a chat. Returns Int on success.
Callback implementation for Nadia.Behaviour.get_chat_member_count/2.
Use this method to get custom emoji stickers that can be used as forum topic icons. Returns an array of Sticker objects.
Callback implementation for Nadia.Behaviour.get_forum_topic_icon_stickers/1.
Use this method to get the list of boosts added to a chat by a user. Returns a UserChatBoosts object.
Callback implementation for Nadia.Behaviour.get_user_chat_boosts/3.
Use this method to hide the General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.hide_general_forum_topic/2.
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
Callback implementation for Nadia.Behaviour.leave_chat/2.
Use this method to promote or demote a user in a supergroup or a channel. Returns True on success.
Callback implementation for Nadia.Behaviour.promote_chat_member/3.
Callback implementation for Nadia.Behaviour.promote_chat_member/4.
Use this method to reopen a closed forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.reopen_forum_topic/3.
Use this method to reopen a closed General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.reopen_general_forum_topic/2.
Use this method to restrict a user in a supergroup. Returns True on success.
Callback implementation for Nadia.Behaviour.restrict_chat_member/4.
Callback implementation for Nadia.Behaviour.restrict_chat_member/5.
Use this method to revoke an invite link created by the bot. Returns the revoked invite link as a ChatInviteLink object.
Callback implementation for Nadia.Behaviour.revoke_chat_invite_link/3.
Use this method to process a received chat join request query by showing a
Mini App to the user before deciding the outcome.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.send_chat_join_request_web_app/3.
Use this method to set a custom title for an administrator in a supergroup. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_administrator_custom_title/4.
Use this method to change the description of a chat. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_description/2.
Callback implementation for Nadia.Behaviour.set_chat_description/3.
Use this method to change the tag of a user in a direct messages chat. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_member_tag/3.
Callback implementation for Nadia.Behaviour.set_chat_member_tag/4.
Use this method to set default chat permissions for all members. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_permissions/3.
Callback implementation for Nadia.Behaviour.set_chat_permissions/4.
Use this method to set a new profile photo for the chat. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_photo/3.
Use this method to set a new group sticker set for a supergroup. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_sticker_set/3.
Use this method to change the title of a chat. Returns True on success.
Callback implementation for Nadia.Behaviour.set_chat_title/3.
Use this method to unban a previously kicked user in a supergroup. The user will not return to the group automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to work. Returns True on success.
Callback implementation for Nadia.Behaviour.unban_chat_member/3.
Callback implementation for Nadia.Behaviour.unban_chat_member/4.
Use this method to unban a previously banned channel chat. Returns True on success.
Callback implementation for Nadia.Behaviour.unban_chat_sender_chat/3.
Use this method to unhide the General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.unhide_general_forum_topic/2.
Use this method to clear the list of pinned messages in a chat. Returns True on success.
Callback implementation for Nadia.Behaviour.unpin_all_chat_messages/2.
Use this method to clear the list of pinned messages in a forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.unpin_all_forum_topic_messages/3.
Use this method to clear pinned messages in the General forum topic. Returns True on success.
Callback implementation for Nadia.Behaviour.unpin_all_general_forum_topic_messages/2.
Stickers
Adds one current Nadia.InputSticker or compatible raw object to a set.
Callback implementation for Nadia.Behaviour.add_sticker_to_set/4.
Callback implementation for Nadia.Behaviour.add_sticker_to_set/6.
Creates a sticker set owned by a user.
Callback implementation for Nadia.Behaviour.create_new_sticker_set/5.
Callback implementation for Nadia.Behaviour.create_new_sticker_set/7.
Use this method to delete a sticker from a set created by the bot. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_sticker_from_set/2.
Use this method to delete a sticker set created by the bot. Returns True on success.
Callback implementation for Nadia.Behaviour.delete_sticker_set/2.
Use this method to get information about custom emoji stickers by their identifiers. Returns an array of Sticker objects.
Callback implementation for Nadia.Behaviour.get_custom_emoji_stickers/2.
Use this method to get a sticker set. On success, a StickerSet object is returned.
Callback implementation for Nadia.Behaviour.get_sticker_set/2.
Use this method to replace an existing sticker in a sticker set with a new one. Returns True on success.
Callback implementation for Nadia.Behaviour.replace_sticker_in_set/5.
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
Callback implementation for Nadia.Behaviour.set_custom_emoji_sticker_set_thumbnail/2.
Callback implementation for Nadia.Behaviour.set_custom_emoji_sticker_set_thumbnail/3.
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_emoji_list/3.
Use this method to change search keywords assigned to a regular or custom emoji sticker. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_keywords/2.
Callback implementation for Nadia.Behaviour.set_sticker_keywords/3.
Use this method to change the mask position of a mask sticker. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_mask_position/2.
Callback implementation for Nadia.Behaviour.set_sticker_mask_position/3.
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_position_in_set/3.
Use this method to set the thumbnail of a regular or mask sticker set. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/3.
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/4.
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/5.
Use this method to set the title of a created sticker set. Returns True on success.
Callback implementation for Nadia.Behaviour.set_sticker_set_title/3.
Uploads a sticker file for later use in sticker-set methods.
Callback implementation for Nadia.Behaviour.upload_sticker_file/3.
Callback implementation for Nadia.Behaviour.upload_sticker_file/4.
Games
Use this method to get data for game high score tables. Returns a list of GameHighScore objects.
Callback implementation for Nadia.Behaviour.get_game_high_scores/2.
Callback implementation for Nadia.Behaviour.get_game_high_scores/3.
Use this method to set a user's score in a game message.
On success, the edited Message is returned, or :ok is returned when editing
an inline message.
Callback implementation for Nadia.Behaviour.set_game_score/3.
Callback implementation for Nadia.Behaviour.set_game_score/4.
Payments
Use this method to respond to pre-checkout queries.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.answer_pre_checkout_query/3.
Callback implementation for Nadia.Behaviour.answer_pre_checkout_query/4.
Use this method to reply to shipping queries.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.answer_shipping_query/3.
Callback implementation for Nadia.Behaviour.answer_shipping_query/4.
Use this method to create a link for an invoice. On success, the created invoice link is returned as a string.
Callback implementation for Nadia.Behaviour.create_invoice_link/6.
Callback implementation for Nadia.Behaviour.create_invoice_link/7.
Use this method to cancel or re-enable extension of a Telegram Stars subscription.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.edit_user_star_subscription/4.
Use this method to get the current Telegram Stars balance of the bot. Returns a StarAmount object.
Callback implementation for Nadia.Behaviour.get_my_star_balance/1.
Use this method to get the bot's Telegram Star transactions. Returns a StarTransactions object.
Callback implementation for Nadia.Behaviour.get_star_transactions/1.
Callback implementation for Nadia.Behaviour.get_star_transactions/2.
Use this method to refund a successful Telegram Stars payment.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.refund_star_payment/3.
Use this method to send invoices. On success, the sent Message is returned.
Callback implementation for Nadia.Behaviour.send_invoice/7.
Callback implementation for Nadia.Behaviour.send_invoice/8.
Bot Account
Use this method to close the bot instance before moving it from one local
server to another.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.close/1.
Use this method to delete the list of the bot's commands for the given scope
and user language.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.delete_my_commands/1.
Callback implementation for Nadia.Behaviour.delete_my_commands/2.
Use this method to get the current value of the bot's menu button in a private
chat, or the default menu button.
Returns a Nadia.Model.MenuButton on success.
Callback implementation for Nadia.Behaviour.get_chat_menu_button/1.
Callback implementation for Nadia.Behaviour.get_chat_menu_button/2.
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
Callback implementation for Nadia.Behaviour.get_me/1.
Use this method to get the current list of the bot's commands for the given
scope and user language.
Returns a list of Nadia.Model.BotCommand objects on success.
Callback implementation for Nadia.Behaviour.get_my_commands/1.
Callback implementation for Nadia.Behaviour.get_my_commands/2.
Use this method to get the current default administrator rights of the bot.
Returns Nadia.Model.ChatAdministratorRights on success.
Callback implementation for Nadia.Behaviour.get_my_default_administrator_rights/1.
Callback implementation for Nadia.Behaviour.get_my_default_administrator_rights/2.
Use this method to get the current bot description for the given user language.
Returns a Nadia.Model.BotDescription on success.
Callback implementation for Nadia.Behaviour.get_my_description/1.
Callback implementation for Nadia.Behaviour.get_my_description/2.
Use this method to get the current bot name for the given user language.
Returns a Nadia.Model.BotName on success.
Callback implementation for Nadia.Behaviour.get_my_name/1.
Callback implementation for Nadia.Behaviour.get_my_name/2.
Use this method to get the current bot short description for the given user
language.
Returns a Nadia.Model.BotShortDescription on success.
Callback implementation for Nadia.Behaviour.get_my_short_description/1.
Callback implementation for Nadia.Behaviour.get_my_short_description/2.
Use this method to log out from the cloud Bot API server before launching the
bot locally.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.log_out/1.
Use this method to remove the bot's profile photo.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.remove_my_profile_photo/1.
Callback implementation for Nadia.Behaviour.remove_my_profile_photo/2.
Use this method to change the bot's menu button in a private chat, or the
default menu button.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_chat_menu_button/1.
Callback implementation for Nadia.Behaviour.set_chat_menu_button/2.
Use this method to change the list of the bot's commands.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_commands/2.
Callback implementation for Nadia.Behaviour.set_my_commands/3.
Use this method to change the default administrator rights requested by the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_default_administrator_rights/1.
Callback implementation for Nadia.Behaviour.set_my_default_administrator_rights/2.
Use this method to change the bot's description.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_description/1.
Callback implementation for Nadia.Behaviour.set_my_description/2.
Use this method to change the bot's name.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_name/1.
Callback implementation for Nadia.Behaviour.set_my_name/2.
Use this method to change the bot's profile photo.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_profile_photo/2.
Use this method to change the bot's short description.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_my_short_description/1.
Callback implementation for Nadia.Behaviour.set_my_short_description/2.
Use this method to change the emoji status for a given user.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_user_emoji_status/2.
Callback implementation for Nadia.Behaviour.set_user_emoji_status/3.
Business
Use this method to convert a gift received by a managed business account to Telegram Stars.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.convert_gift_to_stars/3.
Use this method to delete messages on behalf of a business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.delete_business_messages/3.
Use this method to delete a story previously posted by the bot on behalf of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.delete_story/3.
Use this method to edit a story previously posted by the bot on behalf of a managed business account. Returns a Story object.
Callback implementation for Nadia.Behaviour.edit_story/4.
Callback implementation for Nadia.Behaviour.edit_story/5.
Use this method to get gifts received and owned by a managed business account.
Returns a Nadia.Model.OwnedGifts object on success.
Callback implementation for Nadia.Behaviour.get_business_account_gifts/2.
Callback implementation for Nadia.Behaviour.get_business_account_gifts/3.
Use this method to get the Telegram Stars balance of a managed business account. Returns a StarAmount object.
Callback implementation for Nadia.Behaviour.get_business_account_star_balance/2.
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object.
Callback implementation for Nadia.Behaviour.get_business_connection/2.
Use this method to post a story on behalf of a managed business account. Returns a Story object.
Callback implementation for Nadia.Behaviour.post_story/4.
Callback implementation for Nadia.Behaviour.post_story/5.
Use this method to mark an incoming message as read on behalf of a business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.read_business_message/4.
Use this method to remove the current profile photo of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.remove_business_account_profile_photo/2.
Callback implementation for Nadia.Behaviour.remove_business_account_profile_photo/3.
Use this method to repost a story on behalf of a managed business account. Returns a Story object.
Callback implementation for Nadia.Behaviour.repost_story/5.
Callback implementation for Nadia.Behaviour.repost_story/6.
Use this method to change the bio of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_business_account_bio/2.
Callback implementation for Nadia.Behaviour.set_business_account_bio/3.
Use this method to change the gift settings of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_business_account_gift_settings/4.
Use this method to change the first and last name of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_business_account_name/3.
Callback implementation for Nadia.Behaviour.set_business_account_name/4.
Use this method to change the profile photo of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/3.
Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/4.
Use this method to change the username of a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.set_business_account_username/2.
Callback implementation for Nadia.Behaviour.set_business_account_username/3.
Use this method to transfer Telegram Stars from a business account balance to the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.transfer_business_account_stars/3.
Use this method to transfer an owned gift to another user.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.transfer_gift/4.
Callback implementation for Nadia.Behaviour.transfer_gift/5.
Use this method to upgrade a gift received by a managed business account.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.upgrade_gift/3.
Callback implementation for Nadia.Behaviour.upgrade_gift/4.
Managed Bots
Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object.
Callback implementation for Nadia.Behaviour.get_managed_bot_access_settings/2.
Use this method to get the token of a managed bot. Returns the token as a string.
Callback implementation for Nadia.Behaviour.get_managed_bot_token/2.
Use this method to get the last messages from the personal chat of a given user. On success, an array of Message objects is returned.
Callback implementation for Nadia.Behaviour.get_user_personal_chat_messages/3.
Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as a string.
Callback implementation for Nadia.Behaviour.replace_managed_bot_token/2.
Use this method to change the access settings of a managed bot. Returns True on success.
Callback implementation for Nadia.Behaviour.set_managed_bot_access_settings/3.
Gifts And Verification
Use this method to get all gifts that can be sent by the bot.
Returns a Nadia.Model.Gifts object on success.
Callback implementation for Nadia.Behaviour.get_available_gifts/1.
Use this method to get gifts owned by a chat.
Returns a Nadia.Model.OwnedGifts object on success.
Callback implementation for Nadia.Behaviour.get_chat_gifts/2.
Callback implementation for Nadia.Behaviour.get_chat_gifts/3.
Use this method to get gifts owned by a user.
Returns a Nadia.Model.OwnedGifts object on success.
Callback implementation for Nadia.Behaviour.get_user_gifts/2.
Callback implementation for Nadia.Behaviour.get_user_gifts/3.
Use this method to gift a Telegram Premium subscription to a user.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.gift_premium_subscription/4.
Callback implementation for Nadia.Behaviour.gift_premium_subscription/5.
Use this method to remove verification from a chat that is currently verified on behalf
of the organization represented by the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.remove_chat_verification/2.
Use this method to remove verification from a user who is currently verified on behalf
of the organization represented by the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.remove_user_verification/2.
Use this method to send a gift to a user or channel chat.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.send_gift/2.
Callback implementation for Nadia.Behaviour.send_gift/3.
Use this method to verify a chat on behalf of the organization represented by the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.verify_chat/2.
Callback implementation for Nadia.Behaviour.verify_chat/3.
Use this method to verify a user on behalf of the organization represented by the bot.
Returns :ok on success.
Callback implementation for Nadia.Behaviour.verify_user/2.
Callback implementation for Nadia.Behaviour.verify_user/3.
Updates And Files
@spec delete_webhook() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove webhook integration if you decide to switch back to Nadia.get_updates/1.
Returns :ok on success.
Args:
options- keyword list of options
Options:
:drop_pending_updates- Pass True to drop all pending updates
@spec delete_webhook([{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec delete_webhook(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_webhook/1.
@spec delete_webhook(Nadia.Client.t(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_webhook/2.
@spec download_file(binary() | Nadia.Model.File.t(), Path.t(), non_neg_integer()) :: {:ok, Path.t()} | {:error, Nadia.Model.Error.t()}
Downloads a Telegram file to an application-chosen path without buffering the complete response.
max_bytes is mandatory. Nadia checks Telegram's optional file_size
before transfer and enforces the same cap against every emitted chunk.
The destination is not overwritten by default. A hidden, exclusive temp
file is created in the destination directory, synced, and atomically
published only after status and size validation.
In the default file_mode: :remote, redirects and retries are disabled
and token-bearing URLs never appear in results or normalized errors. Set
file_mode: :local only for a trusted local Bot API server whose absolute
file_path is accessible in Nadia's filesystem namespace.
Options:
:overwrite- atomically replace the destination; defaults tofalse:receive_timeout- receive timeout in milliseconds
Existing custom HTTP adapters remain compatible. Downloads require the
optional HTTP adapter download callback and fail with
{:download, :unsupported_http_adapter} when it is absent.
@spec download_file( binary() | Nadia.Model.File.t(), Path.t(), non_neg_integer(), keyword() ) :: {:ok, Path.t()} | {:error, Nadia.Model.Error.t()}
@spec download_file( Nadia.Client.t(), binary() | Nadia.Model.File.t(), Path.t(), non_neg_integer() ) :: {:ok, Path.t()} | {:error, Nadia.Model.Error.t()}
Downloads with either an explicit client or default-client options.
See download_file/3 for bounds, filesystem publication, adapter, and
security behavior.
@spec download_file( Nadia.Client.t(), binary() | Nadia.Model.File.t(), Path.t(), non_neg_integer(), keyword() ) :: {:ok, Path.t()} | {:error, Nadia.Model.Error.t()}
Downloads with an explicit client and options.
See download_file/3 for bounds, filesystem publication, adapter, and
security behavior.
@spec get_file(binary()) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get basic info about a file and prepare it for downloading.
For the moment, bots can download files of up to 20MB in size.
On success, a File object is returned.
The file can then be downloaded via the link
https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken
from the response. It is guaranteed that the link will be valid for at least 1 hour.
When the link expires, a new one can be requested by calling get_file again.
Args:
file_id- File identifier to get info about
@spec get_file(Nadia.Client.t(), binary()) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_file/2.
@spec get_file_link(Nadia.Model.File.t()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Use this method to get link for file for subsequent use.
This method is an extension of the get_file method.
The URL contains the bot token and should not be logged or exposed as a
public permanent URL. If Telegram omits the optional file_path, this
function returns an error with reason :file_path_unavailable.
Absolute local-server paths are never concatenated into a URL; use
download_file with file_mode: :local instead.
iex> Nadia.get_file_link(%Nadia.Model.File{file_id: "BQADBQADBgADmEjsA1aqdSxtzvvVAg",
...> file_path: "document/file_10", file_size: 17680})
{:ok,
"https://api.telegram.org/file/bot#{Nadia.Config.token()}/document/file_10"}
@spec get_file_link(Nadia.Client.t(), Nadia.Model.File.t()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_file_link/2.
Use this method to receive incoming updates using long polling. An Array of Update objects is returned.
Args:
options- keyword list of options
Options:
:offset- Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon asget_updatesis called with anoffsethigher than itsupdate_id.:limit- Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100:timeout- Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling:allowed_updates- JSON-serializable list of update types to receive
@spec get_updates([{atom(), any()}]) :: {:ok, [Nadia.Model.Update.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_updates/1.
@spec get_updates(Nadia.Client.t(), [{atom(), any()}]) :: {:ok, [Nadia.Model.Update.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_updates/2.
@spec get_webhook_info() :: {:ok, Nadia.Model.WebhookInfo.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get current webhook status. Requires no parameters.
On success, returns a Nadia.Model.WebhookInfo.t() object with webhook details.
If the bot is using getUpdates, will return an object with the url field empty.
@spec get_webhook_info(Nadia.Client.t()) :: {:ok, Nadia.Model.WebhookInfo.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_webhook_info/1.
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
Args:
options- keyword list of options
Options:
:url- HTTPS url to send updates to.:secret_token- Secret token Telegram should send in theX-Telegram-Bot-Api-Secret-Tokenheader.:allowed_updates- JSON-serializable list of update types to receive.
@spec set_webhook([{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_webhook/1.
@spec set_webhook(Nadia.Client.t(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_webhook/2.
Messages
Interactions And Editing
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Args:
callback_query_id- Unique identifier for the query to be answeredoptions- keyword list of options
Options:
:text- Text of the notification. If not specified, nothing will be shown to the user:show_alert- If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
@spec answer_callback_query(binary(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_callback_query/2.
@spec answer_callback_query(Nadia.Client.t(), binary(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_callback_query/3.
Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.
Args:
guest_query_id- Unique identifier for the query to be answeredresult- An inline query result describing the message to be sentoptions- keyword list of options
@spec answer_guest_query(binary(), Nadia.Model.InlineQueryResult.t(), [ {atom(), any()} ]) :: {:ok, Nadia.Model.SentGuestMessage.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_guest_query/3.
@spec answer_guest_query( Nadia.Client.t(), binary(), Nadia.Model.InlineQueryResult.t(), [ {atom(), any()} ] ) :: {:ok, Nadia.Model.SentGuestMessage.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_guest_query/4.
Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.
Args:
inline_query_id- Unique identifier for the answered queryresults- An array of results for the inline queryoptions- keyword list of options
Options:
cache_time- The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.is_personal- Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same querynext_offset- Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes.switch_pm_text- If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter.switch_pm_parameter- Parameter for the start message sent to the bot when user presses the switch button.
@spec answer_inline_query(binary(), [Nadia.Model.InlineQueryResult.t()], [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_inline_query/3.
@spec answer_inline_query( Nadia.Client.t(), binary(), [Nadia.Model.InlineQueryResult.t()], [ {atom(), any()} ] ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_inline_query/4.
@spec answer_web_app_query(binary(), list() | map() | struct() | binary()) :: {:ok, Nadia.Model.SentWebAppMessage.t()} | {:error, Nadia.Model.Error.t()}
Use this method to set the result of an interaction with a Web App. On success, a SentWebAppMessage object is returned.
Args:
web_app_query_id- Unique identifier for the query to be answeredresult- An inline query result describing the message to be sent
@spec answer_web_app_query( Nadia.Client.t(), binary(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.SentWebAppMessage.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_web_app_query/3.
@spec approve_suggested_post(integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to approve a suggested post in a direct messages chat.
Returns :ok on success.
Args:
chat_id- Unique identifier for the target direct messages chatmessage_id- Identifier of a suggested post message to approveoptions- keyword list of options
@spec approve_suggested_post(integer(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec approve_suggested_post(Nadia.Client.t(), integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.approve_suggested_post/3.
@spec approve_suggested_post(Nadia.Client.t(), integer(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.approve_suggested_post/4.
@spec decline_suggested_post(integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to decline a suggested post in a direct messages chat.
Returns :ok on success.
Args:
chat_id- Unique identifier for the target direct messages chatmessage_id- Identifier of a suggested post message to declineoptions- keyword list of options
@spec decline_suggested_post(integer(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec decline_suggested_post(Nadia.Client.t(), integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.decline_suggested_post/3.
@spec decline_suggested_post(Nadia.Client.t(), integer(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.decline_suggested_post/4.
Use this method to remove recent reactions added by a given user or chat. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @username)options- keyword list of options
Options:
:user_id- Identifier of the user whose reactions will be removed:actor_chat_id- Identifier of the chat whose reactions will be removed
@spec delete_all_message_reactions(integer() | binary(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_all_message_reactions/2.
@spec delete_all_message_reactions(Nadia.Client.t(), integer() | binary(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_all_message_reactions/3.
@spec delete_message(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete message from a chat. Bot should have admin permission to do that, and remember you can't delete messages that are more than 48 hours old.
Args:
chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_id- Required if inline_message_id is not specified. Unique identifier of the sent message
@spec delete_message(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove a reaction from a message. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @username)message_id- Identifier of the target messageoptions- keyword list of options
Options:
:user_id- Identifier of the user whose reaction will be removed:actor_chat_id- Identifier of the chat whose reaction will be removed
@spec delete_message_reaction(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_message_reaction/3.
@spec delete_message_reaction(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_message_reaction/4.
@spec delete_messages(integer() | binary(), [integer()]) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete multiple messages simultaneously. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_ids- List of message identifiers to delete
@spec delete_messages(Nadia.Client.t(), integer() | binary(), [integer()]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_messages/3.
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned.
Args:
chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_id- Required if inline_message_id is not specified. Unique identifier of the sent messageinline_message_id- Required ifchat_idandmessage_idare not specified. Identifier of the inline messageoptions- keyword list of options
Options:
:caption- New caption of the message:reply_markup- A JSON-serialized object for an inline keyboard -Nadia.Model.InlineKeyboardMarkup
@spec edit_message_caption(integer() | binary(), integer(), binary(), [ {atom(), any()} ]) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_caption/4.
@spec edit_message_caption( Nadia.Client.t(), integer() | binary(), integer(), binary(), [ {atom(), any()} ] ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_caption/5.
@spec edit_message_checklist( binary(), integer() | binary(), integer(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
Args:
business_connection_id- Unique identifier of the business connectionchat_id- Unique identifier for the target chat or username of the target botmessage_id- Unique identifier for the target messagechecklist- JSON-serializable checklist object or a pre-encoded JSON stringoptions- keyword list of options
@spec edit_message_checklist( binary(), integer() | binary(), integer(), list() | map() | struct() | binary(), [{atom(), any()}] ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec edit_message_checklist( Nadia.Client.t(), binary(), integer() | binary(), integer(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_checklist/5.
@spec edit_message_checklist( Nadia.Client.t(), binary(), integer() | binary(), integer(), list() | map() | struct() | binary(), [{atom(), any()}] ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_checklist/6.
@spec edit_message_live_location(float(), float(), [{atom(), any()}]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit live location messages. On success, the edited Message
is returned, or :ok is returned when editing an inline message.
Args:
latitude- Latitude of new locationlongitude- Longitude of new locationoptions- keyword list of options
@spec edit_message_live_location(Nadia.Client.t(), float(), float(), [{atom(), any()}]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_live_location/4.
@spec edit_message_media(list() | map() | struct() | binary(), [{atom(), any()}]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit animation, audio, document, live photo, photo, or video
messages, or to add media to text messages. On success, the edited Message is
returned, or :ok is returned when editing an inline message.
Args:
media-Nadia.InputMediavalue, compatible JSON-serializable object, or pre-encoded JSONoptions- keyword list of options
Inline messages cannot upload new files; use file IDs or supported URLs. Album messages retain Telegram's audio-only, document-only, or visual media-family replacement restrictions.
@spec edit_message_media(Nadia.Client.t(), list() | map() | struct() | binary(), [ {atom(), any()} ]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_media/3.
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned.
Args:
chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_id- Required if inline_message_id is not specified. Unique identifier of the sent messageinline_message_id- Required ifchat_idandmessage_idare not specified. Identifier of the inline messageoptions- keyword list of options
Options:
:reply_markup- A JSON-serialized object for an inline keyboard -Nadia.Model.InlineKeyboardMarkup
@spec edit_message_reply_markup(integer() | binary(), integer(), binary(), [ {atom(), any()} ]) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_reply_markup/4.
@spec edit_message_reply_markup( Nadia.Client.t(), integer() | binary(), integer(), binary(), [ {atom(), any()} ] ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_reply_markup/5.
Use this method to edit text messages sent by the bot or via the bot (for inline bots). On success, the edited Message is returned
Args:
chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_id- Required if inline_message_id is not specified. Unique identifier of the sent messageinline_message_id- Required ifchat_idandmessage_idare not specified. Identifier of the inline messagetext- New text of the messageoptions- keyword list of options
Options:
:parse_mode- Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.:disable_web_page_preview- Disables link previews for links in this message:reply_markup- A JSON-serialized object for an inline keyboard -Nadia.Model.InlineKeyboardMarkup
@spec edit_message_text( integer() | binary() | nil, integer() | nil, binary() | nil, binary() | nil, [{atom(), any()}] | map() ) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_text/5.
@spec edit_message_text( Nadia.Client.t(), integer() | binary() | nil, integer() | nil, binary() | nil, binary() | nil, [{atom(), any()}] | map() ) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_message_text/6.
@spec save_prepared_inline_message(integer(), Nadia.Model.InlineQueryResult.t()) :: {:ok, Nadia.Model.PreparedInlineMessage.t()} | {:error, Nadia.Model.Error.t()}
Use this method to store a message that can be sent by a user of a Mini App. On success, a PreparedInlineMessage object is returned.
Args:
user_id- Unique identifier of the target user that can use the prepared messageresult- An inline query result describing the message to be sentoptions- keyword list of options
@spec save_prepared_inline_message( integer(), Nadia.Model.InlineQueryResult.t(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.PreparedInlineMessage.t()} | {:error, Nadia.Model.Error.t()}
@spec save_prepared_inline_message( Nadia.Client.t(), integer(), Nadia.Model.InlineQueryResult.t() ) :: {:ok, Nadia.Model.PreparedInlineMessage.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.save_prepared_inline_message/3.
@spec save_prepared_inline_message( Nadia.Client.t(), integer(), Nadia.Model.InlineQueryResult.t(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.PreparedInlineMessage.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.save_prepared_inline_message/4.
@spec save_prepared_keyboard_button(integer(), list() | map() | struct() | binary()) :: {:ok, Nadia.Model.PreparedKeyboardButton.t()} | {:error, Nadia.Model.Error.t()}
Use this method to store a keyboard button that can be used by a user within a Mini App. On success, a PreparedKeyboardButton object is returned.
Args:
user_id- Unique identifier of the target user that can use the buttonbutton- JSON-serializable keyboard button object or a pre-encoded JSON string
@spec save_prepared_keyboard_button( Nadia.Client.t(), integer(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.PreparedKeyboardButton.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.save_prepared_keyboard_button/3.
Use this method to change the chosen reactions on a message. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)message_id- Identifier of the target messageoptions- keyword list of options
Options:
:reaction- List of reaction types to set on the message:is_big- Pass True to set the reaction with a big animation
@spec set_message_reaction(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_message_reaction/3.
@spec set_message_reaction(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_message_reaction/4.
@spec set_passport_data_errors(integer(), list() | map() | struct() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to inform a user that Telegram Passport elements they provided
contain errors.
Returns :ok on success.
Args:
user_id- User identifiererrors- JSON-serializable list of PassportElementError objects
@spec set_passport_data_errors( Nadia.Client.t(), integer(), list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_passport_data_errors/3.
@spec stop_message_live_location([{atom(), any()}]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Use this method to stop updating a live location message before live_period
expires. On success, the edited Message is returned, or :ok is returned
when editing an inline message.
Args:
options- keyword list of options
@spec stop_message_live_location(Nadia.Client.t(), [{atom(), any()}]) :: :ok | {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.stop_message_live_location/2.
@spec stop_poll(integer() | binary(), integer()) :: {:ok, Nadia.Model.Poll.t()} | {:error, Nadia.Model.Error.t()}
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
Args:
chat_id- Unique identifier for the target chat or username of the target channelmessage_id- Identifier of the original message with the polloptions- keyword list of options
@spec stop_poll(integer() | binary(), integer(), [{atom(), any()}]) :: {:ok, Nadia.Model.Poll.t()} | {:error, Nadia.Model.Error.t()}
@spec stop_poll(Nadia.Client.t(), integer() | binary(), integer()) :: {:ok, Nadia.Model.Poll.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.stop_poll/3.
@spec stop_poll(Nadia.Client.t(), integer() | binary(), integer(), [{atom(), any()}]) :: {:ok, Nadia.Model.Poll.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.stop_poll/4.
Chats And Administration
@spec answer_chat_join_request_query(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to process a received chat join request query.
Returns :ok on success.
@spec answer_chat_join_request_query(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_chat_join_request_query/3.
@spec approve_chat_join_request(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to approve a chat join request. Returns True on success.
@spec approve_chat_join_request(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.approve_chat_join_request/3.
@spec ban_chat_member(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
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.
Args:
chat_id- Unique identifier for the target group or username of the target supergroup or channel (in the format @username)user_id- Unique identifier of the target useroptions- keyword list of options
@spec ban_chat_member(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec ban_chat_member(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.ban_chat_member/3.
@spec ban_chat_member(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec ban_chat_sender_chat(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to ban a channel chat in a supergroup or a channel. Returns True on success.
@spec ban_chat_sender_chat(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.ban_chat_sender_chat/3.
@spec close_forum_topic(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to close an open forum topic. Returns True on success.
@spec close_forum_topic(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.close_forum_topic/3.
@spec close_general_forum_topic(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to close an open General forum topic. Returns True on success.
@spec close_general_forum_topic(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.close_general_forum_topic/2.
@spec create_chat_invite_link(integer() | binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Use this method to create an additional invite link for a chat. Returns the new invite link as a ChatInviteLink object.
@spec create_chat_invite_link(integer() | binary(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
@spec create_chat_invite_link(Nadia.Client.t(), integer() | binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_chat_invite_link/2.
@spec create_chat_invite_link( Nadia.Client.t(), integer() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_chat_invite_link/3.
@spec create_chat_subscription_invite_link(integer() | binary(), integer(), integer()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Use this method to create a subscription invite link for a channel chat. Returns the new invite link as a ChatInviteLink object.
@spec create_chat_subscription_invite_link( integer() | binary(), integer(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
@spec create_chat_subscription_invite_link( Nadia.Client.t(), integer() | binary(), integer(), integer() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_chat_subscription_invite_link/4.
@spec create_chat_subscription_invite_link( Nadia.Client.t(), integer() | binary(), integer(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_chat_subscription_invite_link/5.
@spec create_forum_topic(integer() | binary(), binary()) :: {:ok, Nadia.Model.ForumTopic.t()} | {:error, Nadia.Model.Error.t()}
Use this method to create a topic in a forum supergroup chat or private chat. Returns information about the created topic as a ForumTopic object.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroupname- Topic nameoptions- keyword list of options
Options:
:icon_color- Color of the topic icon in RGB format:icon_custom_emoji_id- Unique identifier of the custom emoji shown as the topic icon
@spec create_forum_topic(integer() | binary(), binary(), [{atom(), any()}]) :: {:ok, Nadia.Model.ForumTopic.t()} | {:error, Nadia.Model.Error.t()}
@spec create_forum_topic(Nadia.Client.t(), integer() | binary(), binary()) :: {:ok, Nadia.Model.ForumTopic.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_forum_topic/3.
@spec create_forum_topic(Nadia.Client.t(), integer() | binary(), binary(), [ {atom(), any()} ]) :: {:ok, Nadia.Model.ForumTopic.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_forum_topic/4.
@spec decline_chat_join_request(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to decline a chat join request. Returns True on success.
@spec decline_chat_join_request(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.decline_chat_join_request/3.
@spec delete_chat_photo(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a chat photo. Returns True on success.
@spec delete_chat_photo(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_chat_photo/2.
@spec delete_chat_sticker_set(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a group sticker set from a supergroup. Returns True on success.
@spec delete_chat_sticker_set(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_chat_sticker_set/2.
@spec delete_forum_topic(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a forum topic and all its messages. Returns True on success.
@spec delete_forum_topic(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_forum_topic/3.
@spec edit_chat_invite_link(integer() | binary(), binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit a non-primary invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.
@spec edit_chat_invite_link(integer() | binary(), binary(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
@spec edit_chat_invite_link(Nadia.Client.t(), integer() | binary(), binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_chat_invite_link/3.
@spec edit_chat_invite_link( Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_chat_invite_link/4.
@spec edit_chat_subscription_invite_link(integer() | binary(), binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit a subscription invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.
@spec edit_chat_subscription_invite_link( integer() | binary(), binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
@spec edit_chat_subscription_invite_link( Nadia.Client.t(), integer() | binary(), binary() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_chat_subscription_invite_link/3.
@spec edit_chat_subscription_invite_link( Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_chat_subscription_invite_link/4.
@spec edit_forum_topic(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to edit name and icon of a forum topic. Returns True on success.
@spec edit_forum_topic(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec edit_forum_topic(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_forum_topic/3.
@spec edit_forum_topic(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_forum_topic/4.
@spec edit_general_forum_topic(integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to edit the name of the General forum topic. Returns True on success.
@spec edit_general_forum_topic(Nadia.Client.t(), integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_general_forum_topic/3.
@spec export_chat_invite_link(integer() | binary()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Use this method to generate a new primary invite link for a chat. Returns the new invite link as String on success.
@spec export_chat_invite_link(Nadia.Client.t(), integer() | binary()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.export_chat_invite_link/2.
@spec get_chat(integer() | binary()) :: {:ok, Chat.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.) Returns a Chat object on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @supergroupusername)
@spec get_chat(Nadia.Client.t(), integer() | binary()) :: {:ok, Chat.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat/2.
@spec get_chat_administrators(integer() | binary()) :: {:ok, [ChatMember.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)options- keyword list of options
Options:
:return_bots- Pass True to include bots in the returned administrator list
@spec get_chat_administrators(integer() | binary(), [{atom(), any()}]) :: {:ok, [ChatMember.t()]} | {:error, Nadia.Model.Error.t()}
@spec get_chat_administrators(Nadia.Client.t(), integer() | binary()) :: {:ok, [ChatMember.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_administrators/2.
@spec get_chat_administrators(Nadia.Client.t(), integer() | binary(), [ {atom(), any()} ]) :: {:ok, [ChatMember.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_administrators/3.
@spec get_chat_member(integer() | binary(), integer()) :: {:ok, ChatMember.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)user_id- Unique identifier of the target user
@spec get_chat_member(Nadia.Client.t(), integer() | binary(), integer()) :: {:ok, ChatMember.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_member/3.
@spec get_chat_member_count(integer() | binary()) :: {:ok, integer()} | {:error, Nadia.Model.Error.t()}
Use this method to get the number of members in a chat. Returns Int on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
@spec get_chat_member_count(Nadia.Client.t(), integer() | binary()) :: {:ok, integer()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_member_count/2.
@spec get_forum_topic_icon_stickers() :: {:ok, [Nadia.Model.Sticker.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get custom emoji stickers that can be used as forum topic icons. Returns an array of Sticker objects.
@spec get_forum_topic_icon_stickers(Nadia.Client.t()) :: {:ok, [Nadia.Model.Sticker.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_forum_topic_icon_stickers/1.
@spec get_user_chat_boosts(integer() | binary(), integer()) :: {:ok, Nadia.Model.UserChatBoosts.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the list of boosts added to a chat by a user. Returns a UserChatBoosts object.
Args:
chat_id- Unique identifier for the chat or username of the channeluser_id- Unique identifier of the target user
@spec get_user_chat_boosts(Nadia.Client.t(), integer() | binary(), integer()) :: {:ok, Nadia.Model.UserChatBoosts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_user_chat_boosts/3.
@spec hide_general_forum_topic(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to hide the General forum topic. Returns True on success.
@spec hide_general_forum_topic(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.hide_general_forum_topic/2.
@spec leave_chat(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @supergroupusername)
@spec leave_chat(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.leave_chat/2.
@spec promote_chat_member(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to promote or demote a user in a supergroup or a channel. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target channeluser_id- Unique identifier of the target useroptions- keyword list of options
@spec promote_chat_member(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec promote_chat_member(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.promote_chat_member/3.
@spec promote_chat_member(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.promote_chat_member/4.
@spec reopen_forum_topic(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to reopen a closed forum topic. Returns True on success.
@spec reopen_forum_topic(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.reopen_forum_topic/3.
@spec reopen_general_forum_topic(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to reopen a closed General forum topic. Returns True on success.
@spec reopen_general_forum_topic(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.reopen_general_forum_topic/2.
@spec restrict_chat_member( integer() | binary(), integer(), map() | keyword() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to restrict a user in a supergroup. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)user_id- Unique identifier of the target userpermissions- New user permissionsoptions- keyword list of options
@spec restrict_chat_member( integer() | binary(), integer(), map() | keyword() | struct() | binary(), [ {atom(), any()} ] ) :: :ok | {:error, Nadia.Model.Error.t()}
@spec restrict_chat_member( Nadia.Client.t(), integer() | binary(), integer(), map() | keyword() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.restrict_chat_member/4.
@spec restrict_chat_member( Nadia.Client.t(), integer() | binary(), integer(), map() | keyword() | struct() | binary(), [{atom(), any()}] ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.restrict_chat_member/5.
@spec revoke_chat_invite_link(integer() | binary(), binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Use this method to revoke an invite link created by the bot. Returns the revoked invite link as a ChatInviteLink object.
@spec revoke_chat_invite_link(Nadia.Client.t(), integer() | binary(), binary()) :: {:ok, Nadia.Model.ChatInviteLink.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.revoke_chat_invite_link/3.
@spec send_chat_join_request_web_app(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to process a received chat join request query by showing a
Mini App to the user before deciding the outcome.
Returns :ok on success.
@spec send_chat_join_request_web_app(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.send_chat_join_request_web_app/3.
@spec set_chat_administrator_custom_title(integer() | binary(), integer(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set a custom title for an administrator in a supergroup. Returns True on success.
@spec set_chat_administrator_custom_title( Nadia.Client.t(), integer() | binary(), integer(), binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_administrator_custom_title/4.
@spec set_chat_description(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the description of a chat. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target channeloptions- keyword list of options
@spec set_chat_description(integer() | binary(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_chat_description(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_description/2.
@spec set_chat_description(Nadia.Client.t(), integer() | binary(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_description/3.
@spec set_chat_member_tag(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the tag of a user in a direct messages chat. Returns True on success.
Args:
chat_id- Unique identifier for the target chatuser_id- Unique identifier of the target useroptions- keyword list of options
@spec set_chat_member_tag(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_chat_member_tag(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_member_tag/3.
@spec set_chat_member_tag(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_member_tag/4.
@spec set_chat_permissions( integer() | binary(), map() | keyword() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set default chat permissions for all members. Returns True on success.
Args:
chat_id- Unique identifier for the target chat or username of the target supergrouppermissions- New default chat permissionsoptions- keyword list of options
@spec set_chat_permissions( integer() | binary(), map() | keyword() | struct() | binary(), [ {atom(), any()} ] ) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_chat_permissions( Nadia.Client.t(), integer() | binary(), map() | keyword() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_permissions/3.
@spec set_chat_permissions( Nadia.Client.t(), integer() | binary(), map() | keyword() | struct() | binary(), [{atom(), any()}] ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_permissions/4.
@spec set_chat_photo(integer() | binary(), binary() | Nadia.InputFile.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set a new profile photo for the chat. Returns True on success.
@spec set_chat_photo( Nadia.Client.t(), integer() | binary(), binary() | Nadia.InputFile.t() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_photo/3.
@spec set_chat_sticker_set(integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set a new group sticker set for a supergroup. Returns True on success.
@spec set_chat_sticker_set(Nadia.Client.t(), integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_sticker_set/3.
@spec set_chat_title(integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the title of a chat. Returns True on success.
@spec set_chat_title(Nadia.Client.t(), integer() | binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_chat_title/3.
@spec unban_chat_member(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to unban a previously kicked user in a supergroup. The user will not return to the group automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to work. Returns True on success.
Args:
chat_id- Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)user_id- Unique identifier of the target useroptions- keyword list of options
Options:
:only_if_banned- Do nothing if the user is not banned
@spec unban_chat_member(integer() | binary(), integer(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
@spec unban_chat_member(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unban_chat_member/3.
@spec unban_chat_member(Nadia.Client.t(), integer() | binary(), integer(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unban_chat_member/4.
@spec unban_chat_sender_chat(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to unban a previously banned channel chat. Returns True on success.
@spec unban_chat_sender_chat(Nadia.Client.t(), integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unban_chat_sender_chat/3.
@spec unhide_general_forum_topic(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to unhide the General forum topic. Returns True on success.
@spec unhide_general_forum_topic(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unhide_general_forum_topic/2.
@spec unpin_all_chat_messages(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to clear the list of pinned messages in a chat. Returns True on success.
@spec unpin_all_chat_messages(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unpin_all_chat_messages/2.
@spec unpin_all_forum_topic_messages(integer() | binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to clear the list of pinned messages in a forum topic. Returns True on success.
@spec unpin_all_forum_topic_messages( Nadia.Client.t(), integer() | binary(), integer() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unpin_all_forum_topic_messages/3.
@spec unpin_all_general_forum_topic_messages(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to clear pinned messages in the General forum topic. Returns True on success.
@spec unpin_all_general_forum_topic_messages(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.unpin_all_general_forum_topic_messages/2.
Pinned Messages
Stickers
@spec add_sticker_to_set( integer(), binary(), Nadia.InputSticker.t() | list() | map() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Adds one current Nadia.InputSticker or compatible raw object to a set.
Args:
user_id- User identifier of created sticker set ownername- Sticker set namesticker- A typed or compatible raw InputSticker object
Historical PNG-and-emoji arities remain as static-sticker shims.
@spec add_sticker_to_set( Nadia.Client.t(), integer(), binary(), Nadia.InputSticker.t() | list() | map() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.add_sticker_to_set/4.
@spec add_sticker_to_set(Nadia.Client.t(), integer(), binary(), binary(), binary(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.add_sticker_to_set/6.
@spec create_new_sticker_set(integer(), binary(), binary(), list() | map() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Creates a sticker set owned by a user.
Args:
user_id- User identifier of created sticker set ownername- Sticker-set short nametitle- Sticker set title, 1-64 charactersstickers- A list of 1-50Nadia.InputStickervalues, compatible raw objects, or pre-encoded JSON
Options:
sticker_type-"regular","mask", or"custom_emoji"needs_repainting- Repaint custom emoji to the surrounding text color
Historical PNG-and-emoji arities remain supported. They are translated to
one static Nadia.InputSticker; contains_masks: true becomes
sticker_type: "mask", and mask_position moves into that sticker.
@spec create_new_sticker_set( integer(), binary(), binary(), list() | map() | binary(), keyword() | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
@spec create_new_sticker_set( Nadia.Client.t(), integer(), binary(), binary(), list() | map() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_new_sticker_set/5.
@spec create_new_sticker_set( Nadia.Client.t(), integer(), binary(), binary(), binary(), binary(), [ {atom(), any()} ] ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_new_sticker_set/7.
@spec delete_sticker_from_set(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a sticker from a set created by the bot. Returns True on success.
Args:
sticker- File identifier of the sticker
@spec delete_sticker_from_set(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_sticker_from_set/2.
@spec delete_sticker_set(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a sticker set created by the bot. Returns True on success.
Args:
name- Sticker set name
@spec delete_sticker_set(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_sticker_set/2.
@spec get_custom_emoji_stickers([binary()] | binary()) :: {:ok, [Nadia.Model.Sticker.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get information about custom emoji stickers by their identifiers. Returns an array of Sticker objects.
Args:
custom_emoji_ids- List of custom emoji identifiers
@spec get_custom_emoji_stickers(Nadia.Client.t(), [binary()] | binary()) :: {:ok, [Nadia.Model.Sticker.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_custom_emoji_stickers/2.
@spec get_sticker_set(binary()) :: {:ok, Nadia.Model.StickerSet.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get a sticker set. On success, a StickerSet object is returned.
Args:
name- Name of the sticker set
@spec get_sticker_set(Nadia.Client.t(), binary()) :: {:ok, Nadia.Model.StickerSet.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_sticker_set/2.
@spec replace_sticker_in_set( integer(), binary(), binary(), list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to replace an existing sticker in a sticker set with a new one. Returns True on success.
Args:
user_id- User identifier of the sticker set ownername- Sticker set nameold_sticker- File identifier of the replaced stickersticker- InputSticker object for the new sticker
@spec replace_sticker_in_set( Nadia.Client.t(), integer(), binary(), binary(), list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.replace_sticker_in_set/5.
@spec set_custom_emoji_sticker_set_thumbnail(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
Args:
name- Sticker set name
Options:
custom_emoji_id- Custom emoji identifier to use as thumbnail
@spec set_custom_emoji_sticker_set_thumbnail(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_custom_emoji_sticker_set_thumbnail(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_custom_emoji_sticker_set_thumbnail/2.
@spec set_custom_emoji_sticker_set_thumbnail( Nadia.Client.t(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_custom_emoji_sticker_set_thumbnail/3.
@spec set_sticker_emoji_list(binary(), [binary()] | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. Returns True on success.
Args:
sticker- File identifier of the stickeremoji_list- List of emoji associated with the sticker
@spec set_sticker_emoji_list(Nadia.Client.t(), binary(), [binary()] | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_emoji_list/3.
@spec set_sticker_keywords(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change search keywords assigned to a regular or custom emoji sticker. Returns True on success.
Args:
sticker- File identifier of the sticker
Options:
keywords- List of 0-20 search keywords for the sticker
@spec set_sticker_keywords(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_sticker_keywords(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_keywords/2.
@spec set_sticker_keywords(Nadia.Client.t(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_keywords/3.
@spec set_sticker_mask_position(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the mask position of a mask sticker. Returns True on success.
Args:
sticker- File identifier of the sticker
Options:
mask_position- ANadia.Model.MaskPositionobject for the sticker
@spec set_sticker_mask_position(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_sticker_mask_position(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_mask_position/2.
@spec set_sticker_mask_position(Nadia.Client.t(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_mask_position/3.
@spec set_sticker_position_in_set(binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
Args:
sticker- File identifier of the stickerposition- New sticker position in the set, zero-based
@spec set_sticker_position_in_set(Nadia.Client.t(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_position_in_set/3.
@spec set_sticker_set_thumbnail(binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set the thumbnail of a regular or mask sticker set. Returns True on success.
Args:
name- Sticker set nameuser_id- User identifier of the sticker set ownerformat-"static","animated", or"video"
Options:
thumbnail- New thumbnail upload, ornilto remove it
Historical no-format arities remain as static compatibility shims.
@spec set_sticker_set_thumbnail(binary(), integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_sticker_set_thumbnail(Nadia.Client.t(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/3.
@spec set_sticker_set_thumbnail( Nadia.Client.t(), binary(), integer(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_sticker_set_thumbnail( binary(), integer(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/4.
@spec set_sticker_set_thumbnail( Nadia.Client.t(), binary(), integer(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/5.
@spec set_sticker_set_title(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to set the title of a created sticker set. Returns True on success.
Args:
name- Sticker set nametitle- Sticker set title
@spec set_sticker_set_title(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_sticker_set_title/3.
@spec upload_sticker_file(integer(), binary() | Nadia.InputFile.t()) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
Uploads a sticker file for later use in sticker-set methods.
Args:
user_id- User identifier of sticker file ownersticker- A new WEBP, PNG, TGS, or WEBM uploadsticker_format-"static","animated", or"video"
The historical two-argument form remains as a static-sticker compatibility
shim. It now sends Telegram's current sticker and sticker_format fields.
@spec upload_sticker_file(integer(), binary() | Nadia.InputFile.t(), binary()) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
@spec upload_sticker_file(Nadia.Client.t(), integer(), binary() | Nadia.InputFile.t()) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.upload_sticker_file/3.
@spec upload_sticker_file( Nadia.Client.t(), integer(), binary() | Nadia.InputFile.t(), binary() ) :: {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.upload_sticker_file/4.
Games
@spec get_game_high_scores(integer()) :: {:ok, [Nadia.Model.GameHighScore.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get data for game high score tables. Returns a list of GameHighScore objects.
Args:
user_id- Target user identifieroptions- keyword list or map of options
@spec get_game_high_scores(integer(), [{atom(), any()}] | map()) :: {:ok, [Nadia.Model.GameHighScore.t()]} | {:error, Nadia.Model.Error.t()}
@spec get_game_high_scores(Nadia.Client.t(), integer()) :: {:ok, [Nadia.Model.GameHighScore.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_game_high_scores/2.
@spec get_game_high_scores(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) :: {:ok, [Nadia.Model.GameHighScore.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_game_high_scores/3.
@spec set_game_score(integer(), integer()) :: {:ok, Nadia.Model.Message.t()} | :ok | {:error, Nadia.Model.Error.t()}
Use this method to set a user's score in a game message.
On success, the edited Message is returned, or :ok is returned when editing
an inline message.
Args:
user_id- User identifierscore- New scoreoptions- keyword list or map of options
@spec set_game_score(integer(), integer(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.Message.t()} | :ok | {:error, Nadia.Model.Error.t()}
@spec set_game_score(Nadia.Client.t(), integer(), integer()) :: {:ok, Nadia.Model.Message.t()} | :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_game_score/3.
@spec set_game_score( Nadia.Client.t(), integer(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Message.t()} | :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_game_score/4.
Payments
@spec answer_pre_checkout_query(binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to respond to pre-checkout queries.
Returns :ok on success.
Args:
pre_checkout_query_id- Unique identifier for the query to be answeredok- Pass true if the bot is ready to proceed with the orderoptions- keyword list of options
Options:
:error_message- Error message to display whenokis false
@spec answer_pre_checkout_query(binary(), boolean(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec answer_pre_checkout_query(Nadia.Client.t(), binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_pre_checkout_query/3.
@spec answer_pre_checkout_query( Nadia.Client.t(), binary(), boolean(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_pre_checkout_query/4.
@spec answer_shipping_query(binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to reply to shipping queries.
Returns :ok on success.
Args:
shipping_query_id- Unique identifier for the query to be answeredok- Pass true if delivery to the specified address is possibleoptions- keyword list of options
Options:
:shipping_options- JSON-serializable list of shipping options:error_message- Error message to display whenokis false
@spec answer_shipping_query(binary(), boolean(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec answer_shipping_query(Nadia.Client.t(), binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_shipping_query/3.
@spec answer_shipping_query( Nadia.Client.t(), binary(), boolean(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.answer_shipping_query/4.
@spec create_invoice_link( binary(), binary(), binary(), binary(), list() | map() | struct() | binary() ) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Use this method to create a link for an invoice. On success, the created invoice link is returned as a string.
Args:
title- Product namedescription- Product descriptionpayload- Bot-defined invoice payloadcurrency- Three-letter ISO 4217 currency code, orXTRfor Starsprices- JSON-serializable price breakdown array or a pre-encoded JSON stringoptions- keyword list or map of options
@spec create_invoice_link( binary(), binary(), binary(), binary(), list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
@spec create_invoice_link( Nadia.Client.t(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary() ) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_invoice_link/6.
@spec create_invoice_link( Nadia.Client.t(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.create_invoice_link/7.
@spec edit_user_star_subscription(integer(), binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to cancel or re-enable extension of a Telegram Stars subscription.
Returns :ok on success.
Args:
user_id- Identifier of the user whose subscription will be editedtelegram_payment_charge_id- Telegram payment identifier for the subscriptionis_canceled- Pass true to cancel extension, or false to re-enable it
@spec edit_user_star_subscription(Nadia.Client.t(), integer(), binary(), boolean()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_user_star_subscription/4.
@spec get_my_star_balance() :: {:ok, Nadia.Model.StarAmount.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the current Telegram Stars balance of the bot. Returns a StarAmount object.
@spec get_my_star_balance(Nadia.Client.t()) :: {:ok, Nadia.Model.StarAmount.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_star_balance/1.
@spec get_star_transactions() :: {:ok, Nadia.Model.StarTransactions.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the bot's Telegram Star transactions. Returns a StarTransactions object.
Args:
options- keyword list or map of options
@spec get_star_transactions([{atom(), any()}] | map()) :: {:ok, Nadia.Model.StarTransactions.t()} | {:error, Nadia.Model.Error.t()}
@spec get_star_transactions(Nadia.Client.t()) :: {:ok, Nadia.Model.StarTransactions.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_star_transactions/1.
@spec get_star_transactions(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.StarTransactions.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_star_transactions/2.
@spec refund_star_payment(integer(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to refund a successful Telegram Stars payment.
Returns :ok on success.
Args:
user_id- Identifier of the user whose payment will be refundedtelegram_payment_charge_id- Telegram payment identifier
@spec refund_star_payment(Nadia.Client.t(), integer(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.refund_star_payment/3.
@spec send_invoice( integer() | binary(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Use this method to send invoices. On success, the sent Message is returned.
Args:
chat_id- Unique identifier for the target chat or username of the target channeltitle- Product namedescription- Product descriptionpayload- Bot-defined invoice payloadcurrency- Three-letter ISO 4217 currency code, orXTRfor Starsprices- JSON-serializable price breakdown array or a pre-encoded JSON stringoptions- keyword list or map of options
@spec send_invoice( integer() | binary(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec send_invoice( Nadia.Client.t(), integer() | binary(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.send_invoice/7.
@spec send_invoice( Nadia.Client.t(), integer() | binary(), binary(), binary(), binary(), binary(), list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.send_invoice/8.
Bot Account
@spec close() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to close the bot instance before moving it from one local
server to another.
Returns :ok on success.
@spec close(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.close/1.
@spec delete_my_commands() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete the list of the bot's commands for the given scope
and user language.
Returns :ok on success.
@spec delete_my_commands([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec delete_my_commands(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_my_commands/1.
@spec delete_my_commands(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_my_commands/2.
@spec get_me() :: {:ok, Nadia.Model.User.t()} | {:error, Nadia.Model.Error.t()}
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
@spec get_me(Nadia.Client.t()) :: {:ok, Nadia.Model.User.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_me/1.
@spec get_my_commands() :: {:ok, [Nadia.Model.BotCommand.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get the current list of the bot's commands for the given
scope and user language.
Returns a list of Nadia.Model.BotCommand objects on success.
@spec get_my_commands([{atom(), any()}] | map()) :: {:ok, [Nadia.Model.BotCommand.t()]} | {:error, Nadia.Model.Error.t()}
@spec get_my_commands(Nadia.Client.t()) :: {:ok, [Nadia.Model.BotCommand.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_commands/1.
@spec get_my_commands(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, [Nadia.Model.BotCommand.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_commands/2.
@spec get_my_default_administrator_rights() :: {:ok, Nadia.Model.ChatAdministratorRights.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the current default administrator rights of the bot.
Returns Nadia.Model.ChatAdministratorRights on success.
@spec get_my_default_administrator_rights([{atom(), any()}] | map()) :: {:ok, Nadia.Model.ChatAdministratorRights.t()} | {:error, Nadia.Model.Error.t()}
@spec get_my_default_administrator_rights(Nadia.Client.t()) :: {:ok, Nadia.Model.ChatAdministratorRights.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_default_administrator_rights/1.
@spec get_my_default_administrator_rights(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.ChatAdministratorRights.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_default_administrator_rights/2.
@spec get_my_description() :: {:ok, Nadia.Model.BotDescription.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the current bot description for the given user language.
Returns a Nadia.Model.BotDescription on success.
@spec get_my_description([{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotDescription.t()} | {:error, Nadia.Model.Error.t()}
@spec get_my_description(Nadia.Client.t()) :: {:ok, Nadia.Model.BotDescription.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_description/1.
@spec get_my_description(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotDescription.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_description/2.
@spec get_my_name() :: {:ok, Nadia.Model.BotName.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the current bot name for the given user language.
Returns a Nadia.Model.BotName on success.
@spec get_my_name([{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotName.t()} | {:error, Nadia.Model.Error.t()}
@spec get_my_name(Nadia.Client.t()) :: {:ok, Nadia.Model.BotName.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_name/1.
@spec get_my_name(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotName.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_name/2.
@spec get_my_short_description() :: {:ok, Nadia.Model.BotShortDescription.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the current bot short description for the given user
language.
Returns a Nadia.Model.BotShortDescription on success.
@spec get_my_short_description([{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotShortDescription.t()} | {:error, Nadia.Model.Error.t()}
@spec get_my_short_description(Nadia.Client.t()) :: {:ok, Nadia.Model.BotShortDescription.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_short_description/1.
@spec get_my_short_description(Nadia.Client.t(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.BotShortDescription.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_my_short_description/2.
@spec log_out() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to log out from the cloud Bot API server before launching the
bot locally.
Returns :ok on success.
@spec log_out(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.log_out/1.
@spec remove_my_profile_photo() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove the bot's profile photo.
Returns :ok on success.
@spec remove_my_profile_photo([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec remove_my_profile_photo(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_my_profile_photo/1.
@spec remove_my_profile_photo(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_my_profile_photo/2.
@spec set_my_commands(list() | map() | struct() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the list of the bot's commands.
Returns :ok on success.
@spec set_my_commands(list() | map() | struct() | binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_my_commands(Nadia.Client.t(), list() | map() | struct() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_commands/2.
@spec set_my_commands( Nadia.Client.t(), list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_commands/3.
@spec set_my_default_administrator_rights() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the default administrator rights requested by the bot.
Returns :ok on success.
@spec set_my_default_administrator_rights([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_my_default_administrator_rights(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_default_administrator_rights/1.
@spec set_my_default_administrator_rights(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_default_administrator_rights/2.
@spec set_my_description() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the bot's description.
Returns :ok on success.
@spec set_my_description([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_my_description(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_description/1.
@spec set_my_description(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_description/2.
@spec set_my_name() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the bot's name.
Returns :ok on success.
@spec set_my_name([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_my_name(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_name/1.
@spec set_my_name(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_name/2.
@spec set_my_profile_photo( Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the bot's profile photo.
Returns :ok on success.
Pass a typed Nadia.InputProfilePhoto to require a new multipart upload
and validate its discriminator locally. Raw JSON-serializable objects and
pre-encoded JSON strings remain supported for compatibility.
@spec set_my_profile_photo( Nadia.Client.t(), Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_profile_photo/2.
@spec set_my_short_description() :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the bot's short description.
Returns :ok on success.
@spec set_my_short_description([{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_my_short_description(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_short_description/1.
@spec set_my_short_description(Nadia.Client.t(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_my_short_description/2.
@spec set_user_emoji_status(integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the emoji status for a given user.
Returns :ok on success.
@spec set_user_emoji_status(integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_user_emoji_status(Nadia.Client.t(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_user_emoji_status/2.
@spec set_user_emoji_status(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_user_emoji_status/3.
Business
@spec convert_gift_to_stars(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to convert a gift received by a managed business account to Telegram Stars.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionowned_gift_id- Unique identifier of the regular gift that should be converted to Telegram Stars
@spec convert_gift_to_stars(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.convert_gift_to_stars/3.
@spec delete_business_messages(binary(), [integer()]) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete messages on behalf of a business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionmessage_ids- List of message identifiers to delete
@spec delete_business_messages(Nadia.Client.t(), binary(), [integer()]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_business_messages/3.
@spec delete_story(binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to delete a story previously posted by the bot on behalf of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionstory_id- Unique identifier of the story to delete
@spec delete_story(Nadia.Client.t(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.delete_story/3.
@spec edit_story( binary(), integer(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Use this method to edit a story previously posted by the bot on behalf of a managed business account. Returns a Story object.
Args:
business_connection_id- Unique identifier of the business connectionstory_id- Unique identifier of the story to editcontent-Nadia.InputStoryContentvalue, compatible JSON-serializable story content object, or a pre-encoded JSON stringoptions- keyword list or map of options
Options:
:caption- Caption of the story:parse_mode- Mode for parsing entities in the story caption:caption_entities- JSON-serializable caption entities array or a pre-encoded JSON string:areas- list containingNadia.StoryAreavalues, compatible raw story-area objects, or a pre-encoded JSON string
Typed Nadia.StoryArea lists validate positions, nested values, and the
official per-story limits before HTTP. Raw and pre-encoded values remain
compatibility inputs.
@spec edit_story( binary(), integer(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
@spec edit_story( Nadia.Client.t(), binary(), integer(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_story/4.
@spec edit_story( Nadia.Client.t(), binary(), integer(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.edit_story/5.
@spec get_business_account_gifts(binary()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get gifts received and owned by a managed business account.
Returns a Nadia.Model.OwnedGifts object on success.
Args:
business_connection_id- Unique identifier of the business connectionoptions- keyword list or map of options
@spec get_business_account_gifts(binary(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
@spec get_business_account_gifts(Nadia.Client.t(), binary()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_business_account_gifts/2.
@spec get_business_account_gifts( Nadia.Client.t(), binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_business_account_gifts/3.
@spec get_business_account_star_balance(binary()) :: {:ok, Nadia.Model.StarAmount.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the Telegram Stars balance of a managed business account. Returns a StarAmount object.
Args:
business_connection_id- Unique identifier of the business connection
@spec get_business_account_star_balance(Nadia.Client.t(), binary()) :: {:ok, Nadia.Model.StarAmount.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_business_account_star_balance/2.
@spec get_business_connection(binary()) :: {:ok, Nadia.Model.BusinessConnection.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object.
Args:
business_connection_id- Unique identifier of the business connection
@spec get_business_connection(Nadia.Client.t(), binary()) :: {:ok, Nadia.Model.BusinessConnection.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_business_connection/2.
@spec post_story( binary(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), integer() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Use this method to post a story on behalf of a managed business account. Returns a Story object.
Args:
business_connection_id- Unique identifier of the business connectioncontent-Nadia.InputStoryContentvalue, compatible JSON-serializable story content object, or a pre-encoded JSON stringactive_period- Period after which the story is moved to the archive, in secondsoptions- keyword list or map of options
Options:
:caption- Caption of the story:parse_mode- Mode for parsing entities in the story caption:caption_entities- JSON-serializable caption entities array or a pre-encoded JSON string:areas- list containingNadia.StoryAreavalues, compatible raw story-area objects, or a pre-encoded JSON string:post_to_chat_page- Pass true to keep the story accessible after it expires:protect_content- Pass true if the content of the story must be protected
Typed Nadia.StoryArea lists validate positions, nested values, and the
official per-story limits before HTTP. Raw and pre-encoded values remain
compatibility inputs.
@spec post_story( binary(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
@spec post_story( Nadia.Client.t(), binary(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), integer() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.post_story/4.
@spec post_story( Nadia.Client.t(), binary(), Nadia.InputStoryContent.t() | list() | map() | struct() | binary(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.post_story/5.
@spec read_business_message(binary(), integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to mark an incoming message as read on behalf of a business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionchat_id- Unique identifier of the chat in which the message was receivedmessage_id- Unique identifier of the message to mark as read
@spec read_business_message(Nadia.Client.t(), binary(), integer(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.read_business_message/4.
@spec remove_business_account_profile_photo(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove the current profile photo of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionoptions- keyword list of options
Options:
:is_public- Pass true to remove the public profile photo
@spec remove_business_account_profile_photo(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec remove_business_account_profile_photo(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_business_account_profile_photo/2.
@spec remove_business_account_profile_photo( Nadia.Client.t(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_business_account_profile_photo/3.
@spec repost_story(binary(), integer(), integer(), integer()) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Use this method to repost a story on behalf of a managed business account. Returns a Story object.
Args:
business_connection_id- Unique identifier of the business connectionfrom_chat_id- Unique identifier of the chat which posted the storyfrom_story_id- Unique identifier of the story that should be repostedactive_period- Period after which the story is moved to the archive, in secondsoptions- keyword list or map of options
Options:
:post_to_chat_page- Pass true to keep the story accessible after it expires:protect_content- Pass true if the content of the story must be protected
@spec repost_story( binary(), integer(), integer(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
@spec repost_story(Nadia.Client.t(), binary(), integer(), integer(), integer()) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.repost_story/5.
@spec repost_story( Nadia.Client.t(), binary(), integer(), integer(), integer(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.repost_story/6.
@spec set_business_account_bio(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the bio of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionoptions- keyword list of options
Options:
:bio- New bio of the business account
@spec set_business_account_bio(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_business_account_bio(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_bio/2.
@spec set_business_account_bio(Nadia.Client.t(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_bio/3.
@spec set_business_account_gift_settings( binary(), boolean(), list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the gift settings of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionshow_gift_button- Whether the gift button must always be shown in the input fieldaccepted_gift_types- JSON-serializable accepted gift types object or pre-encoded JSON
@spec set_business_account_gift_settings( Nadia.Client.t(), binary(), boolean(), list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_gift_settings/4.
@spec set_business_account_name(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the first and last name of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionfirst_name- New first name of the business accountoptions- keyword list of options
Options:
:last_name- New last name of the business account
@spec set_business_account_name(binary(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_business_account_name(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_name/3.
@spec set_business_account_name( Nadia.Client.t(), binary(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_name/4.
@spec set_business_account_profile_photo( binary(), Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the profile photo of a managed business account.
Returns :ok on success.
Pass a typed Nadia.InputProfilePhoto to require a new multipart upload
and validate its discriminator locally. Raw JSON-serializable objects and
pre-encoded JSON strings remain supported for compatibility.
Args:
business_connection_id- Unique identifier of the business connectionphoto- Typed profile photo, compatible JSON-serializable object, or a pre-encoded JSON stringoptions- keyword list of options
Options:
:is_public- Pass true to set the public profile photo
@spec set_business_account_profile_photo( binary(), Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_business_account_profile_photo( Nadia.Client.t(), binary(), Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/3.
@spec set_business_account_profile_photo( Nadia.Client.t(), binary(), Nadia.InputProfilePhoto.t() | list() | map() | struct() | binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/4.
@spec set_business_account_username(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to change the username of a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionoptions- keyword list of options
Options:
:username- New username of the business account
@spec set_business_account_username(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_business_account_username(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_username/2.
@spec set_business_account_username( Nadia.Client.t(), binary(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_business_account_username/3.
@spec transfer_business_account_stars(binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to transfer Telegram Stars from a business account balance to the bot.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionstar_count- Number of Telegram Stars to transfer
@spec transfer_business_account_stars(Nadia.Client.t(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.transfer_business_account_stars/3.
@spec transfer_gift(binary(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to transfer an owned gift to another user.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionowned_gift_id- Unique identifier of the regular gift that should be transferrednew_owner_chat_id- Unique identifier of the chat which will own the giftoptions- keyword list of options
Options:
:star_count- Number of Telegram Stars that will be paid for the transfer
@spec transfer_gift(binary(), binary(), integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec transfer_gift(Nadia.Client.t(), binary(), binary(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.transfer_gift/4.
@spec transfer_gift( Nadia.Client.t(), binary(), binary(), integer(), [{atom(), any()}] | map() ) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.transfer_gift/5.
@spec upgrade_gift(binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to upgrade a gift received by a managed business account.
Returns :ok on success.
Args:
business_connection_id- Unique identifier of the business connectionowned_gift_id- Unique identifier of the regular gift that should be upgradedoptions- keyword list of options
Options:
:keep_original_details- Pass true to keep the original gift text, sender, and receiver in the upgraded gift:star_count- Number of Telegram Stars that will be paid for the upgrade
@spec upgrade_gift(binary(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec upgrade_gift(Nadia.Client.t(), binary(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.upgrade_gift/3.
@spec upgrade_gift(Nadia.Client.t(), binary(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.upgrade_gift/4.
Managed Bots
@spec get_managed_bot_access_settings(integer()) :: {:ok, Nadia.Model.BotAccessSettings.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object.
Args:
user_id- User identifier of the managed bot whose access settings will be returned
@spec get_managed_bot_access_settings(Nadia.Client.t(), integer()) :: {:ok, Nadia.Model.BotAccessSettings.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_managed_bot_access_settings/2.
@spec get_managed_bot_token(integer()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Use this method to get the token of a managed bot. Returns the token as a string.
Args:
user_id- User identifier of the managed bot whose token will be returned
@spec get_managed_bot_token(Nadia.Client.t(), integer()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_managed_bot_token/2.
@spec get_user_personal_chat_messages(integer(), integer()) :: {:ok, [Nadia.Model.Message.t()]} | {:error, Nadia.Model.Error.t()}
Use this method to get the last messages from the personal chat of a given user. On success, an array of Message objects is returned.
Args:
user_id- Unique identifier for the target userlimit- The maximum number of messages to return
@spec get_user_personal_chat_messages(Nadia.Client.t(), integer(), integer()) :: {:ok, [Nadia.Model.Message.t()]} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_user_personal_chat_messages/3.
@spec replace_managed_bot_token(integer()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as a string.
Args:
user_id- User identifier of the managed bot whose token will be replaced
@spec replace_managed_bot_token(Nadia.Client.t(), integer()) :: {:ok, binary()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.replace_managed_bot_token/2.
Use this method to change the access settings of a managed bot. Returns True on success.
Args:
user_id- User identifier of the managed bot whose access settings will be changedis_access_restricted- Pass true if only selected users can access the botoptions- keyword list of options
Options:
:added_user_ids- Array of user identifiers allowed to access the bot
@spec set_managed_bot_access_settings(integer(), boolean(), [{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_managed_bot_access_settings/3.
@spec set_managed_bot_access_settings(Nadia.Client.t(), integer(), boolean(), [ {atom(), any()} ]) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.set_managed_bot_access_settings/4.
Gifts And Verification
@spec get_available_gifts() :: {:ok, Nadia.Model.Gifts.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get all gifts that can be sent by the bot.
Returns a Nadia.Model.Gifts object on success.
@spec get_available_gifts(Nadia.Client.t()) :: {:ok, Nadia.Model.Gifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_available_gifts/1.
@spec get_chat_gifts(integer() | binary()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get gifts owned by a chat.
Returns a Nadia.Model.OwnedGifts object on success.
Args:
chat_id- Unique identifier for the target chat or username of the target channeloptions- keyword list or map of options
@spec get_chat_gifts(integer() | binary(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
@spec get_chat_gifts(Nadia.Client.t(), integer() | binary()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_gifts/2.
@spec get_chat_gifts( Nadia.Client.t(), integer() | binary(), [{atom(), any()}] | map() ) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_chat_gifts/3.
@spec get_user_gifts(integer()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Use this method to get gifts owned by a user.
Returns a Nadia.Model.OwnedGifts object on success.
Args:
user_id- Unique identifier of the target useroptions- keyword list or map of options
@spec get_user_gifts(integer(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
@spec get_user_gifts(Nadia.Client.t(), integer()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_user_gifts/2.
@spec get_user_gifts(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) :: {:ok, Nadia.Model.OwnedGifts.t()} | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.get_user_gifts/3.
@spec remove_chat_verification(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove verification from a chat that is currently verified on behalf
of the organization represented by the bot.
Returns :ok on success.
@spec remove_chat_verification(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_chat_verification/2.
@spec remove_user_verification(integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to remove verification from a user who is currently verified on behalf
of the organization represented by the bot.
Returns :ok on success.
@spec remove_user_verification(Nadia.Client.t(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.remove_user_verification/2.
@spec send_gift(binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to send a gift to a user or channel chat.
Returns :ok on success.
Args:
gift_id- Identifier of the giftoptions- keyword list or map of options, including required:user_idor:chat_id
Options:
:user_id- Unique identifier of the target user:chat_id- Unique identifier or username of the target channel chat:pay_for_upgrade- Pass true to pay for the gift upgrade from the bot's balance:text- Text that will be shown along with the gift:text_parse_mode- Mode for parsing entities in the text:text_entities- JSON-serializable array of message entities or pre-encoded JSON
@spec send_gift(binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec send_gift(Nadia.Client.t(), binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.send_gift/2.
@spec send_gift(Nadia.Client.t(), binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.send_gift/3.
@spec verify_chat(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to verify a chat on behalf of the organization represented by the bot.
Returns :ok on success.
@spec verify_chat(integer() | binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec verify_chat(Nadia.Client.t(), integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.verify_chat/2.
@spec verify_chat(Nadia.Client.t(), integer() | binary(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.verify_chat/3.
@spec verify_user(integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Use this method to verify a user on behalf of the organization represented by the bot.
Returns :ok on success.
@spec verify_user(integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
@spec verify_user(Nadia.Client.t(), integer()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.verify_user/2.
@spec verify_user(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) :: :ok | {:error, Nadia.Model.Error.t()}
Callback implementation for Nadia.Behaviour.verify_user/3.