Nostrum.Api (nostrum v0.11.0-dev)

View Source

Interface for Discord's rest API.

By default all methods in this module are ran synchronously. If you wish to have async rest operations I recommend you execute these functions inside of a task.

Examples

# Async Task
t = Task.async fn ->
  Nostrum.Api.Channel.messages(12345678912345, :infinity, {})
end
messages = Task.await t

# A lot of times we don't care about the return value of the function
Task.start fn ->
  messages = ["in", "the", "end", "it", "doesn't", "even", "matter"]
  Enum.each messages, &Nostrum.Api.Message.create(12345678912345, &1)
end

A note about Strings and Ints

Currently, responses from the REST api will have id fields as string. Everything received from the WS connection will have id fields as int.

If you're processing a response from the API and trying to access something in the cache based off of an id in the response, you will need to convert it to an int using String.to_integer/1. I'm open to suggestions for how this should be handled going forward.

Example

messages = Nostrum.Api.Channel.pinned_messages!(12345678912345)

authors =
  Enum.map messages, fn msg ->
    author_id = String.to_integer(msg.author.id)
    Nostrum.Cache.User.get!(id: author_id)
  end

Summary

Types

Represents different presence activites the bot can have.

Represents which mentions to allow in a message.

Represents mentions to allow in a message.

Represents an emoji for interacting with reaction endpoints.

Represents a failed response from the API.

Represents a limit used to retrieve messages.

Represents a tuple used to locate messages.

Represents optional parameters for Api functions.

Represents different statuses the bot can have.

Functions

Same as bulk_delete_messages/2, but raises Nostrum.Error.ApiError in case of failure.

create_dm!(user_id) deprecated

Same as create_dm/1, but raises Nostrum.Error.ApiError in case of failure.

Same as create_group_dm/2, but raises Nostrum.Error.ApiError in case of failure.

Same as create_message/2, but raises Nostrum.Error.ApiError in case of failure.

Same as delete_channel/1, but raises Nostrum.Error.ApiError in case of failure.

Same as delete_guild/1, but raises Nostrum.Error.ApiError in case of failure.

Same as delete_interaction_response/3, but directly takes the Nostrum.Struct.Interaction.t/0 received from the gateway.

Same as delete_invite/1, but raises Nostrum.Error.ApiError in case of failure.

Same as delete_message/2, but takes a Nostrum.Struct.Message instead of a channel_id and message_id.

Same as delete_message/1, but raises Nostrum.Error.ApiError in case of failure.

Same as delete_message/2, but raises Nostrum.Error.ApiError in case of failure.

Same as edit_message/3, but takes a Nostrum.Struct.Message instead of a channel_id and message_id.

Same as edit_message/2, but raises Nostrum.Error.ApiError in case of failure.

Same as edit_message/3, but raises Nostrum.Error.ApiError in case of failure.

Same as expire_poll/2, but raises Nostrum.Error.ApiError in case of failure.

Same as get_channel/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_channel_invites/1, but raises Nostrum.Error.ApiError in case of failure.

get_current_user!() deprecated

Same as get_current_user/0, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild_channels/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild_emoji/2, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild_invites/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild_member/2, but raises Nostrum.Error.ApiError in case of failure.

Same as get_guild_roles/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_invite/1, but raises Nostrum.Error.ApiError in case of failure.

Same as get_pinned_messages/1, but raises Nostrum.Error.ApiError in case of failure.

get_user!(user_id) deprecated

Same as get_user/1, but raises Nostrum.Error.ApiError in case of failure.

get_user_dms!() deprecated

Same as get_user_dms/0, but raises Nostrum.Error.ApiError in case of failure.

Same as list_guild_emojis/1, but raises Nostrum.Error.ApiError in case of failure.

Same as modify_current_user/1, but raises Nostrum.Error.ApiError in case of failure.

Same as modify_guild/2, but raises Nostrum.Error.ApiError in case of failure.

Same as start_typing/1, but raises Nostrum.Error.ApiError in case of failure.

Types

activity()

(since 0.11.0)
@type activity() ::
  {:playing, String.t()}
  | {:streaming, String.t(), String.t()}
  | {:listening, String.t()}
  | {:watching, String.t()}
  | {:custom, String.t()}
  | {:competing, String.t()}

Represents different presence activites the bot can have.

Possible values

  • {:playing, name}
  • {:streaming, name, url}
  • {:listening, name}
  • {:watching, name}
  • {:custom, state}
  • {:competing, name}

allowed_mention()

(since 0.7.0)
@type allowed_mention() ::
  :all
  | :none
  | :everyone
  | :users
  | :roles
  | {:users, [Nostrum.Struct.User.id()]}
  | {:roles, [Nostrum.Struct.Guild.Role.id()]}

Represents which mentions to allow in a message.

This can be sent on its own or in a list to allow multiple types of mentions in a message, see allowed_mentions/0 for details.

allowed_mentions()

(since 0.7.0)
@type allowed_mentions() :: allowed_mention() | [allowed_mention()]

Represents mentions to allow in a message.

With this option you can control when content from a message should trigger a ping. Consider using this option when you are going to display user generated content.

Allowed values

  • :all (default) - Ping everything as usual
  • :none - Nobody will be pinged
  • :everyone - Allows to ping @here and @everyone
  • :users - Allows to ping users
  • :roles - Allows to ping roles
  • {:users, list} - Allows to ping list of users. Can contain up to 100 ids of users.
  • {:roles, list} - Allows to ping list of roles. Can contain up to 100 ids of roles.
  • list - a list containing the values above.

emoji()

Represents an emoji for interacting with reaction endpoints.

error()

@type error() :: {:error, Nostrum.Error.ApiError.t()}

Represents a failed response from the API.

This occurs when :gun fails, or when the API doesn't respond with 200 or 204.

limit()

@type limit() :: integer() | :infinity

Represents a limit used to retrieve messages.

Integer number of messages, or :infinity to retrieve all messages.

locator()

@type locator() ::
  {:before, integer()} | {:after, integer()} | {:around, integer()} | {}

Represents a tuple used to locate messages.

The first element of the tuple is an atom. The second element will be a message_id as an integer. The tuple can also be empty to search from the most recent message in the channel

options()

@type options() :: keyword() | map()

Represents optional parameters for Api functions.

Each function has documentation regarding what parameters it supports or needs.

status()

@type status() :: :dnd | :idle | :online | :invisible

Represents different statuses the bot can have.

  • :dnd - Red circle.
  • :idle - Yellow circle.
  • :online - Green circle.
  • :invisible - The bot will appear offline.

Functions

add_guild_member(guild_id, user_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.add_member/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.add_member/3.

add_guild_member!(guild_id, user_id, options)

This function is deprecated. Bang functions will be removed in v1.0.

Same as add_guild_member/3, but raises Nostrum.Error.ApiError in case of failure.

add_guild_member_role(guild_id, user_id, role_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.add_member_role/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.add_member_role/4.

add_pinned_channel_message(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.pin_message/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.pin_message/2.

add_pinned_channel_message!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec add_pinned_channel_message!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id()
) ::
  no_return() | {:ok}

Same as add_pinned_channel_message/2, but raises Nostrum.Error.ApiError in case of failure.

add_thread_member(thread_id, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.add_member/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.add_member/2.

batch_edit_application_command_permissions(application_id \\ Me.get().id, guild_id, permissions)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.batch_edit_permissions/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.batch_edit_permissions/3.

begin_guild_prune(guild_id, days, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.begin_prune/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.begin_prune/3.

begin_guild_prune!(guild_id, days, reason)

This function is deprecated. Bang functions will be removed in v1.0.
@spec begin_guild_prune!(
  Nostrum.Struct.Guild.id(),
  1..30,
  Nostrum.Struct.Guild.AuditLogEntry.reason()
) ::
  no_return() | %{pruned: integer()}

Same as begin_guild_prune/2, but raises Nostrum.Error.ApiError in case of failure.

bulk_delete_messages(channel_id, messages, filter)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.bulk_delete_messages/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.bulk_delete_messages/3.

bulk_delete_messages!(channel_id, messages, filter \\ true)

This function is deprecated. Bang functions will be removed in v1.0.
@spec bulk_delete_messages!(integer(), [Nostrum.Struct.Message.id()], boolean()) ::
  no_return() | {:ok}

Same as bulk_delete_messages/2, but raises Nostrum.Error.ApiError in case of failure.

bulk_overwrite_global_application_commands(application_id \\ Me.get().id, commands)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.bulk_overwrite_global_commands/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.bulk_overwrite_global_commands/2.

bulk_overwrite_guild_application_commands(application_id \\ Me.get().id, guild_id, commands)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.bulk_overwrite_guild_commands/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.bulk_overwrite_guild_commands/3.

create_channel_invite(channel_id, options \\ [], reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.create/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Invite.create/3.

create_channel_invite!(channel_id, options \\ [], reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_channel_invite/2, but raises Nostrum.Error.ApiError in case of failure.

create_dm(user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.User.create_dm/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.User.create_dm/1.

create_dm!(user_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_dm/1, but raises Nostrum.Error.ApiError in case of failure.

create_file_part_for_multipart(file, index, boundary, name_override \\ nil)

create_followup_message(application_id \\ Me.get().id, token, webhook_payload)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.create_followup_message/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.create_followup_message/3.

create_followup_message!(application_id \\ Me.get().id, token, webhook_payload)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.

Same as create_followup_message/3, but raises Nostrum.Error.ApiError in case of failure.

create_global_application_command(application_id \\ Me.get().id, command)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.create_global_command/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.create_global_command/2.

create_group_dm(access_tokens, nicks)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.User.create_group_dm/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.User.create_group_dm/2.

create_group_dm!(access_tokens, nicks)

This function is deprecated. Bang functions will be removed in v1.0.
@spec create_group_dm!([String.t()], %{
  optional(Nostrum.Struct.User.id()) => String.t()
}) ::
  no_return() | Nostrum.Struct.Channel.group_dm_channel()

Same as create_group_dm/2, but raises Nostrum.Error.ApiError in case of failure.

create_guild_application_command(application_id \\ Me.get().id, guild_id, command)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.create_guild_command/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.create_guild_command/3.

create_guild_auto_moderation_rule(guild_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.create_rule/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.AutoModeration.create_rule/2.

create_guild_ban(guild_id, user_id, days_to_delete, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.ban_member/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.ban_member/4.

create_guild_channel(guild_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.create/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.create/2.

create_guild_channel!(guild_id, options)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_guild_channel/2, but raises Nostrum.Error.ApiError in case of failure.

create_guild_emoji(guild_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_emoji/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.create_emoji/3.

create_guild_emoji!(guild_id, params, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_guild_emoji/2, but raises Nostrum.Error.ApiError in case of failure.

create_guild_integrations(guild_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_integration/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.create_integration/2.

create_guild_role(guild_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_role/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.create_role/3.

create_guild_role!(guild_id, options, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_guild_role/2, but raises Nostrum.Error.ApiError in case of failure.

create_guild_scheduled_event(guild_id, reason \\ nil, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.create/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ScheduledEvent.create/3.

create_guild_sticker(guild_id, name, description, tags, file, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.create/6` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.create/6.

create_interaction_response(interaction, response)

@spec create_interaction_response(Nostrum.Struct.Interaction.t(), map()) ::
  {:ok} | error()

Same as create_interaction_response/3, but directly takes the Nostrum.Struct.Interaction.t/0 received from the gateway.

create_interaction_response(id, token, response)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.create_response/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.create_response/3.

create_interaction_response!(interaction, response)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.
@spec create_interaction_response!(Nostrum.Struct.Interaction.t(), map()) ::
  no_return() | {:ok}

Same as create_interaction_response/2, but raises Nostrum.Error.ApiError in case of failure.

create_interaction_response!(id, token, response)

This function is deprecated. Bang functions will be removed in v1.0.

create_message(channel_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.create/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.create/2.

create_message!(channel_id, options)

This function is deprecated. Bang functions will be removed in v1.0.

Same as create_message/2, but raises Nostrum.Error.ApiError in case of failure.

create_multipart(files, json, boundary)

create_reaction(channel_id, message_id, emoji)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.react/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.react/3.

create_reaction!(channel_id, message_id, emoji)

This function is deprecated. Bang functions will be removed in v1.0.
@spec create_reaction!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id(),
  emoji()
) ::
  no_return() | {:ok}

Same as create_reaction/3, but raises Nostrum.Error.ApiError in case of failure.

create_webhook(channel_id, args, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.create/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.create/3.

delete_all_reactions(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.clear_reactions/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.clear_reactions/2.

delete_all_reactions!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_all_reactions!(Nostrum.Struct.Channel.id(), Nostrum.Struct.Message.id()) ::
  no_return() | {:ok}

Same as delete_all_reactions/2, but raises Nostrum.Error.ApiError in case of failure.

delete_channel(channel_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.delete/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.delete/2.

delete_channel!(channel_id, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as delete_channel/1, but raises Nostrum.Error.ApiError in case of failure.

delete_channel_permissions(channel_id, overwrite_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.delete_permissions/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.delete_permissions/3.

delete_global_application_command(application_id \\ Me.get().id, command_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.delete_global_command/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.delete_global_command/2.

delete_guild(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.delete/1.

delete_guild!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_guild!(Nostrum.Struct.Guild.id()) :: no_return() | {:ok}

Same as delete_guild/1, but raises Nostrum.Error.ApiError in case of failure.

delete_guild_application_command(application_id \\ Me.get().id, guild_id, command_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.delete_guild_command/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.delete_guild_command/3.

delete_guild_auto_moderation_rule(guild_id, rule_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.delete_rule/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.AutoModeration.delete_rule/2.

delete_guild_emoji(guild_id, emoji_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_emoji/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.delete_emoji/3.

delete_guild_emoji!(guild_id, emoji_id, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as delete_guild_emoji/2, but raises Nostrum.Error.ApiError in case of failure.

delete_guild_integrations(guild_id, integration_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_integration/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.delete_integration/2.

delete_guild_role(guild_id, role_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_role/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.delete_role/3.

delete_guild_role!(guild_id, role_id, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as delete_guild_role/2, but raises Nostrum.Error.ApiError in case of failure.

delete_guild_scheduled_event(guild_id, event_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.delete/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ScheduledEvent.delete/2.

delete_guild_sticker(guild_id, sticker_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.delete/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.delete/2.

delete_interaction_followup_message(application_id \\ Me.get().id, token, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.delete_followup_message/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.delete_followup_message/3.

delete_interaction_followup_message!(application_id \\ Me.get().id, token, message_id)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_interaction_followup_message!(
  Nostrum.Struct.User.id(),
  Nostrum.Struct.Interaction.token(),
  Nostrum.Struct.Message.id()
) :: no_return() | {:ok}

Same as delete_interaction_followup_message/3, but raises Nostrum.Error.ApiError in case of failure.

delete_interaction_response(interaction)

(since 0.5.0)
@spec delete_interaction_response(Nostrum.Struct.Interaction.t()) :: {:ok} | error()

Same as delete_interaction_response/3, but directly takes the Nostrum.Struct.Interaction.t/0 received from the gateway.

delete_interaction_response(id \\ Me.get().id, token)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.delete_response/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.delete_response/2.

delete_interaction_response!(interaction)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_interaction_response!(Nostrum.Struct.Interaction.t()) ::
  no_return() | {:ok}

delete_interaction_response!(id \\ Me.get().id, token)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_interaction_response!(
  Nostrum.Struct.User.id(),
  Nostrum.Struct.Interaction.token()
) ::
  no_return() | {:ok}

Same as delete_interaction_response/2, but raises Nostrum.Error.ApiError in case of failure.

delete_invite(invite_code)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.delete/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Invite.delete/1.

delete_invite!(invite_code)

This function is deprecated. Bang functions will be removed in v1.0.

Same as delete_invite/1, but raises Nostrum.Error.ApiError in case of failure.

delete_message(message)

@spec delete_message(Nostrum.Struct.Message.t()) :: error() | {:ok}

Same as delete_message/2, but takes a Nostrum.Struct.Message instead of a channel_id and message_id.

delete_message(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.delete/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.delete/2.

delete_message!(message)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_message!(Nostrum.Struct.Message.t()) :: error() | {:ok}

Same as delete_message/1, but raises Nostrum.Error.ApiError in case of failure.

delete_message!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_message!(Nostrum.Struct.Channel.id(), Nostrum.Struct.Message.id()) ::
  no_return() | {:ok}

Same as delete_message/2, but raises Nostrum.Error.ApiError in case of failure.

delete_own_reaction(channel_id, message_id, emoji)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.unreact/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.unreact/3.

delete_own_reaction!(channel_id, message_id, emoji)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_own_reaction!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id(),
  emoji()
) ::
  no_return() | {:ok}

Same as delete_own_reaction/3, but raises Nostrum.Error.ApiError in case of failure.

delete_pinned_channel_message(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.unpin_message/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.unpin_message/2.

delete_pinned_channel_message!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_pinned_channel_message!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id()
) ::
  no_return() | {:ok}

Same as delete_pinned_channel_message/2, but raises Nostrum.Error.ApiError in case of failure.

delete_reaction(channel_id, message_id, emoji)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.delete_emoji_reactions/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.delete_emoji_reactions/3.

delete_reaction!(channel_id, message_id, emoji)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_reaction!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id(),
  emoji()
) ::
  no_return() | {:ok}

Same as delete_reaction/3, but raises Nostrum.Error.ApiError in case of failure.

delete_user_reaction(channel_id, message_id, emoji, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.delete_user_reaction/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.delete_user_reaction/4.

delete_user_reaction!(channel_id, message_id, emoji, user_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec delete_user_reaction!(
  Nostrum.Struct.Channel.id(),
  Nostrum.Struct.Message.id(),
  emoji(),
  Nostrum.Struct.User.id()
) :: no_return() | {:ok}

Same as delete_user_reaction/4, but raises Nostrum.Error.ApiError in case of failure.

delete_webhook(webhook_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.delete/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.delete/2.

edit_application_command_permissions(application_id \\ Me.get().id, guild_id, command_id, permissions)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.edit_command_permissions/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.edit_command_permissions/4.

edit_channel_permissions(channel_id, overwrite_id, permission_info, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.edit_permissions/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.edit_permissions/4.

edit_channel_permissions!(channel_id, overwrite_id, permission_info, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.
@spec edit_channel_permissions!(
  integer(),
  integer(),
  %{
    :type => String.t(),
    optional(:allow) => integer(),
    optional(:deny) => integer()
  },
  Nostrum.Struct.Guild.AuditLogEntry.reason()
) :: no_return() | {:ok}

Same as edit_channel_permissions/3, but raises Nostrum.Error.ApiError in case of failure.

edit_global_application_command(application_id \\ Me.get().id, command_id, command)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.edit_global_command/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.edit_global_command/3.

edit_guild_application_command(application_id \\ Me.get().id, guild_id, command_id, command)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.edit_guild_command/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.edit_guild_command/4.

edit_interaction_response(interaction, response)

(since 0.5.0)
@spec edit_interaction_response(Nostrum.Struct.Interaction.t(), map()) ::
  {:ok, Nostrum.Struct.Message.t()} | error()

Same as edit_interaction_response/3, but directly takes the Nostrum.Struct.Interaction.t/0 received from the gateway.

edit_interaction_response(id \\ Me.get().id, token, response)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.edit_response/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.edit_response/3.

edit_interaction_response!(interaction, response)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.
@spec edit_interaction_response!(Nostrum.Struct.Interaction.t(), map()) ::
  no_return() | Nostrum.Struct.Message.t()

Same as edit_interaction_response/2, but raises Nostrum.Error.ApiError in case of failure.

edit_interaction_response!(id \\ Me.get().id, token, response)

(since 0.5.0)
This function is deprecated. Bang functions will be removed in v1.0.

Same as edit_interaction_response/3, but raises Nostrum.Error.ApiError in case of failure.

edit_message(message, options)

@spec edit_message(Nostrum.Struct.Message.t(), options()) ::
  error() | {:ok, Nostrum.Struct.Message.t()}

Same as edit_message/3, but takes a Nostrum.Struct.Message instead of a channel_id and message_id.

edit_message(channel_id, message_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.edit/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.edit/3.

edit_message!(message, options)

This function is deprecated. Bang functions will be removed in v1.0.

Same as edit_message/2, but raises Nostrum.Error.ApiError in case of failure.

edit_message!(channel_id, message_id, options)

This function is deprecated. Bang functions will be removed in v1.0.

Same as edit_message/3, but raises Nostrum.Error.ApiError in case of failure.

edit_webhook_message(webhook_id, webhook_token, message_id, args)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.edit_message/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.edit_message/4.

execute_git_webhook(webhook_id, webhook_token, wait \\ false)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute_git/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.execute_git/3.

execute_slack_webhook(webhook_id, webhook_token, wait \\ false)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute_slack/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.execute_slack/3.

execute_webhook(webhook_id, webhook_token, args, wait \\ false)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.execute/4.

expire_poll(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Poll.expire/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Poll.expire/2.

expire_poll!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as expire_poll/2, but raises Nostrum.Error.ApiError in case of failure.

get_application_command_permissions(application_id \\ Me.get().id, guild_id, command_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.permissions/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.permissions/3.

get_application_information()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.application_information/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.application_information/0.

get_channel(channel_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.get/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.get/1.

get_channel!(channel_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_channel/1, but raises Nostrum.Error.ApiError in case of failure.

get_channel_invites(channel_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.channel_invites/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Invite.channel_invites/1.

get_channel_invites!(channel_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_channel_invites/1, but raises Nostrum.Error.ApiError in case of failure.

get_channel_message(channel_id, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.get/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.get/2.

get_channel_message!(channel_id, message_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_channel_message/2, but raises Nostrum.Error.ApiError in case of failure.

get_channel_messages(channel_id, limit, locator \\ {})

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.messages/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.messages/3.

get_channel_messages!(channel_id, limit, locator \\ {})

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_channel_messages!(Nostrum.Struct.Channel.id(), limit(), locator()) ::
  no_return() | [Nostrum.Struct.Message.t()]

Same as get_channel_messages/3, but raises Nostrum.Error.ApiError in case of failure.

get_channel_webhooks(channel_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.webhooks/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.webhooks/1.

get_current_user()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.get/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.get/0.

get_current_user!()

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_current_user!() :: no_return() | Nostrum.Struct.User.t()

Same as get_current_user/0, but raises Nostrum.Error.ApiError in case of failure.

get_current_user_guilds(options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.guilds/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.guilds/1.

get_current_user_guilds!(options \\ [])

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_current_user_guilds!(options()) ::
  no_return() | [Nostrum.Struct.Guild.user_guild()]

Same as get_current_user_guilds/1, but raises Nostrum.Error.ApiError in case of failure.

get_global_application_commands(application_id \\ Me.get().id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.global_commands/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.global_commands/1.

get_guild(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.get/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.get/1.

get_guild!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_guild/1, but raises Nostrum.Error.ApiError in case of failure.

get_guild_application_command_permissions(application_id \\ Me.get().id, guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.guild_permissions/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.guild_permissions/2.

get_guild_application_commands(application_id \\ Me.get().id, guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.guild_commands/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ApplicationCommand.guild_commands/2.

get_guild_audit_log(guild_id, options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.audit_log/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.audit_log/2.

get_guild_auto_moderation_rule(guild_id, rule_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.rule/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.AutoModeration.rule/2.

get_guild_auto_moderation_rules(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.rules/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.AutoModeration.rules/1.

get_guild_ban(guild_id, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.ban/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.ban/2.

get_guild_bans(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.bans/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.bans/1.

get_guild_channels(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.channels/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.channels/1.

get_guild_channels!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_guild_channels/1, but raises Nostrum.Error.ApiError in case of failure.

get_guild_emoji(guild_id, emoji_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.emoji/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.emoji/2.

get_guild_emoji!(guild_id, emoji_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_guild_emoji/2, but raises Nostrum.Error.ApiError in case of failure.

get_guild_integrations(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.integrations/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.integrations/1.

get_guild_invites(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.guild_invites/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Invite.guild_invites/1.

get_guild_invites!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_guild_invites/1, but raises Nostrum.Error.ApiError in case of failure.

get_guild_member(guild_id, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.member/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.member/2.

get_guild_member!(guild_id, user_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_guild_member/2, but raises Nostrum.Error.ApiError in case of failure.

get_guild_prune_count(guild_id, days)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.estimate_prune_count/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.estimate_prune_count/2.

get_guild_prune_count!(guild_id, days)

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_guild_prune_count!(Nostrum.Struct.Guild.id(), 1..30) ::
  no_return() | %{pruned: integer()}

Same as get_guild_prune_count/2, but raises Nostrum.Error.ApiError in case of failure.

get_guild_roles(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.roles/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.roles/1.

get_guild_roles!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_guild_roles!(Nostrum.Struct.Guild.id()) ::
  no_return() | [Nostrum.Struct.Guild.Role.t()]

Same as get_guild_roles/1, but raises Nostrum.Error.ApiError in case of failure.

get_guild_scheduled_event(guild_id, event_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.get/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ScheduledEvent.get/2.

get_guild_scheduled_event_users(guild_id, event_id, params \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.users/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ScheduledEvent.users/3.

get_guild_scheduled_events(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.scheduled_events/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.scheduled_events/1.

get_guild_sticker(guild_id, sticker_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.get/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.get/2.

get_guild_webhooks(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.webhooks/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.webhooks/1.

get_guild_widget(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.widget/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.widget/1.

get_invite(invite_code, options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.get/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Invite.get/2.

get_invite!(invite_code, options \\ [])

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_invite/1, but raises Nostrum.Error.ApiError in case of failure.

get_original_interaction_response(interaction)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.original_response/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Interaction.original_response/1.

get_pinned_messages(channel_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.pinned_messages/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.pinned_messages/1.

get_pinned_messages!(channel_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_pinned_messages!(Nostrum.Struct.Channel.id()) ::
  no_return() | [Nostrum.Struct.Message.t()]

Same as get_pinned_messages/1, but raises Nostrum.Error.ApiError in case of failure.

get_poll_answer_voters(channel_id, message_id, answer_id, params \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Poll.answer_voters/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Poll.answer_voters/4.

get_poll_answer_voters!(channel_id, message_id, answer_id, params \\ [])

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_poll_answer_voters/4, but raises Nostrum.Error.ApiError in case of failure.

get_reactions(channel_id, message_id, emoji, params \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.reactions/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Message.reactions/4.

get_reactions!(channel_id, message_id, emoji, params \\ [])

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_reactions/4, but raises Nostrum.Error.ApiError in case of failure.

get_sticker(sticker_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.get/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.get/1.

get_sticker_packs()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.packs/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.packs/0.

get_thread_member(thread_id, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.member/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.member/2.

get_thread_members(thread_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.members/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.members/1.

get_user(user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.User.get/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.User.get/1.

get_user!(user_id)

This function is deprecated. Bang functions will be removed in v1.0.

Same as get_user/1, but raises Nostrum.Error.ApiError in case of failure.

get_user_connections()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.connections/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.connections/0.

get_user_dms()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.dms/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.dms/0.

get_user_dms!()

This function is deprecated. Bang functions will be removed in v1.0.
@spec get_user_dms!() :: no_return() | [Nostrum.Struct.Channel.dm_channel()]

Same as get_user_dms/0, but raises Nostrum.Error.ApiError in case of failure.

get_voice_region(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.voice_region/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.voice_region/1.

get_webhook(webhook_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.get/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.get/1.

get_webhook_message(webhook, message_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.get_message/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.get_message/2.

get_webhook_with_token(webhook_id, webhook_token)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.get_with_token/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.get_with_token/2.

join_thread(thread_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.join/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.join/1.

leave_guild(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.leave/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.leave/1.

leave_thread(thread_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.leave/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.leave/1.

list_guild_emojis(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.emojis/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.emojis/1.

list_guild_emojis!(guild_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec list_guild_emojis!(Nostrum.Struct.Guild.id()) ::
  no_return() | [Nostrum.Struct.Emoji.t()]

Same as list_guild_emojis/1, but raises Nostrum.Error.ApiError in case of failure.

list_guild_members(guild_id, options \\ %{})

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.members/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.members/2.

list_guild_members!(guild_id, options \\ %{})

This function is deprecated. Bang functions will be removed in v1.0.
@spec list_guild_members!(Nostrum.Struct.Guild.id(), options()) ::
  no_return() | [Nostrum.Struct.Guild.Member.t()]

Same as list_guild_members/2, but raises Nostrum.Error.ApiError in case of failure.

list_guild_stickers(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.list/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.list/1.

list_guild_threads(guild_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.list/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.list/1.

list_joined_private_archived_threads(channel_id, options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.joined_private_archived_threads/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.joined_private_archived_threads/2.

list_private_archived_threads(channel_id, options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.private_archived_threads/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.private_archived_threads/2.

list_public_archived_threads(channel_id, options \\ [])

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.public_archived_threads/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.public_archived_threads/2.

list_voice_regions()

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.voice_regions/0` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.voice_regions/0.

modify_channel(channel_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.modify/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.modify/3.

modify_channel!(channel_id, options, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_channel/2, but raises Nostrum.Error.ApiError in case of failure.

modify_current_user(options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.modify/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.modify/1.

modify_current_user!(options)

This function is deprecated. Bang functions will be removed in v1.0.
@spec modify_current_user!(options()) :: no_return() | Nostrum.Struct.User.t()

Same as modify_current_user/1, but raises Nostrum.Error.ApiError in case of failure.

modify_current_user_nick(guild_id, options \\ %{})

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_self_nick/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_self_nick/2.

modify_current_user_nick!(guild_id, options \\ %{})

This function is deprecated. Bang functions will be removed in v1.0.
@spec modify_current_user_nick!(Nostrum.Struct.Guild.id(), options()) ::
  no_return() | %{nick: String.t()}

Same as modify_current_user_nick/2, but raises Nostrum.Error.ApiError in case of failure.

modify_guild(guild_id, options \\ [], reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify/3.

modify_guild!(guild_id, options \\ [])

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_guild/2, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_auto_moderation_rule(guild_id, rule_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.modify_rule/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.AutoModeration.modify_rule/3.

modify_guild_channel_positions(guild_id, positions)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_channel_positions/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_channel_positions/2.

modify_guild_channel_positions!(guild_id, positions)

This function is deprecated. Bang functions will be removed in v1.0.
@spec modify_guild_channel_positions!(Nostrum.Struct.Guild.id(), [
  %{id: integer(), position: integer()}
]) ::
  no_return() | {:ok}

Same as modify_guild_channel_positions/2, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_emoji(guild_id, emoji_id, options \\ %{}, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_emoji/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_emoji/4.

modify_guild_emoji!(guild_id, emoji_id, options, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_guild_emoji/3, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_integrations(guild_id, integration_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_integration/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_integration/3.

modify_guild_member(guild_id, user_id, options \\ %{}, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_member/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_member/4.

modify_guild_member!(guild_id, user_id, options \\ %{}, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_guild_member/3, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_role(guild_id, role_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_role/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_role/4.

modify_guild_role!(guild_id, role_id, options, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_guild_role/3, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_role_positions(guild_id, positions, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_role_positions/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_role_positions/3.

modify_guild_role_positions!(guild_id, positions, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as modify_guild_role_positions/2, but raises Nostrum.Error.ApiError in case of failure.

modify_guild_scheduled_event(guild_id, event_id, reason \\ nil, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.modify/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.ScheduledEvent.modify/4.

modify_guild_sticker(guild_id, sticker_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.modify/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Sticker.modify/3.

modify_guild_widget(guild_id, options)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_widget/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.modify_widget/2.

modify_webhook(webhook_id, args, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.modify/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.modify/3.

modify_webhook_with_token(webhook_id, webhook_token, args, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.modify_with_token/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Webhook.modify_with_token/4.

remove_guild_ban(guild_id, user_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.unban_member/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.unban_member/3.

remove_guild_member(guild_id, user_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.kick_member/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.kick_member/3.

remove_guild_member!(guild_id, user_id, reason \\ nil)

This function is deprecated. Bang functions will be removed in v1.0.

Same as remove_guild_member/2, but raises Nostrum.Error.ApiError in case of failure.

remove_guild_member_role(guild_id, user_id, role_id, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.remove_member_role/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.remove_member_role/4.

remove_thread_member(thread_id, user_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.remove_member/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.remove_member/2.

request(request)

@spec request(map()) :: {:ok} | {:ok, String.t()} | error()

request(method, route, body \\ "", params \\ [])

@spec request(atom(), String.t(), any(), keyword() | map()) ::
  {:ok} | {:ok, String.t()} | error()

request_multipart(method, route, body, params \\ [])

@spec request_multipart(atom(), String.t(), any(), keyword() | map()) ::
  {:ok} | {:ok, String.t()} | error()

start_thread_in_forum_channel(channel_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.create_in_forum/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.create_in_forum/3.

start_thread_with_message(channel_id, message_id, options, reason \\ nil)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.create_with_message/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Thread.create_with_message/4.

start_typing(channel_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.start_typing/1` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Channel.start_typing/1.

start_typing!(channel_id)

This function is deprecated. Bang functions will be removed in v1.0.
@spec start_typing!(integer()) :: no_return() | {:ok}

Same as start_typing/1, but raises Nostrum.Error.ApiError in case of failure.

sync_guild_integrations(guild_id, integration_id)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.sync_integration/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Guild.sync_integration/2.

update_shard_status(pid, status, activity)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.update_shard_status/3` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.update_shard_status/3.

update_status(status, activity)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.update_status/2` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.update_status/2.

update_voice_state(guild_id, channel_id, self_mute \\ false, self_deaf \\ false)

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.update_voice_state/4` directly instead. For partially automated migration, please see `mix help nostrum.update_api_functions`. .

See Nostrum.Api.Self.update_voice_state/4.