Nadia (nadia v1.1.0)

View Source

Provides 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

Functions

Use this method to add a new sticker to a set created by the bot. Returns True on success.

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.

Use this method to process a received chat join request query. Returns :ok on success.

Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.

Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.

Use this method to respond to pre-checkout queries. Returns :ok on success.

Use this method to reply to shipping queries. Returns :ok on success.

Use this method to set the result of an interaction with a Web App. On success, a SentWebAppMessage object is returned.

Use this method to approve a chat join request. Returns True on success.

Use this method to approve a suggested post in a direct messages chat. Returns :ok on success.

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.

Use this method to ban a channel chat in a supergroup or a channel. Returns True on success.

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 close an open forum topic. Returns True on success.

Use this method to close an open General forum topic. Returns True on success.

Use this method to convert a gift received by a managed business account to Telegram Stars. Returns :ok on success.

Use this method to copy messages of any kind. On success, the MessageId of the sent message is returned.

Use this method to copy multiple messages of any kind. On success, an array of MessageId objects is returned.

Use this method to create an additional invite link for a chat. Returns the new invite link as a ChatInviteLink object.

Use this method to create a subscription invite link for a channel chat. Returns the new invite link as a ChatInviteLink object.

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.

Use this method to create a link for an invoice. On success, the created invoice link is returned as a string.

Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.

Use this method to decline a chat join request. Returns True on success.

Use this method to decline a suggested post in a direct messages chat. Returns :ok on success.

Use this method to remove recent reactions added by a given user or chat. Returns True on success.

Use this method to delete messages on behalf of a business account. Returns :ok on success.

Use this method to delete a chat photo. Returns True on success.

Use this method to delete a group sticker set from a supergroup. Returns True on success.

Use this method to delete a forum topic and all its messages. Returns True on success.

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.

Use this method to delete multiple messages simultaneously. Returns True on success.

Use this method to delete the list of the bot's commands for the given scope and user language. Returns :ok on success.

Use this method to delete a sticker from a set created by the bot. Returns True on success.

Use this method to delete a sticker set created by the bot. Returns True on success.

Use this method to delete a story previously posted by the bot on behalf of a managed business account. Returns :ok on success.

Use this method to remove webhook integration if you decide to switch back to Nadia.get_updates/1. Returns :ok on success.

Use this method to edit a non-primary invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.

Use this method to edit a subscription invite link created by the bot. Returns the edited invite link as a ChatInviteLink object.

Use this method to edit name and icon of a forum topic. Returns True on success.

Use this method to edit the name of the General forum topic. Returns True on success.

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.

Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.

Use this method to edit live location messages. On success, the edited Message is returned, or :ok is returned when editing an inline message.

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.

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.

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

Use this method to edit a story previously posted by the bot on behalf of a managed business account. Returns a Story object.

Use this method to cancel or re-enable extension of a Telegram Stars subscription. Returns :ok on success.

Use this method to generate a new primary invite link for a chat. Returns the new invite link as String on success.

Use this method to forward messages of any kind. On success, the sent Message is returned.

Use this method to forward multiple messages of any kind. On success, an array of MessageId objects is returned.

Use this method to get all gifts that can be sent by the bot. Returns a Nadia.Model.Gifts object on success.

Use this method to get gifts received and owned by a managed business account. Returns a Nadia.Model.OwnedGifts object on success.

Use this method to get the Telegram Stars balance of a managed business account. Returns a StarAmount object.

Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object.

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.

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.

Use this method to get gifts owned by a chat. Returns a Nadia.Model.OwnedGifts object on success.

Use this method to get information about a member of a chat. Returns a ChatMember object on success.

Use this method to get the number of members in a chat. Returns Int on success.

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.

Use this method to get information about custom emoji stickers by their identifiers. Returns an array of Sticker objects.

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.

Use this method to get link for file for subsequent use. This method is an extension of the get_file method.

Use this method to get custom emoji stickers that can be used as forum topic icons. Returns an array of Sticker objects.

Use this method to get data for game high score tables. Returns a list of GameHighScore objects.

Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object.

Use this method to get the token of a managed bot. Returns the token as a string.

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.

Use this method to get the current default administrator rights of the bot. Returns Nadia.Model.ChatAdministratorRights on success.

Use this method to get the current bot description for the given user language. Returns a Nadia.Model.BotDescription on success.

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.

Use this method to get the current bot short description for the given user language. Returns a Nadia.Model.BotShortDescription on success.

Use this method to get the current Telegram Stars balance of the bot. Returns a StarAmount object.

Use this method to get the bot's Telegram Star transactions. Returns a StarTransactions object.

Use this method to get a sticker set. On success, a StickerSet object is returned.

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.

Use this method to get the list of boosts added to a chat by a user. Returns a UserChatBoosts object.

Use this method to get gifts owned by a user. Returns a Nadia.Model.OwnedGifts object on success.

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.

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

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.

Use this method to gift a Telegram Premium subscription to a user. Returns :ok on success.

Use this method to hide the General forum topic. Returns True on success.

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

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 pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.

Use this method to post a story on behalf of a managed business account. Returns a Story object.

Use this method to promote or demote a user in a supergroup or a channel. Returns True on success.

Use this method to mark an incoming message as read on behalf of a business account. Returns :ok on success.

Use this method to refund a successful Telegram Stars payment. Returns :ok on success.

Use this method to remove the current profile photo of a managed business account. Returns :ok on success.

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.

Use this method to remove the bot's profile photo. Returns :ok on success.

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.

Use this method to reopen a closed forum topic. Returns True on success.

Use this method to reopen a closed General forum topic. Returns True on success.

Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as a string.

Use this method to replace an existing sticker in a sticker set with a new one. Returns True on success.

Use this method to repost a story on behalf of a managed business account. Returns a Story object.

Use this method to restrict a user in a supergroup. Returns True on success.

Use this method to revoke an invite link created by the bot. Returns the revoked invite link as a ChatInviteLink object.

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.

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.

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).

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.

Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.

Use this method to send phone contacts. On success, the sent Message is returned.

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

Use this method to send a game. On success, the sent Message is returned.

Use this method to send a gift to a user or channel chat. Returns :ok on success.

Use this method to send invoices. On success, the sent Message is returned.

Use this method to send live photos. On success, the sent Message is returned.

Use this method to send point on the map. On success, the sent Message is returned.

Use this method to send an album of photos, videos, documents or audios. On success, an array of sent Messages is returned.

Use this method to send text messages. On success, the sent Message is returned.

Use this method to stream a partial message draft to a user. Returns :ok on success.

Use this method to send paid media. On success, the sent Message is returned.

Use this method to send photos. On success, the sent Message is returned.

Use this method to send a native poll. On success, the sent Message is returned.

Use this method to send rich messages. On success, the sent Message is returned.

Use this method to stream a partial rich message to a user while the message is being generated. Returns :ok on success.

Use this method to send .webp stickers. On success, the sent Message is returned.

Use this method to send information about a venue. On success, the sent Message is returned.

Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

Use this method to send video messages. On success, the sent Message is returned.

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

Use this method to change the bio of a managed business account. Returns :ok on success.

Use this method to change the gift settings of a managed business account. Returns :ok on success.

Use this method to change the first and last name of a managed business account. Returns :ok on success.

Use this method to change the profile photo of a managed business account. Returns :ok on success.

Use this method to change the username of a managed business account. Returns :ok on success.

Use this method to set a custom title for an administrator in a supergroup. Returns True on success.

Use this method to change the description of a chat. Returns True on success.

Use this method to change the tag of a user in a direct messages chat. Returns True on success.

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns :ok on success.

Use this method to set default chat permissions for all members. Returns True on success.

Use this method to set a new profile photo for the chat. Returns True on success.

Use this method to set a new group sticker set for a supergroup. Returns True on success.

Use this method to change the title of a chat. Returns True on success.

Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.

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.

Use this method to change the access settings of a managed bot. Returns True on success.

Use this method to change the chosen reactions on a message. Returns True on success.

Use this method to change the list of the bot's commands. Returns :ok on success.

Use this method to change the default administrator rights requested by the bot. Returns :ok on success.

Use this method to change the bot's description. Returns :ok on success.

Use this method to change the bot's name. Returns :ok on success.

Callback implementation for Nadia.Behaviour.set_my_name/1.

Use this method to change the bot's profile photo. Returns :ok on success.

Use this method to change the bot's short description. Returns :ok on success.

Use this method to inform a user that Telegram Passport elements they provided contain errors. Returns :ok on success.

Use this method to change the list of emoji assigned to a regular or custom emoji sticker. Returns True on success.

Use this method to change search keywords assigned to a regular or custom emoji sticker. Returns True on success.

Use this method to change the mask position of a mask sticker. Returns True on success.

Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

Use this method to set the thumbnail of a regular or mask sticker set. Returns True on success.

Use this method to set the title of a created sticker set. Returns True on success.

Use this method to change the emoji status for a given user. Returns :ok on success.

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.

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.

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

Use this method to transfer Telegram Stars from a business account balance to the bot. Returns :ok on success.

Use this method to transfer an owned gift to another user. Returns :ok on success.

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.

Use this method to unban a previously banned channel chat. Returns True on success.

Use this method to unhide the General forum topic. Returns True on success.

Use this method to clear the list of pinned messages in a chat. Returns True on success.

Use this method to clear the list of pinned messages in a forum topic. Returns True on success.

Use this method to clear pinned messages in the General forum topic. Returns True on success.

Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.

Use this method to upgrade a gift received by a managed business account. Returns :ok on success.

Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

Use this method to verify a chat on behalf of the organization represented by the bot. Returns :ok on success.

Use this method to verify a user on behalf of the organization represented by the bot. Returns :ok on success.

Functions

add_sticker_to_set(user_id, name, png_sticker, emojis)

Use this method to add a new sticker to a set created by the bot. Returns True on success.

Args:

  • user_id - User identifier of created sticker set owner
  • name - Sticker set name
  • png_sticker - Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Either a file_id to resend a file that is already on the Telegram servers, or a file_path to upload a new file from local, or a HTTP URL to get a file from the internet.
  • emojis - One or more emoji corresponding to the sticker

Options:

add_sticker_to_set(client, user_id, name, png_sticker, emojis)

@spec add_sticker_to_set(integer(), binary(), binary(), binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

add_sticker_to_set(client, user_id, name, png_sticker, emojis, options)

@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.

answer_callback_query(callback_query_id)

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 answered
  • options - orddict 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.

answer_callback_query(client, callback_query_id)

@spec answer_callback_query(binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.answer_callback_query/2.

answer_callback_query(client, callback_query_id, options)

@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.

answer_chat_join_request_query(chat_join_request_query_id, result)

@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.

answer_chat_join_request_query(client, chat_join_request_query_id, result)

@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.

answer_guest_query(guest_query_id, result)

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 answered
  • result - An inline query result describing the message to be sent
  • options - orddict of options

answer_guest_query(client, guest_query_id, result)

@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.

answer_guest_query(client, guest_query_id, result, options)

@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.

answer_inline_query(inline_query_id, results)

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 query
  • results - An array of results for the inline query
  • options - orddict 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 query
  • next_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.

answer_inline_query(client, inline_query_id, results)

@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.

answer_inline_query(client, inline_query_id, results, options)

@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.

answer_pre_checkout_query(pre_checkout_query_id, ok)

@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 answered
  • ok - Pass true if the bot is ready to proceed with the order
  • options - orddict of options

Options:

  • :error_message - Error message to display when ok is false

answer_pre_checkout_query(client, pre_checkout_query_id, ok)

@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.

answer_pre_checkout_query(client, pre_checkout_query_id, ok, options)

@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.

answer_shipping_query(shipping_query_id, ok)

@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 answered
  • ok - Pass true if delivery to the specified address is possible
  • options - orddict of options

Options:

  • :shipping_options - JSON-serializable list of shipping options
  • :error_message - Error message to display when ok is false

answer_shipping_query(client, shipping_query_id, ok)

@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.

answer_shipping_query(client, shipping_query_id, ok, options)

@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.

answer_web_app_query(web_app_query_id, result)

@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 answered
  • result - An inline query result describing the message to be sent

answer_web_app_query(client, web_app_query_id, result)

@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.

approve_chat_join_request(chat_id, user_id)

@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.

approve_chat_join_request(client, chat_id, user_id)

@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.

approve_suggested_post(chat_id, message_id)

@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 chat
  • message_id - Identifier of a suggested post message to approve
  • options - orddict of options

approve_suggested_post(client, chat_id, message_id)

@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.

approve_suggested_post(client, chat_id, message_id, options)

@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.

ban_chat_member(chat_id, user_id)

@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 user
  • options - orddict of options

ban_chat_member(client, chat_id, user_id)

@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.

ban_chat_member(client, chat_id, user_id, options)

@spec ban_chat_member(Nadia.Client.t(), integer() | binary(), integer(), [
  {atom(), any()}
]) ::
  :ok | {:error, Nadia.Model.Error.t()}

ban_chat_sender_chat(chat_id, sender_chat_id)

@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.

ban_chat_sender_chat(client, chat_id, sender_chat_id)

@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.

close()

@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.

close(client)

@spec close(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.close/1.

close_forum_topic(chat_id, message_thread_id)

@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.

close_forum_topic(client, chat_id, message_thread_id)

@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.

close_general_forum_topic(chat_id)

@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.

close_general_forum_topic(client, chat_id)

@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.

convert_gift_to_stars(business_connection_id, owned_gift_id)

@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 connection
  • owned_gift_id - Unique identifier of the regular gift that should be converted to Telegram Stars

convert_gift_to_stars(client, business_connection_id, owned_gift_id)

@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.

copy_message(chat_id, from_chat_id, message_id)

@spec copy_message(integer() | binary(), integer() | binary(), integer()) ::
  {:ok, Nadia.Model.MessageId.t()} | {:error, Nadia.Model.Error.t()}

Use this method to copy messages of any kind. On success, the MessageId of the sent message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • from_chat_id - Unique identifier for the chat where the original message was sent or username of the target channel (in the format @channelusername)
  • message_id - Unique message identifier
  • options - orddict of options

Options:

  • :message_thread_id - Unique identifier for the target message thread
  • :direct_messages_topic_id - Identifier of the direct messages topic
  • :video_start_timestamp - New start timestamp for copied videos
  • :caption - New caption for media
  • :parse_mode - Mode for parsing entities in the new caption
  • :caption_entities - JSON-serialized list of caption entities
  • :show_caption_above_media - Pass True to show the caption above media
  • :disable_notification - Sends the message silently or without notification
  • :protect_content - Protects the contents of the sent message
  • :allow_paid_broadcast - Allows paid broadcast throughput
  • :message_effect_id - Unique identifier of the message effect to be added
  • :suggested_post_parameters - Suggested post parameters
  • :reply_parameters - Description of the message to reply to
  • :reply_markup - Additional interface options

copy_message(client, chat_id, from_chat_id, message_id)

@spec copy_message(integer() | binary(), integer() | binary(), integer(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.MessageId.t()} | {:error, Nadia.Model.Error.t()}
@spec copy_message(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  integer()
) ::
  {:ok, Nadia.Model.MessageId.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.copy_message/4.

copy_message(client, chat_id, from_chat_id, message_id, options)

@spec copy_message(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  integer(),
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.MessageId.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.copy_message/5.

copy_messages(chat_id, from_chat_id, message_ids)

@spec copy_messages(integer() | binary(), integer() | binary(), [integer()]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Use this method to copy multiple messages of any kind. On success, an array of MessageId objects is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • from_chat_id - Unique identifier for the chat where the original messages were sent or username of the target channel (in the format @channelusername)
  • message_ids - List of message identifiers
  • options - orddict of options

Options:

  • :message_thread_id - Unique identifier for the target message thread
  • :direct_messages_topic_id - Identifier of the direct messages topic
  • :disable_notification - Sends the messages silently or without notification
  • :protect_content - Protects the contents of the sent messages
  • :remove_caption - Pass True to copy the messages without their captions

copy_messages(client, chat_id, from_chat_id, message_ids)

@spec copy_messages(integer() | binary(), integer() | binary(), [integer()], [
  {atom(), any()}
]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}
@spec copy_messages(Nadia.Client.t(), integer() | binary(), integer() | binary(), [
  integer()
]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.copy_messages/4.

copy_messages(client, chat_id, from_chat_id, message_ids, options)

@spec copy_messages(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  [integer()],
  [
    {atom(), any()}
  ]
) :: {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.copy_messages/5.

create_chat_invite_link(chat_id)

@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.

create_chat_invite_link(client, chat_id)

@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.

create_chat_invite_link(client, chat_id, options)

@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.

create_chat_subscription_invite_link(chat_id, subscription_period, subscription_price)

@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.

create_chat_subscription_invite_link(client, chat_id, subscription_period, subscription_price)

@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.

create_chat_subscription_invite_link(client, chat_id, subscription_period, subscription_price, options)

@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.

create_forum_topic(chat_id, name)

@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 supergroup
  • name - Topic name
  • options - orddict 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

create_forum_topic(client, chat_id, name)

@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.

create_forum_topic(client, chat_id, name, options)

@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.

create_invoice_link(title, description, payload, currency, prices)

@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 name
  • description - Product description
  • payload - Bot-defined invoice payload
  • currency - Three-letter ISO 4217 currency code, or XTR for Stars
  • prices - JSON-serializable price breakdown array or a pre-encoded JSON string
  • options - orddict or map of options

create_invoice_link(client, title, description, payload, currency, prices)

@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.

create_invoice_link(client, title, description, payload, currency, prices, options)

@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.

create_new_sticker_set(user_id, name, title, png_sticker, emojis)

Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.

Args:

  • user_id - User identifier of created sticker set owner
  • name - Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “by<bot username>”. <bot_username> is case insensitive. 1-64 characters.
  • title - Sticker set title, 1-64 characters
  • png_sticker - Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Either a file_id to resend a file that is already on the Telegram servers, or a file_path to upload a new file from local, or a HTTP URL to get a file from the internet.
  • emojis - One or more emoji corresponding to the sticker

Options:

  • contains_masks - Pass True, if a set of mask stickers should be created
  • mask_position - A Nadia.Model.MaskPosition object for position where the mask should be placed on faces

create_new_sticker_set(client, user_id, name, title, png_sticker, emojis)

@spec create_new_sticker_set(integer(), binary(), binary(), binary(), binary(), [
  {atom(), any()}
]) ::
  :ok | {:error, Nadia.Model.Error.t()}

create_new_sticker_set(client, user_id, name, title, png_sticker, emojis, options)

@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.

decline_chat_join_request(chat_id, user_id)

@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.

decline_chat_join_request(client, chat_id, user_id)

@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.

decline_suggested_post(chat_id, message_id)

@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 chat
  • message_id - Identifier of a suggested post message to decline
  • options - orddict of options

decline_suggested_post(client, chat_id, message_id)

@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.

decline_suggested_post(client, chat_id, message_id, options)

@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.

delete_all_message_reactions(chat_id)

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

delete_all_message_reactions(client, chat_id)

@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.

delete_all_message_reactions(client, chat_id, options)

@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.

delete_business_messages(business_connection_id, message_ids)

@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 connection
  • message_ids - List of message identifiers to delete

delete_business_messages(client, business_connection_id, message_ids)

@spec delete_business_messages(Nadia.Client.t(), binary(), [integer()]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_business_messages/3.

delete_chat_photo(chat_id)

@spec delete_chat_photo(integer() | binary()) :: :ok | {:error, Nadia.Model.Error.t()}

Use this method to delete a chat photo. Returns True on success.

delete_chat_photo(client, chat_id)

@spec delete_chat_photo(Nadia.Client.t(), integer() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_chat_photo/2.

delete_chat_sticker_set(chat_id)

@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.

delete_chat_sticker_set(client, chat_id)

@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.

delete_forum_topic(chat_id, message_thread_id)

@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.

delete_forum_topic(client, chat_id, message_thread_id)

@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.

delete_message(chat_id, message_id)

@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

delete_message(client, chat_id, message_id)

@spec delete_message(Nadia.Client.t(), integer() | binary(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

delete_message_reaction(chat_id, message_id)

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 message
  • options - orddict 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

delete_message_reaction(client, chat_id, message_id)

@spec delete_message_reaction(integer() | binary(), integer(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_message_reaction/3.

delete_message_reaction(client, chat_id, message_id, options)

@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.

delete_messages(chat_id, message_ids)

@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

delete_messages(client, chat_id, message_ids)

@spec delete_messages(Nadia.Client.t(), integer() | binary(), [integer()]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_messages/3.

delete_my_commands()

@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.

delete_my_commands(client)

@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.

delete_my_commands(client, options)

@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.

delete_sticker_from_set(sticker)

@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

delete_sticker_from_set(client, 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.

delete_sticker_set(name)

@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

delete_sticker_set(client, name)

@spec delete_sticker_set(Nadia.Client.t(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_sticker_set/2.

delete_story(business_connection_id, story_id)

@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 connection
  • story_id - Unique identifier of the story to delete

delete_story(client, business_connection_id, story_id)

@spec delete_story(Nadia.Client.t(), binary(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_story/3.

delete_webhook()

@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 - orddict of options

Options:

  • :drop_pending_updates - Pass True to drop all pending updates

delete_webhook(client)

@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.

delete_webhook(client, options)

@spec delete_webhook(Nadia.Client.t(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.delete_webhook/2.

edit_chat_invite_link(chat_id, invite_link)

@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.

edit_chat_invite_link(client, chat_id, invite_link)

@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.

edit_chat_invite_link(client, chat_id, invite_link, options)

@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.

edit_chat_subscription_invite_link(chat_id, invite_link)

@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.

edit_chat_subscription_invite_link(client, chat_id, invite_link)

@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.

edit_chat_subscription_invite_link(client, chat_id, invite_link, options)

@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.

edit_forum_topic(chat_id, message_thread_id)

@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.

edit_forum_topic(client, chat_id, message_thread_id)

@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.

edit_forum_topic(client, chat_id, message_thread_id, options)

@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.

edit_general_forum_topic(chat_id, name)

@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.

edit_general_forum_topic(client, chat_id, name)

@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.

edit_message_caption(chat_id, message_id, inline_message_id)

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 message
  • inline_message_id - Required if chat_id and message_id are not specified. Identifier of the inline message
  • options - orddict of options

Options:

edit_message_caption(client, chat_id, message_id, inline_message_id)

@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.

edit_message_caption(client, chat_id, message_id, inline_message_id, options)

@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.

edit_message_checklist(business_connection_id, chat_id, message_id, checklist)

@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 connection
  • chat_id - Unique identifier for the target chat or username of the target bot
  • message_id - Unique identifier for the target message
  • checklist - JSON-serializable checklist object or a pre-encoded JSON string
  • options - orddict of options

edit_message_checklist(client, business_connection_id, chat_id, message_id, checklist)

@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.

edit_message_checklist(client, business_connection_id, chat_id, message_id, checklist, options)

@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.

edit_message_live_location(latitude, longitude, options)

@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 location
  • longitude - Longitude of new location
  • options - orddict of options

edit_message_live_location(client, latitude, longitude, 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.

edit_message_media(media, options)

@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 - JSON-serializable media object or a pre-encoded JSON string
  • options - orddict of options

edit_message_media(client, media, options)

@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.

edit_message_reply_markup(chat_id, message_id, inline_message_id)

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 message
  • inline_message_id - Required if chat_id and message_id are not specified. Identifier of the inline message
  • options - orddict of options

Options:

edit_message_reply_markup(client, chat_id, message_id, inline_message_id)

@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.

edit_message_reply_markup(client, chat_id, message_id, inline_message_id, options)

@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.

edit_message_text(chat_id, message_id, inline_message_id, text)

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 message
  • inline_message_id - Required if chat_id and message_id are not specified. Identifier of the inline message
  • text - New text of the message
  • options - orddict 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

edit_message_text(client, chat_id, message_id, inline_message_id, text)

@spec edit_message_text(
  integer() | binary(),
  integer() | nil,
  binary() | nil,
  binary() | nil,
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.edit_message_text/5.

edit_message_text(client, chat_id, message_id, inline_message_id, text, options)

@spec edit_message_text(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | nil,
  binary() | nil,
  binary() | nil,
  [{atom(), any()}]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.edit_message_text/6.

edit_story(business_connection_id, story_id, content)

@spec edit_story(binary(), integer(), 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 connection
  • story_id - Unique identifier of the story to edit
  • content - JSON-serializable story content object or a pre-encoded JSON string
  • options - orddict 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 - JSON-serializable story areas array or a pre-encoded JSON string

edit_story(client, business_connection_id, story_id, content)

@spec edit_story(
  binary(),
  integer(),
  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(),
  list() | map() | struct() | binary()
) ::
  {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.edit_story/4.

edit_story(client, business_connection_id, story_id, content, options)

@spec edit_story(
  Nadia.Client.t(),
  binary(),
  integer(),
  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.

edit_user_star_subscription(user_id, telegram_payment_charge_id, is_canceled)

@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 edited
  • telegram_payment_charge_id - Telegram payment identifier for the subscription
  • is_canceled - Pass true to cancel extension, or false to re-enable it

edit_user_star_subscription(client, user_id, telegram_payment_charge_id, is_canceled)

@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.

export_chat_invite_link(chat_id)

@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.

export_chat_invite_link(client, chat_id)

@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.

forward_message(chat_id, from_chat_id, message_id)

@spec forward_message(integer() | binary(), integer() | binary(), integer()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to forward messages of any kind. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • from_chat_id - Unique identifier for the chat where the original message was sent or username of the target channel (in the format @channelusername)
  • message_id - Unique message identifier
  • options - orddict of options

Options:

  • :message_thread_id - Unique identifier for the target message thread
  • :direct_messages_topic_id - Identifier of the direct messages topic
  • :video_start_timestamp - New start timestamp for forwarded videos
  • :disable_notification - Sends the message silently or without notification
  • :protect_content - Protects the contents of the forwarded message
  • :message_effect_id - Unique identifier of the message effect to be added
  • :suggested_post_parameters - Suggested post parameters

forward_message(client, chat_id, from_chat_id, message_id)

@spec forward_message(integer() | binary(), integer() | binary(), integer(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec forward_message(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  integer()
) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.forward_message/4.

forward_message(client, chat_id, from_chat_id, message_id, options)

@spec forward_message(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  integer(),
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.forward_message/5.

forward_messages(chat_id, from_chat_id, message_ids)

@spec forward_messages(integer() | binary(), integer() | binary(), [integer()]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Use this method to forward multiple messages of any kind. On success, an array of MessageId objects is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • from_chat_id - Unique identifier for the chat where the original messages were sent or username of the target channel (in the format @channelusername)
  • message_ids - List of message identifiers
  • options - orddict of options

Options:

  • :message_thread_id - Unique identifier for the target message thread
  • :direct_messages_topic_id - Identifier of the direct messages topic
  • :disable_notification - Sends the messages silently or without notification
  • :protect_content - Protects the contents of the forwarded messages

forward_messages(client, chat_id, from_chat_id, message_ids)

@spec forward_messages(integer() | binary(), integer() | binary(), [integer()], [
  {atom(), any()}
]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}
@spec forward_messages(Nadia.Client.t(), integer() | binary(), integer() | binary(), [
  integer()
]) ::
  {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.forward_messages/4.

forward_messages(client, chat_id, from_chat_id, message_ids, options)

@spec forward_messages(
  Nadia.Client.t(),
  integer() | binary(),
  integer() | binary(),
  [integer()],
  [
    {atom(), any()}
  ]
) :: {:ok, [Nadia.Model.MessageId.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.forward_messages/5.

get_available_gifts()

@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.

get_available_gifts(client)

@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.

get_business_account_gifts(business_connection_id)

@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 connection
  • options - orddict or map of options

get_business_account_gifts(client, business_connection_id)

@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.

get_business_account_gifts(client, business_connection_id, options)

@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.

get_business_account_star_balance(business_connection_id)

@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

get_business_account_star_balance(client, business_connection_id)

@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.

get_business_connection(business_connection_id)

@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

get_business_connection(client, business_connection_id)

@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.

get_chat(chat_id)

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

get_chat(client, chat_id)

@spec get_chat(Nadia.Client.t(), integer() | binary()) ::
  {:ok, Chat.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_chat/2.

get_chat_administrators(chat_id)

@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 - orddict of options

Options:

  • :return_bots - Pass True to include bots in the returned administrator list

get_chat_administrators(client, chat_id)

@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.

get_chat_administrators(client, chat_id, options)

@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.

get_chat_gifts(chat_id)

@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 channel
  • options - orddict or map of options

get_chat_gifts(client, chat_id)

@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.

get_chat_gifts(client, chat_id, options)

@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.

get_chat_member(chat_id, user_id)

@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

get_chat_member(client, chat_id, user_id)

@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.

get_chat_member_count(chat_id)

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

get_chat_member_count(client, chat_id)

@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.

get_chat_menu_button()

@spec get_chat_menu_button() ::
  {:ok, Nadia.Model.MenuButton.t()} | {:error, Nadia.Model.Error.t()}

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.

get_chat_menu_button(client)

@spec get_chat_menu_button([{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.MenuButton.t()} | {:error, Nadia.Model.Error.t()}
@spec get_chat_menu_button(Nadia.Client.t()) ::
  {:ok, Nadia.Model.MenuButton.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_chat_menu_button/1.

get_chat_menu_button(client, options)

@spec get_chat_menu_button(Nadia.Client.t(), [{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.MenuButton.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_chat_menu_button/2.

get_custom_emoji_stickers(custom_emoji_ids)

@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

get_custom_emoji_stickers(client, custom_emoji_ids)

@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.

get_file(file_id)

@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

get_file(client, file_id)

@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.

get_file_link(file)

@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.

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"}

get_file_link(client, file)

@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.

get_forum_topic_icon_stickers()

@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.

get_forum_topic_icon_stickers(client)

@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.

get_game_high_scores(user_id)

@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 identifier
  • options - orddict or map of options

get_game_high_scores(client, user_id)

@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.

get_game_high_scores(client, user_id, options)

@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.

get_managed_bot_access_settings(user_id)

@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

get_managed_bot_access_settings(client, user_id)

@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.

get_managed_bot_token(user_id)

@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

get_managed_bot_token(client, user_id)

@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.

get_me()

@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.

get_me(client)

@spec get_me(Nadia.Client.t()) ::
  {:ok, Nadia.Model.User.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_me/1.

get_my_commands()

@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.

get_my_commands(client)

@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.

get_my_commands(client, options)

@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.

get_my_default_administrator_rights()

@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.

get_my_default_administrator_rights(client)

@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.

get_my_default_administrator_rights(client, options)

@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.

get_my_description()

@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.

get_my_description(client)

@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.

get_my_description(client, options)

@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.

get_my_name()

@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.

get_my_name(client)

@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.

get_my_name(client, options)

@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.

get_my_short_description()

@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.

get_my_short_description(client)

@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.

get_my_short_description(client, options)

@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.

get_my_star_balance()

@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.

get_my_star_balance(client)

@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.

get_star_transactions()

@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 - orddict or map of options

get_star_transactions(client)

@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.

get_star_transactions(client, options)

@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.

get_sticker_set(name)

@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

get_sticker_set(client, name)

@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.

get_updates()

Use this method to receive incoming updates using long polling. An Array of Update objects is returned.

Args:

  • options - orddict 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 as get_updates is called with an offset higher than its update_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

get_updates(client)

@spec get_updates([{atom(), any()}]) ::
  {:ok, [Nadia.Model.Update.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_updates/1.

get_updates(client, options)

@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.

get_user_chat_boosts(chat_id, user_id)

@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 channel
  • user_id - Unique identifier of the target user

get_user_chat_boosts(client, chat_id, user_id)

@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.

get_user_gifts(user_id)

@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 user
  • options - orddict or map of options

get_user_gifts(client, user_id)

@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.

get_user_gifts(client, user_id, options)

@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.

get_user_personal_chat_messages(user_id, limit)

@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 user
  • limit - The maximum number of messages to return

get_user_personal_chat_messages(client, user_id, limit)

@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.

get_user_profile_audios(user_id)

@spec get_user_profile_audios(integer()) ::
  {:ok, Nadia.Model.UserProfileAudios.t()} | {:error, Nadia.Model.Error.t()}

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

Args:

  • user_id - Unique identifier of the target user
  • options - orddict of options

Options:

  • :offset - Sequential number of the first audio to be returned
  • :limit - Limits the number of audios to be retrieved

get_user_profile_audios(client, user_id)

@spec get_user_profile_audios(integer(), [{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.UserProfileAudios.t()} | {:error, Nadia.Model.Error.t()}
@spec get_user_profile_audios(Nadia.Client.t(), integer()) ::
  {:ok, Nadia.Model.UserProfileAudios.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_user_profile_audios/2.

get_user_profile_audios(client, user_id, options)

@spec get_user_profile_audios(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.UserProfileAudios.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_user_profile_audios/3.

get_user_profile_photos(user_id)

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

Args:

  • user_id - Unique identifier of the target user
  • options - orddict of options

Options:

  • :offset - Sequential number of the first photo to be returned. By default, all photos are returned
  • :limit - Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100

get_user_profile_photos(client, user_id)

@spec get_user_profile_photos(integer(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.UserProfilePhotos.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_user_profile_photos/2.

get_user_profile_photos(client, user_id, options)

@spec get_user_profile_photos(Nadia.Client.t(), integer(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.UserProfilePhotos.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.get_user_profile_photos/3.

get_webhook_info()

@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.

get_webhook_info(client)

@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.

gift_premium_subscription(user_id, month_count, star_count)

@spec gift_premium_subscription(integer(), integer(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to gift a Telegram Premium subscription to a user. Returns :ok on success.

Args:

  • user_id - Unique identifier of the target user
  • month_count - Number of months the subscription will be active
  • star_count - Number of Telegram Stars to pay
  • options - orddict or map of options

Options:

  • :text - Text that will be shown along with the service message
  • :text_parse_mode - Mode for parsing entities in the text
  • :text_entities - JSON-serializable array of message entities or pre-encoded JSON

gift_premium_subscription(client, user_id, month_count, star_count)

@spec gift_premium_subscription(
  integer(),
  integer(),
  integer(),
  [{atom(), any()}] | map()
) ::
  :ok | {:error, Nadia.Model.Error.t()}
@spec gift_premium_subscription(Nadia.Client.t(), integer(), integer(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.gift_premium_subscription/4.

gift_premium_subscription(client, user_id, month_count, star_count, options)

@spec gift_premium_subscription(
  Nadia.Client.t(),
  integer(),
  integer(),
  integer(),
  [{atom(), any()}] | map()
) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.gift_premium_subscription/5.

hide_general_forum_topic(chat_id)

@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.

hide_general_forum_topic(client, chat_id)

@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.

leave_chat(chat_id)

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

leave_chat(client, chat_id)

@spec leave_chat(Nadia.Client.t(), integer() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.leave_chat/2.

log_out()

@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.

log_out(client)

@spec log_out(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.log_out/1.

pin_chat_message(chat_id, message_id)

Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. 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 a message to pin

Options:

  • disable_notification - Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.

pin_chat_message(client, chat_id, message_id)

@spec pin_chat_message(integer() | binary(), integer() | binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

pin_chat_message(client, chat_id, message_id, options)

@spec pin_chat_message(Nadia.Client.t(), integer() | binary(), integer() | binary(), [
  {atom(), any()}
]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.pin_chat_message/4.

post_story(business_connection_id, content, active_period)

@spec post_story(binary(), 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 connection
  • content - JSON-serializable story content object or a pre-encoded JSON string
  • active_period - Period after which the story is moved to the archive, in seconds
  • options - orddict 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 - JSON-serializable story areas array 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

post_story(client, business_connection_id, content, active_period)

@spec post_story(
  binary(),
  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(),
  list() | map() | struct() | binary(),
  integer()
) ::
  {:ok, Nadia.Model.Story.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.post_story/4.

post_story(client, business_connection_id, content, active_period, options)

@spec post_story(
  Nadia.Client.t(),
  binary(),
  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.

promote_chat_member(chat_id, user_id)

@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 channel
  • user_id - Unique identifier of the target user
  • options - orddict of options

promote_chat_member(client, chat_id, user_id)

@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.

promote_chat_member(client, chat_id, user_id, options)

@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.

read_business_message(business_connection_id, chat_id, message_id)

@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 connection
  • chat_id - Unique identifier of the chat in which the message was received
  • message_id - Unique identifier of the message to mark as read

read_business_message(client, business_connection_id, chat_id, message_id)

@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.

refund_star_payment(user_id, telegram_payment_charge_id)

@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 refunded
  • telegram_payment_charge_id - Telegram payment identifier

refund_star_payment(client, user_id, telegram_payment_charge_id)

@spec refund_star_payment(Nadia.Client.t(), integer(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.refund_star_payment/3.

remove_business_account_profile_photo(business_connection_id)

@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 connection
  • options - orddict of options

Options:

  • :is_public - Pass true to remove the public profile photo

remove_business_account_profile_photo(client, business_connection_id)

@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.

remove_business_account_profile_photo(client, business_connection_id, options)

@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.

remove_chat_verification(chat_id)

@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.

remove_chat_verification(client, chat_id)

@spec remove_chat_verification(Nadia.Client.t(), integer() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.remove_chat_verification/2.

remove_my_profile_photo()

@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.

remove_my_profile_photo(client)

@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.

remove_my_profile_photo(client, options)

@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.

remove_user_verification(user_id)

@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.

remove_user_verification(client, user_id)

@spec remove_user_verification(Nadia.Client.t(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.remove_user_verification/2.

reopen_forum_topic(chat_id, message_thread_id)

@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.

reopen_forum_topic(client, chat_id, message_thread_id)

@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.

reopen_general_forum_topic(chat_id)

@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.

reopen_general_forum_topic(client, chat_id)

@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.

replace_managed_bot_token(user_id)

@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

replace_managed_bot_token(client, user_id)

@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.

replace_sticker_in_set(user_id, name, old_sticker, sticker)

@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 owner
  • name - Sticker set name
  • old_sticker - File identifier of the replaced sticker
  • sticker - InputSticker object for the new sticker

replace_sticker_in_set(client, user_id, name, old_sticker, 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.

repost_story(business_connection_id, from_chat_id, from_story_id, active_period)

@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 connection
  • from_chat_id - Unique identifier of the chat which posted the story
  • from_story_id - Unique identifier of the story that should be reposted
  • active_period - Period after which the story is moved to the archive, in seconds
  • options - orddict 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

repost_story(client, business_connection_id, from_chat_id, from_story_id, active_period)

@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.

repost_story(client, business_connection_id, from_chat_id, from_story_id, active_period, options)

@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.

restrict_chat_member(chat_id, user_id, permissions)

@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 user
  • permissions - New user permissions
  • options - orddict of options

restrict_chat_member(client, chat_id, user_id, permissions)

@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.

restrict_chat_member(client, chat_id, user_id, permissions, options)

@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.

revoke_chat_invite_link(chat_id, invite_link)

@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.

revoke_chat_invite_link(client, chat_id, invite_link)

@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.

save_prepared_inline_message(user_id, result)

@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 message
  • result - An inline query result describing the message to be sent
  • options - orddict of options

save_prepared_inline_message(client, user_id, result)

@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.

save_prepared_inline_message(client, user_id, result, options)

@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.

save_prepared_keyboard_button(user_id, button)

@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 button
  • button - JSON-serializable keyboard button object or a pre-encoded JSON string

save_prepared_keyboard_button(client, user_id, button)

@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.

send_animation(chat_id, animation)

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • animation - Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data.

Options:

  • :duration - Duration of sent animation in seconds
  • :width - Animation width
  • :height - Animation height
  • :thumb - Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. thumbnail should be in JPEG format and less than 200 kB in size.
  • :caption - Animation caption (may also be used when resending animation by file_id), 0-1024 characters
  • :parse_mode - Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
  • :disable_notification - Sends the message silently. Users will receive a notification with no sound.
  • :reply_to_message_id - If the message is a reply, ID of the original message
  • :reply_markup - Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

send_animation(client, chat_id, animation)

@spec send_animation(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_animation/3.

send_animation(client, chat_id, animation, options)

@spec send_animation(Nadia.Client.t(), integer() | binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_animation/4.

send_audio(chat_id, audio)

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. This behavior will be phased out in the future. For sending voice messages, use the sendVoice method instead.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • audio - Audio to send. Either a file_id to resend an audio that is already on the Telegram servers, or a file_path to upload a new audio
  • options - orddict of options

Options:

  • :duration - Duration of the audio in seconds
  • :performer - Performer
  • :title - Track name
  • :disable_notification - Sends the message silently or without notification
  • :reply_to_message_id - If the message is a reply, ID of the original message
  • :reply_markup - Additional interface options. Instructions to hide keyboard or to force a reply from the user - Nadia.Model.ReplyKeyboardMarkup or Nadia.Model.ReplyKeyboardRemove or Nadia.Model.ForceReply

send_audio(client, chat_id, audio)

@spec send_audio(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_audio/3.

send_audio(client, chat_id, audio, options)

@spec send_audio(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_audio/4.

send_chat_action(chat_id, action)

@spec send_chat_action(integer() | binary(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • action - Type of action to broadcast. Choose one, depending on what the user is about to receive:
    • typing for text messages
    • upload_photo for photos
    • record_video or upload_video for videos
    • record_audio or upload_audio for audio files
    • upload_document for general files
    • find_location for location data
  • options - orddict of options

Options:

  • :business_connection_id - Unique identifier of the business connection
  • :message_thread_id - Unique identifier for the target message thread

send_chat_action(client, chat_id, action)

@spec send_chat_action(integer() | binary(), binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}
@spec send_chat_action(Nadia.Client.t(), integer() | binary(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_chat_action/3.

send_chat_action(client, chat_id, action, options)

@spec send_chat_action(Nadia.Client.t(), integer() | binary(), binary(), [
  {atom(), any()}
]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_chat_action/4.

send_chat_join_request_web_app(chat_join_request_query_id, web_app_url)

@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.

send_chat_join_request_web_app(client, chat_join_request_query_id, web_app_url)

@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.

send_checklist(business_connection_id, chat_id, checklist)

@spec send_checklist(
  binary(),
  integer() | binary(),
  list() | map() | struct() | binary()
) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.

Args:

  • business_connection_id - Unique identifier of the business connection
  • chat_id - Unique identifier for the target chat or username of the target bot
  • checklist - JSON-serializable checklist object or a pre-encoded JSON string
  • options - orddict of options

send_checklist(client, business_connection_id, chat_id, checklist)

@spec send_checklist(
  binary(),
  integer() | binary(),
  list() | map() | struct() | binary(),
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec send_checklist(
  Nadia.Client.t(),
  binary(),
  integer() | binary(),
  list() | map() | struct() | binary()
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_checklist/4.

send_checklist(client, business_connection_id, chat_id, checklist, options)

@spec send_checklist(
  Nadia.Client.t(),
  binary(),
  integer() | binary(),
  list() | map() | struct() | binary(),
  [{atom(), any()}]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_checklist/5.

send_contact(chat_id, phone_number, first_name)

Use this method to send phone contacts. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • phone_number - Contact's phone number
  • first_name - Contact's first name
  • options - orddict of options

Options:

send_contact(client, chat_id, phone_number, first_name)

@spec send_contact(integer() | binary(), binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_contact/4.

send_contact(client, chat_id, phone_number, first_name, options)

@spec send_contact(Nadia.Client.t(), integer() | binary(), binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_contact/5.

send_dice(chat_id)

@spec send_dice(integer() | binary()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

send_dice(client, chat_id)

@spec send_dice(integer() | binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec send_dice(Nadia.Client.t(), integer() | binary()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_dice/2.

send_dice(client, chat_id, options)

@spec send_dice(Nadia.Client.t(), integer() | binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_dice/3.

send_document(chat_id, document)

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • document - File to send. Either a file_id to resend a file that is already on the Telegram servers, or a file_path to upload a new file
  • options - orddict of options

Options:

send_document(client, chat_id, document)

@spec send_document(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_document/3.

send_document(client, chat_id, document, options)

@spec send_document(Nadia.Client.t(), integer() | binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_document/4.

send_game(chat_id, game_short_name)

@spec send_game(integer() | binary(), binary()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to send a game. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat
  • game_short_name - Short name of the game
  • options - orddict or map of options

send_game(client, chat_id, game_short_name)

@spec send_game(integer() | binary(), binary(), [{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec send_game(Nadia.Client.t(), integer() | binary(), binary()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_game/3.

send_game(client, chat_id, game_short_name, options)

@spec send_game(
  Nadia.Client.t(),
  integer() | binary(),
  binary(),
  [{atom(), any()}] | map()
) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_game/4.

send_gift(gift_id)

@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 gift
  • options - orddict or map of options, including required :user_id or :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

send_gift(client, gift_id)

@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.

send_gift(client, gift_id, options)

@spec send_gift(Nadia.Client.t(), binary(), [{atom(), any()}] | map()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_gift/3.

send_invoice(chat_id, title, description, payload, currency, prices)

@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 channel
  • title - Product name
  • description - Product description
  • payload - Bot-defined invoice payload
  • currency - Three-letter ISO 4217 currency code, or XTR for Stars
  • prices - JSON-serializable price breakdown array or a pre-encoded JSON string
  • options - orddict or map of options

send_invoice(client, chat_id, title, description, payload, currency, prices)

@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.

send_invoice(client, chat_id, title, description, payload, currency, prices, options)

@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.

send_live_photo(chat_id, live_photo, photo)

Use this method to send live photos. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • live_photo - Live photo media to send
  • photo - Cover photo to send as a regular Telegram parameter
  • options - orddict of options

send_live_photo(client, chat_id, live_photo, photo)

@spec send_live_photo(integer() | binary(), binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_live_photo/4.

send_live_photo(client, chat_id, live_photo, photo, options)

@spec send_live_photo(Nadia.Client.t(), integer() | binary(), binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_live_photo/5.

send_location(chat_id, latitude, longitude)

Use this method to send point on the map. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • latitude - Latitude of location
  • longitude - Longitude of location
  • options - orddict of options

Options:

send_location(client, chat_id, latitude, longitude)

@spec send_location(integer() | binary(), float(), float(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_location/4.

send_location(client, chat_id, latitude, longitude, options)

@spec send_location(Nadia.Client.t(), integer() | binary(), float(), float(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_location/5.

send_media_group(chat_id, media)

Use this method to send an album of photos, videos, documents or audios. On success, an array of sent Messages is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • media - JSON-serializable media array or a pre-encoded JSON string
  • options - orddict of options

send_media_group(client, chat_id, media)

@spec send_media_group(integer() | binary(), list() | map() | struct() | binary(), [
  {atom(), any()}
]) ::
  {:ok, [Nadia.Model.Message.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_media_group/3.

send_media_group(client, chat_id, media, options)

@spec send_media_group(
  Nadia.Client.t(),
  integer() | binary(),
  list() | map() | struct() | binary(),
  [
    {atom(), any()}
  ]
) :: {:ok, [Nadia.Model.Message.t()]} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_media_group/4.

send_message(chat_id, text)

Use this method to send text messages. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • text - Text of the message to be sent
  • options - orddict of options

Options:

  • :parse_mode - Use Markdown, if you want Telegram apps to show bold, italic and inline URLs in your bot's message
  • :disable_web_page_preview - Disables link previews for links in this message
  • :disable_notification - Sends the message silently or without notification
  • :reply_to_message_id - If the message is a reply, ID of the original message
  • :reply_markup - Additional interface options. Instructions to hide keyboard or to force a reply from the user - Nadia.Model.ReplyKeyboardMarkup or Nadia.Model.ReplyKeyboardRemove or Nadia.Model.ForceReply

send_message(client, chat_id, text)

@spec send_message(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_message/3.

send_message(client, chat_id, text, options)

@spec send_message(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_message/4.

send_message_draft(chat_id, draft_id)

@spec send_message_draft(integer() | binary(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to stream a partial message draft to a user. Returns :ok on success.

send_message_draft(client, chat_id, draft_id)

@spec send_message_draft(integer() | binary(), integer(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}
@spec send_message_draft(Nadia.Client.t(), integer() | binary(), integer()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_message_draft/3.

send_message_draft(client, chat_id, draft_id, options)

@spec send_message_draft(Nadia.Client.t(), integer() | binary(), integer(), [
  {atom(), any()}
]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_message_draft/4.

send_paid_media(chat_id, star_count, media)

Use this method to send paid media. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • star_count - Amount of Telegram Stars to be paid for the media
  • media - JSON-serializable paid media array or a pre-encoded JSON string
  • options - orddict of options

send_paid_media(client, chat_id, star_count, media)

@spec send_paid_media(
  integer() | binary(),
  integer(),
  list() | map() | struct() | binary(),
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_paid_media/4.

send_paid_media(client, chat_id, star_count, media, options)

@spec send_paid_media(
  Nadia.Client.t(),
  integer() | binary(),
  integer(),
  list() | map() | struct() | binary(),
  [{atom(), any()}]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_paid_media/5.

send_photo(chat_id, photo)

Use this method to send photos. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • photo - Photo to send. Either a file_id to resend a photo that is already on the Telegram servers, or a file_path to upload a new photo
  • options - orddict of options

Options:

  • :caption - Photo caption (may also be used when resending photos by file_id)
  • :disable_notification - Sends the message silently or without notification
  • :reply_to_message_id - If the message is a reply, ID of the original message
  • :reply_markup - Additional interface options. Instructions to hide keyboard or to force a reply from the user - Nadia.Model.ReplyKeyboardMarkup or Nadia.Model.ReplyKeyboardRemove or Nadia.Model.ForceReply

send_photo(client, chat_id, photo)

@spec send_photo(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_photo/3.

send_photo(client, chat_id, photo, options)

@spec send_photo(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_photo/4.

send_poll(chat_id, question, params)

@spec send_poll(integer() | binary(), binary(), [{atom(), any()}] | map()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to send a native poll. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • question - Poll question
  • params - orddict or map of Telegram parameters, including required :options

send_poll(client, chat_id, question, params)

@spec send_poll(
  Nadia.Client.t(),
  integer() | binary(),
  binary(),
  [{atom(), any()}] | map()
) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_poll/4.

send_rich_message(chat_id, rich_message)

@spec send_rich_message(integer() | binary(), list() | map() | struct() | binary()) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Use this method to send rich messages. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target bot, supergroup, or channel
  • rich_message - JSON-serializable InputRichMessage object or a pre-encoded JSON string
  • options - orddict of options

send_rich_message(client, chat_id, rich_message)

@spec send_rich_message(
  integer() | binary(),
  list() | map() | struct() | binary(),
  [{atom(), any()}] | map()
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}
@spec send_rich_message(
  Nadia.Client.t(),
  integer() | binary(),
  list() | map() | struct() | binary()
) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_rich_message/3.

send_rich_message(client, chat_id, rich_message, options)

@spec send_rich_message(
  Nadia.Client.t(),
  integer() | binary(),
  list() | map() | struct() | binary(),
  [{atom(), any()}] | map()
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_rich_message/4.

send_rich_message_draft(chat_id, draft_id, rich_message)

@spec send_rich_message_draft(
  integer(),
  integer(),
  list() | map() | struct() | binary()
) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to stream a partial rich message to a user while the message is being generated. Returns :ok on success.

send_rich_message_draft(client, chat_id, draft_id, rich_message)

@spec send_rich_message_draft(
  integer(),
  integer(),
  list() | map() | struct() | binary(),
  [
    {atom(), any()}
  ]
) :: :ok | {:error, Nadia.Model.Error.t()}
@spec send_rich_message_draft(
  Nadia.Client.t(),
  integer(),
  integer(),
  list() | map() | struct() | binary()
) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_rich_message_draft/4.

send_rich_message_draft(client, chat_id, draft_id, rich_message, options)

@spec send_rich_message_draft(
  Nadia.Client.t(),
  integer(),
  integer(),
  list() | map() | struct() | binary(),
  [{atom(), any()}]
) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_rich_message_draft/5.

send_sticker(chat_id, sticker)

Use this method to send .webp stickers. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • sticker - File to send. Either a file_id to resend a sticker that is already on the Telegram servers, or a file_path to upload a new sticker
  • options - orddict of options

Options:

send_sticker(client, chat_id, sticker)

@spec send_sticker(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_sticker/3.

send_sticker(client, chat_id, sticker, options)

@spec send_sticker(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_sticker/4.

send_venue(chat_id, latitude, longitude, title, address)

Use this method to send information about a venue. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • latitude - Latitude of location
  • longitude - Longitude of location
  • title - Name of the venue
  • address - Address of the venue
  • options - orddict of options

Options:

send_venue(client, chat_id, latitude, longitude, title, address)

@spec send_venue(integer() | binary(), float(), float(), binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_venue/6.

send_venue(client, chat_id, latitude, longitude, title, address, options)

@spec send_venue(
  Nadia.Client.t(),
  integer() | binary(),
  float(),
  float(),
  binary(),
  binary(),
  [
    {atom(), any()}
  ]
) :: {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_venue/7.

send_video(chat_id, video)

Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • video - Video to send. Either a file_id to resend a video that is already on the Telegram servers, or a file_path to upload a new video
  • options - orddict of options

Options:

  • :duration - Duration of the video in seconds
  • :caption - Video caption (may also be used when resending videos by file_id)
  • :disable_notification - Sends the message silently or without notification
  • :reply_to_message_id - If the message is a reply, ID of the original message
  • :reply_markup - Additional interface options. Instructions to hide keyboard or to force a reply from the user - Nadia.Model.ReplyKeyboardMarkup or Nadia.Model.ReplyKeyboardRemove or Nadia.Model.ForceReply

send_video(client, chat_id, video)

@spec send_video(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_video/3.

send_video(client, chat_id, video, options)

@spec send_video(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_video/4.

send_video_note(chat_id, video_note)

Use this method to send video messages. On success, the sent Message is returned.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • video_note - Video note to send. Either a file_id to resend a video note that is already on the Telegram servers, or a file_path to upload a new video note
  • options - orddict of options

send_video_note(client, chat_id, video_note)

@spec send_video_note(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_video_note/3.

send_video_note(client, chat_id, video_note, options)

@spec send_video_note(Nadia.Client.t(), integer() | binary(), binary(), [
  {atom(), any()}
]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_video_note/4.

send_voice(chat_id, voice)

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • voice - Audio to send. Either a file_id to resend an audio that is already on the Telegram servers, or a file_path to upload a new audio
  • options - orddict of options

Options:

send_voice(client, chat_id, voice)

@spec send_voice(integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_voice/3.

send_voice(client, chat_id, voice, options)

@spec send_voice(Nadia.Client.t(), integer() | binary(), binary(), [{atom(), any()}]) ::
  {:ok, Nadia.Model.Message.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.send_voice/4.

set_business_account_bio(business_connection_id)

@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 connection
  • options - orddict of options

Options:

  • :bio - New bio of the business account

set_business_account_bio(client, business_connection_id)

@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.

set_business_account_bio(client, business_connection_id, options)

@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.

set_business_account_gift_settings(business_connection_id, show_gift_button, accepted_gift_types)

@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 connection
  • show_gift_button - Whether the gift button must always be shown in the input field
  • accepted_gift_types - JSON-serializable accepted gift types object or pre-encoded JSON

set_business_account_gift_settings(client, business_connection_id, show_gift_button, accepted_gift_types)

@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.

set_business_account_name(business_connection_id, first_name)

@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 connection
  • first_name - New first name of the business account
  • options - orddict of options

Options:

  • :last_name - New last name of the business account

set_business_account_name(client, business_connection_id, first_name)

@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.

set_business_account_name(client, business_connection_id, first_name, options)

@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.

set_business_account_profile_photo(business_connection_id, photo)

@spec set_business_account_profile_photo(
  binary(),
  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.

Args:

  • business_connection_id - Unique identifier of the business connection
  • photo - JSON-serializable profile photo object or a pre-encoded JSON string
  • options - orddict of options

Options:

  • :is_public - Pass true to set the public profile photo

set_business_account_profile_photo(client, business_connection_id, photo)

@spec set_business_account_profile_photo(
  binary(),
  list() | map() | struct() | binary(),
  [{atom(), any()}] | map()
) :: :ok | {:error, Nadia.Model.Error.t()}
@spec set_business_account_profile_photo(
  Nadia.Client.t(),
  binary(),
  list() | map() | struct() | binary()
) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/3.

set_business_account_profile_photo(client, business_connection_id, photo, options)

@spec set_business_account_profile_photo(
  Nadia.Client.t(),
  binary(),
  list() | map() | struct() | binary(),
  [{atom(), any()}] | map()
) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_business_account_profile_photo/4.

set_business_account_username(business_connection_id)

@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 connection
  • options - orddict of options

Options:

  • :username - New username of the business account

set_business_account_username(client, business_connection_id)

@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.

set_business_account_username(client, business_connection_id, options)

@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.

set_chat_administrator_custom_title(chat_id, user_id, custom_title)

@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.

set_chat_administrator_custom_title(client, chat_id, user_id, custom_title)

@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.

set_chat_description(chat_id)

@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 channel
  • options - orddict of options

set_chat_description(client, chat_id)

@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.

set_chat_description(client, chat_id, options)

@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.

set_chat_member_tag(chat_id, user_id)

@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 chat
  • user_id - Unique identifier of the target user
  • options - orddict of options

set_chat_member_tag(client, chat_id, user_id)

@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.

set_chat_member_tag(client, chat_id, user_id, options)

@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.

set_chat_menu_button()

@spec set_chat_menu_button() :: :ok | {:error, Nadia.Model.Error.t()}

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns :ok on success.

set_chat_menu_button(client)

@spec set_chat_menu_button([{atom(), any()}] | map()) ::
  :ok | {:error, Nadia.Model.Error.t()}
@spec set_chat_menu_button(Nadia.Client.t()) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_chat_menu_button/1.

set_chat_menu_button(client, options)

@spec set_chat_menu_button(Nadia.Client.t(), [{atom(), any()}] | map()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_chat_menu_button/2.

set_chat_permissions(chat_id, permissions)

@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 supergroup
  • permissions - New default chat permissions
  • options - orddict of options

set_chat_permissions(client, chat_id, permissions)

@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.

set_chat_permissions(client, chat_id, permissions, options)

@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.

set_chat_photo(chat_id, photo)

@spec set_chat_photo(integer() | binary(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to set a new profile photo for the chat. Returns True on success.

set_chat_photo(client, chat_id, photo)

@spec set_chat_photo(Nadia.Client.t(), integer() | binary(), binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_chat_photo/3.

set_chat_sticker_set(chat_id, sticker_set_name)

@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.

set_chat_sticker_set(client, chat_id, sticker_set_name)

@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.

set_chat_title(chat_id, title)

@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.

set_chat_title(client, chat_id, title)

@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.

set_custom_emoji_sticker_set_thumbnail(name)

@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

set_custom_emoji_sticker_set_thumbnail(client, name)

@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.

set_custom_emoji_sticker_set_thumbnail(client, name, options)

@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.

set_game_score(user_id, score)

@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 identifier
  • score - New score
  • options - orddict or map of options

set_game_score(client, user_id, score)

@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.

set_game_score(client, user_id, score, options)

@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.

set_managed_bot_access_settings(user_id, is_access_restricted)

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 changed
  • is_access_restricted - Pass true if only selected users can access the bot
  • options - orddict of options

Options:

  • :added_user_ids - Array of user identifiers allowed to access the bot

set_managed_bot_access_settings(client, user_id, is_access_restricted)

@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.

set_managed_bot_access_settings(client, user_id, is_access_restricted, options)

@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.

set_message_reaction(chat_id, message_id)

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 message
  • options - orddict 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

set_message_reaction(client, chat_id, message_id)

@spec set_message_reaction(integer() | binary(), integer(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_message_reaction/3.

set_message_reaction(client, chat_id, message_id, options)

@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.

set_my_commands(commands)

@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.

set_my_commands(client, commands)

@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.

set_my_commands(client, commands, options)

@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.

set_my_default_administrator_rights()

@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.

set_my_default_administrator_rights(client)

@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.

set_my_default_administrator_rights(client, options)

@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.

set_my_description()

@spec set_my_description() :: :ok | {:error, Nadia.Model.Error.t()}

Use this method to change the bot's description. Returns :ok on success.

set_my_description(client)

@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.

set_my_description(client, options)

@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.

set_my_name()

@spec set_my_name() :: :ok | {:error, Nadia.Model.Error.t()}

Use this method to change the bot's name. Returns :ok on success.

set_my_name(client)

@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.

set_my_name(client, options)

@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.

set_my_profile_photo(photo)

@spec set_my_profile_photo(list() | map() | struct() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to change the bot's profile photo. Returns :ok on success.

set_my_profile_photo(client, photo)

@spec set_my_profile_photo(Nadia.Client.t(), list() | map() | struct() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_my_profile_photo/2.

set_my_short_description()

@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.

set_my_short_description(client)

@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.

set_my_short_description(client, options)

@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.

set_passport_data_errors(user_id, errors)

@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 identifier
  • errors - JSON-serializable list of PassportElementError objects

set_passport_data_errors(client, user_id, errors)

@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.

set_sticker_emoji_list(sticker, emoji_list)

@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 sticker
  • emoji_list - List of emoji associated with the sticker

set_sticker_emoji_list(client, sticker, emoji_list)

@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.

set_sticker_keywords(sticker)

@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

set_sticker_keywords(client, 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.

set_sticker_keywords(client, sticker, options)

@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.

set_sticker_mask_position(sticker)

@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:

set_sticker_mask_position(client, 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.

set_sticker_mask_position(client, sticker, options)

@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.

set_sticker_position_in_set(sticker, position)

@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 sticker
  • position - New sticker position in the set, zero-based

set_sticker_position_in_set(client, sticker, position)

@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.

set_sticker_set_thumbnail(name, user_id)

@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 name
  • user_id - User identifier of the sticker set owner

Options:

  • thumbnail - Sticker set thumbnail as a file identifier, URL, or attach reference
  • format - Format of the thumbnail

set_sticker_set_thumbnail(client, name, user_id)

@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.

set_sticker_set_thumbnail(client, name, user_id, options)

@spec set_sticker_set_thumbnail(
  Nadia.Client.t(),
  binary(),
  integer(),
  [{atom(), any()}] | map()
) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_sticker_set_thumbnail/4.

set_sticker_set_title(name, title)

@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 name
  • title - Sticker set title

set_sticker_set_title(client, name, 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.

set_user_emoji_status(user_id)

@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.

set_user_emoji_status(client, user_id)

@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.

set_user_emoji_status(client, user_id, options)

@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.

set_webhook()

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 - orddict of options

Options:

  • :url - HTTPS url to send updates to.

set_webhook(client)

@spec set_webhook([{atom(), any()}]) :: :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_webhook/1.

set_webhook(client, options)

@spec set_webhook(Nadia.Client.t(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.set_webhook/2.

stop_message_live_location(options)

@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 - orddict of options

stop_message_live_location(client, 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.

stop_poll(chat_id, message_id)

@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 channel
  • message_id - Identifier of the original message with the poll
  • options - orddict of options

stop_poll(client, chat_id, message_id)

@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.

stop_poll(client, chat_id, message_id, options)

@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.

transfer_business_account_stars(business_connection_id, star_count)

@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 connection
  • star_count - Number of Telegram Stars to transfer

transfer_business_account_stars(client, business_connection_id, star_count)

@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.

transfer_gift(business_connection_id, owned_gift_id, new_owner_chat_id)

@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 connection
  • owned_gift_id - Unique identifier of the regular gift that should be transferred
  • new_owner_chat_id - Unique identifier of the chat which will own the gift
  • options - orddict of options

Options:

  • :star_count - Number of Telegram Stars that will be paid for the transfer

transfer_gift(client, business_connection_id, owned_gift_id, new_owner_chat_id)

@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.

transfer_gift(client, business_connection_id, owned_gift_id, new_owner_chat_id, options)

@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.

unban_chat_member(chat_id, user_id)

@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 user
  • options - orddict of options

Options:

  • :only_if_banned - Do nothing if the user is not banned

unban_chat_member(client, chat_id, user_id)

@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.

unban_chat_member(client, chat_id, user_id, options)

@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.

unban_chat_sender_chat(chat_id, sender_chat_id)

@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.

unban_chat_sender_chat(client, chat_id, sender_chat_id)

@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.

unhide_general_forum_topic(chat_id)

@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.

unhide_general_forum_topic(client, chat_id)

@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.

unpin_all_chat_messages(chat_id)

@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.

unpin_all_chat_messages(client, chat_id)

@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.

unpin_all_forum_topic_messages(chat_id, message_thread_id)

@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.

unpin_all_forum_topic_messages(client, chat_id, message_thread_id)

@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.

unpin_all_general_forum_topic_messages(chat_id)

@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.

unpin_all_general_forum_topic_messages(client, chat_id)

@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.

unpin_chat_message(chat_id)

@spec unpin_chat_message(integer() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.

Args:

  • chat_id - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • options - orddict of options

Options:

  • :business_connection_id - Unique identifier of the business connection
  • :message_id - Identifier of the message to unpin

unpin_chat_message(client, chat_id)

@spec unpin_chat_message(integer() | binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}
@spec unpin_chat_message(Nadia.Client.t(), integer() | binary()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.unpin_chat_message/2.

unpin_chat_message(client, chat_id, options)

@spec unpin_chat_message(Nadia.Client.t(), integer() | binary(), [{atom(), any()}]) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.unpin_chat_message/3.

upgrade_gift(business_connection_id, owned_gift_id)

@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 connection
  • owned_gift_id - Unique identifier of the regular gift that should be upgraded
  • options - orddict 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

upgrade_gift(client, business_connection_id, owned_gift_id)

@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.

upgrade_gift(client, business_connection_id, owned_gift_id, options)

@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.

upload_sticker_file(user_id, png_sticker)

@spec upload_sticker_file(integer(), binary()) ::
  {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}

Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

Args:

  • user_id - User identifier of sticker file owner
  • png_sticker - Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Either a file_id to resend a file that is already on the Telegram servers, or a file_path to upload a new file from local, or a HTTP URL to get a file from the internet.

upload_sticker_file(client, user_id, png_sticker)

@spec upload_sticker_file(Nadia.Client.t(), integer(), binary()) ::
  {:ok, Nadia.Model.File.t()} | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.upload_sticker_file/3.

verify_chat(chat_id)

@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.

verify_chat(client, chat_id)

@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.

verify_chat(client, chat_id, options)

@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.

verify_user(user_id)

@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.

verify_user(client, user_id)

@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.

verify_user(client, user_id, options)

@spec verify_user(Nadia.Client.t(), integer(), [{atom(), any()}] | map()) ::
  :ok | {:error, Nadia.Model.Error.t()}

Callback implementation for Nadia.Behaviour.verify_user/3.