View Source Nostrum.Api (Nostrum v0.10.4)

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

Link to this type

allowed_mention()

View Source (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.

Link to this type

allowed_mentions()

View Source (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.

Represents an emoji for interacting with reaction endpoints.

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

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

Represents a limit used to retrieve messages.

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

@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

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

Represents optional parameters for Api functions.

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

@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

Link to this function

add_guild_member(guild_id, user_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.add_member/3` directly instead. .

See Nostrum.Api.Guild.add_member/3.

Link to this function

add_guild_member!(guild_id, user_id, options)

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

Link to this function

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

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

See Nostrum.Api.Guild.add_member_role/4.

Link to this function

add_pinned_channel_message(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.pin_message/2` directly instead. .

See Nostrum.Api.Channel.pin_message/2.

Link to this function

add_pinned_channel_message!(channel_id, message_id)

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

Link to this function

add_thread_member(thread_id, user_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.add_member/2` directly instead. .

See Nostrum.Api.Thread.add_member/2.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.batch_edit_permissions/3.

Link to this function

begin_guild_prune(guild_id, days, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.begin_prune/3` directly instead. .

See Nostrum.Api.Guild.begin_prune/3.

Link to this function

begin_guild_prune!(guild_id, days, reason)

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

Link to this function

bulk_delete_messages(channel_id, messages, filter)

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

See Nostrum.Api.Channel.bulk_delete_messages/3.

Link to this function

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

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

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.bulk_overwrite_global_commands/2.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.bulk_overwrite_guild_commands/3.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.create/3` directly instead. .

See Nostrum.Api.Invite.create/3.

Link to this function

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

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

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.User.create_dm/1` directly instead. .

See Nostrum.Api.User.create_dm/1.

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.

Link to this function

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

View Source
Link to this function

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

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

See Nostrum.Api.Interaction.create_followup_message/3.

Link to this function

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

View Source (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.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.create_global_command/2.

Link to this function

create_group_dm(access_tokens, nicks)

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

See Nostrum.Api.User.create_group_dm/2.

Link to this function

create_group_dm!(access_tokens, nicks)

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

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.create_guild_command/3.

Link to this function

create_guild_auto_moderation_rule(guild_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.create_rule/2` directly instead. .

See Nostrum.Api.AutoModeration.create_rule/2.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.ban_member/4` directly instead. .

See Nostrum.Api.Guild.ban_member/4.

Link to this function

create_guild_channel(guild_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.create/2` directly instead. .

See Nostrum.Api.Channel.create/2.

Link to this function

create_guild_channel!(guild_id, options)

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

Link to this function

create_guild_emoji(guild_id, options, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_emoji/3` directly instead. .

See Nostrum.Api.Guild.create_emoji/3.

Link to this function

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

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

Link to this function

create_guild_integrations(guild_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_integration/2` directly instead. .

See Nostrum.Api.Guild.create_integration/2.

Link to this function

create_guild_role(guild_id, options, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.create_role/3` directly instead. .

See Nostrum.Api.Guild.create_role/3.

Link to this function

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

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

Link to this function

create_guild_scheduled_event(guild_id, reason \\ nil, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.create/3` directly instead. .

See Nostrum.Api.ScheduledEvent.create/3.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.create/6` directly instead. .

See Nostrum.Api.Sticker.create/6.

Link to this function

create_interaction_response(interaction, response)

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

Link to this function

create_interaction_response(id, token, response)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.create_response/3` directly instead. .

See Nostrum.Api.Interaction.create_response/3.

Link to this function

create_interaction_response!(interaction, response)

View Source (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.

Link to this function

create_interaction_response!(id, token, response)

View Source
This function is deprecated. Bang functions will be removed in v1.0.
Link to this function

create_message(channel_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.create/2` directly instead. .

See Nostrum.Api.Message.create/2.

Link to this function

create_message!(channel_id, options)

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

Link to this function

create_multipart(files, json, boundary)

View Source
Link to this function

create_reaction(channel_id, message_id, emoji)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.react/3` directly instead. .

See Nostrum.Api.Message.react/3.

Link to this function

create_reaction!(channel_id, message_id, emoji)

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

Link to this function

create_webhook(channel_id, args, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.create/3` directly instead. .

See Nostrum.Api.Webhook.create/3.

Link to this function

delete_all_reactions(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.clear_reactions/2` directly instead. .

See Nostrum.Api.Message.clear_reactions/2.

Link to this function

delete_all_reactions!(channel_id, message_id)

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

Link to this function

delete_channel(channel_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.delete/2` directly instead. .

See Nostrum.Api.Channel.delete/2.

Link to this function

delete_channel!(channel_id, reason \\ nil)

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

Link to this function

delete_channel_permissions(channel_id, overwrite_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.delete_permissions/3` directly instead. .

See Nostrum.Api.Channel.delete_permissions/3.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.delete_global_command/2.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete/1` directly instead. .

See Nostrum.Api.Guild.delete/1.

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.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.delete_guild_command/3.

Link to this function

delete_guild_auto_moderation_rule(guild_id, rule_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.delete_rule/2` directly instead. .

See Nostrum.Api.AutoModeration.delete_rule/2.

Link to this function

delete_guild_emoji(guild_id, emoji_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_emoji/3` directly instead. .

See Nostrum.Api.Guild.delete_emoji/3.

Link to this function

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

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

Link to this function

delete_guild_integrations(guild_id, integration_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_integration/2` directly instead. .

See Nostrum.Api.Guild.delete_integration/2.

Link to this function

delete_guild_role(guild_id, role_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.delete_role/3` directly instead. .

See Nostrum.Api.Guild.delete_role/3.

Link to this function

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

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

Link to this function

delete_guild_scheduled_event(guild_id, event_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.delete/2` directly instead. .

See Nostrum.Api.ScheduledEvent.delete/2.

Link to this function

delete_guild_sticker(guild_id, sticker_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.delete/2` directly instead. .

See Nostrum.Api.Sticker.delete/2.

Link to this function

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

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

See Nostrum.Api.Interaction.delete_followup_message/3.

Link to this function

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

View Source (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.

Link to this function

delete_interaction_response(interaction)

View Source (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.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.delete_response/2` directly instead. .

See Nostrum.Api.Interaction.delete_response/2.

Link to this function

delete_interaction_response!(interaction)

View Source (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}
Link to this function

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

View Source (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.

Link to this function

delete_invite(invite_code)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.delete/1` directly instead. .

See Nostrum.Api.Invite.delete/1.

Link to this function

delete_invite!(invite_code)

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

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

Link to this function

delete_message(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.delete/2` directly instead. .

See Nostrum.Api.Message.delete/2.

Link to this function

delete_message!(message)

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

Link to this function

delete_message!(channel_id, message_id)

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

Link to this function

delete_own_reaction(channel_id, message_id, emoji)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.unreact/3` directly instead. .

See Nostrum.Api.Message.unreact/3.

Link to this function

delete_own_reaction!(channel_id, message_id, emoji)

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

Link to this function

delete_pinned_channel_message(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.unpin_message/2` directly instead. .

See Nostrum.Api.Channel.unpin_message/2.

Link to this function

delete_pinned_channel_message!(channel_id, message_id)

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

Link to this function

delete_reaction(channel_id, message_id, emoji)

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

See Nostrum.Api.Message.delete_emoji_reactions/3.

Link to this function

delete_reaction!(channel_id, message_id, emoji)

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

Link to this function

delete_user_reaction(channel_id, message_id, emoji, user_id)

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

See Nostrum.Api.Message.delete_user_reaction/4.

Link to this function

delete_user_reaction!(channel_id, message_id, emoji, user_id)

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

Link to this function

delete_webhook(webhook_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.delete/2` directly instead. .

See Nostrum.Api.Webhook.delete/2.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.edit_command_permissions/4.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.edit_permissions/4` directly instead. .

See Nostrum.Api.Channel.edit_permissions/4.

Link to this function

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

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

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.edit_global_command/3.

Link to this function

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

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

See Nostrum.Api.ApplicationCommand.edit_guild_command/4.

Link to this function

edit_interaction_response(interaction, response)

View Source (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.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.edit_response/3` directly instead. .

See Nostrum.Api.Interaction.edit_response/3.

Link to this function

edit_interaction_response!(interaction, response)

View Source (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.

Link to this function

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

View Source (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.

Link to this function

edit_message(message, options)

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

Link to this function

edit_message(channel_id, message_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.edit/3` directly instead. .

See Nostrum.Api.Message.edit/3.

Link to this function

edit_message!(message, options)

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

Link to this function

edit_message!(channel_id, message_id, options)

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

Link to this function

edit_webhook_message(webhook_id, webhook_token, message_id, args)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.edit_message/4` directly instead. .

See Nostrum.Api.Webhook.edit_message/4.

Link to this function

execute_git_webhook(webhook_id, webhook_token, wait \\ false)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute_git/3` directly instead. .

See Nostrum.Api.Webhook.execute_git/3.

Link to this function

execute_slack_webhook(webhook_id, webhook_token, wait \\ false)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute_slack/3` directly instead. .

See Nostrum.Api.Webhook.execute_slack/3.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.execute/4` directly instead. .

See Nostrum.Api.Webhook.execute/4.

Link to this function

expire_poll(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Poll.expire/2` directly instead. .

See Nostrum.Api.Poll.expire/2.

Link to this function

expire_poll!(channel_id, message_id)

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.permissions/3` directly instead. .

See Nostrum.Api.ApplicationCommand.permissions/3.

Link to this function

get_application_information()

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.application_information/0` directly instead. .

See Nostrum.Api.Self.application_information/0.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.get/1` directly instead. .

See Nostrum.Api.Channel.get/1.

Link to this function

get_channel!(channel_id)

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

Link to this function

get_channel_invites(channel_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.channel_invites/1` directly instead. .

See Nostrum.Api.Invite.channel_invites/1.

Link to this function

get_channel_invites!(channel_id)

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

Link to this function

get_channel_message(channel_id, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.get/2` directly instead. .

See Nostrum.Api.Message.get/2.

Link to this function

get_channel_message!(channel_id, message_id)

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.messages/3` directly instead. .

See Nostrum.Api.Channel.messages/3.

Link to this function

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

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

Link to this function

get_channel_webhooks(channel_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.webhooks/1` directly instead. .

See Nostrum.Api.Channel.webhooks/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.get/0` directly instead. .

See Nostrum.Api.Self.get/0.

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.

Link to this function

get_current_user_guilds(options \\ [])

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.guilds/1` directly instead. .

See Nostrum.Api.Self.guilds/1.

Link to this function

get_current_user_guilds!(options \\ [])

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.global_commands/1` directly instead. .

See Nostrum.Api.ApplicationCommand.global_commands/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.get/1` directly instead. .

See Nostrum.Api.Guild.get/1.

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.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.guild_permissions/2` directly instead. .

See Nostrum.Api.ApplicationCommand.guild_permissions/2.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ApplicationCommand.guild_commands/2` directly instead. .

See Nostrum.Api.ApplicationCommand.guild_commands/2.

Link to this function

get_guild_audit_log(guild_id, options \\ [])

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.audit_log/2` directly instead. .

See Nostrum.Api.Guild.audit_log/2.

Link to this function

get_guild_auto_moderation_rule(guild_id, rule_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.rule/2` directly instead. .

See Nostrum.Api.AutoModeration.rule/2.

Link to this function

get_guild_auto_moderation_rules(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.rules/1` directly instead. .

See Nostrum.Api.AutoModeration.rules/1.

Link to this function

get_guild_ban(guild_id, user_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.ban/2` directly instead. .

See Nostrum.Api.Guild.ban/2.

Link to this function

get_guild_bans(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.bans/1` directly instead. .

See Nostrum.Api.Guild.bans/1.

Link to this function

get_guild_channels(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.channels/1` directly instead. .

See Nostrum.Api.Guild.channels/1.

Link to this function

get_guild_channels!(guild_id)

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

Link to this function

get_guild_emoji(guild_id, emoji_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.emoji/2` directly instead. .

See Nostrum.Api.Guild.emoji/2.

Link to this function

get_guild_emoji!(guild_id, emoji_id)

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

Link to this function

get_guild_integrations(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.integrations/1` directly instead. .

See Nostrum.Api.Guild.integrations/1.

Link to this function

get_guild_invites(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.guild_invites/1` directly instead. .

See Nostrum.Api.Invite.guild_invites/1.

Link to this function

get_guild_invites!(guild_id)

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

Link to this function

get_guild_member(guild_id, user_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.member/2` directly instead. .

See Nostrum.Api.Guild.member/2.

Link to this function

get_guild_member!(guild_id, user_id)

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

Link to this function

get_guild_prune_count(guild_id, days)

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

See Nostrum.Api.Guild.estimate_prune_count/2.

Link to this function

get_guild_prune_count!(guild_id, days)

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

Link to this function

get_guild_roles(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.roles/1` directly instead. .

See Nostrum.Api.Guild.roles/1.

Link to this function

get_guild_roles!(guild_id)

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

Link to this function

get_guild_scheduled_event(guild_id, event_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.get/2` directly instead. .

See Nostrum.Api.ScheduledEvent.get/2.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.users/3` directly instead. .

See Nostrum.Api.ScheduledEvent.users/3.

Link to this function

get_guild_scheduled_events(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.scheduled_events/1` directly instead. .

See Nostrum.Api.Guild.scheduled_events/1.

Link to this function

get_guild_sticker(guild_id, sticker_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.get/2` directly instead. .

See Nostrum.Api.Sticker.get/2.

Link to this function

get_guild_webhooks(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.webhooks/1` directly instead. .

See Nostrum.Api.Guild.webhooks/1.

Link to this function

get_guild_widget(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.widget/1` directly instead. .

See Nostrum.Api.Guild.widget/1.

Link to this function

get_invite(invite_code, options \\ [])

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Invite.get/2` directly instead. .

See Nostrum.Api.Invite.get/2.

Link to this function

get_invite!(invite_code, options \\ [])

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

Link to this function

get_original_interaction_response(interaction)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Interaction.original_response/2` directly instead. .

See Nostrum.Api.Interaction.original_response/1.

Link to this function

get_pinned_messages(channel_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.pinned_messages/1` directly instead. .

See Nostrum.Api.Channel.pinned_messages/1.

Link to this function

get_pinned_messages!(channel_id)

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Poll.answer_voters/4` directly instead. .

See Nostrum.Api.Poll.answer_voters/4.

Link to this function

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

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Message.reactions/4` directly instead. .

See Nostrum.Api.Message.reactions/4.

Link to this function

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

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

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.get/1` directly instead. .

See Nostrum.Api.Sticker.get/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.packs/0` directly instead. .

See Nostrum.Api.Sticker.packs/0.

Link to this function

get_thread_member(thread_id, user_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.member/2` directly instead. .

See Nostrum.Api.Thread.member/2.

Link to this function

get_thread_members(thread_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.members/1` directly instead. .

See Nostrum.Api.Thread.members/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.User.get/1` directly instead. .

See Nostrum.Api.User.get/1.

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.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.connections/0` directly instead. .

See Nostrum.Api.Self.connections/0.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.dms/0` directly instead. .

See Nostrum.Api.Self.dms/0.

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.

Link to this function

get_voice_region(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.voice_region/1` directly instead. .

See Nostrum.Api.Guild.voice_region/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.get/1` directly instead. .

See Nostrum.Api.Webhook.get/1.

Link to this function

get_webhook_message(webhook, message_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.get_message/2` directly instead. .

See Nostrum.Api.Webhook.get_message/2.

Link to this function

get_webhook_with_token(webhook_id, webhook_token)

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

See Nostrum.Api.Webhook.get_with_token/2.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.join/1` directly instead. .

See Nostrum.Api.Thread.join/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.leave/1` directly instead. .

See Nostrum.Api.Guild.leave/1.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.leave/1` directly instead. .

See Nostrum.Api.Thread.leave/1.

Link to this function

list_guild_emojis(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.emojis/1` directly instead. .

See Nostrum.Api.Guild.emojis/1.

Link to this function

list_guild_emojis!(guild_id)

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

Link to this function

list_guild_members(guild_id, options \\ %{})

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.members/2` directly instead. .

See Nostrum.Api.Guild.members/2.

Link to this function

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

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

Link to this function

list_guild_stickers(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.list/1` directly instead. .

See Nostrum.Api.Sticker.list/1.

Link to this function

list_guild_threads(guild_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.list/1` directly instead. .

See Nostrum.Api.Thread.list/1.

Link to this function

list_joined_private_archived_threads(channel_id, options \\ [])

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

See Nostrum.Api.Thread.joined_private_archived_threads/2.

Link to this function

list_private_archived_threads(channel_id, options \\ [])

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

See Nostrum.Api.Thread.private_archived_threads/2.

Link to this function

list_public_archived_threads(channel_id, options \\ [])

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

See Nostrum.Api.Thread.public_archived_threads/2.

This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.voice_regions/0` directly instead. .

See Nostrum.Api.Guild.voice_regions/0.

Link to this function

modify_channel(channel_id, options, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.modify/3` directly instead. .

See Nostrum.Api.Channel.modify/3.

Link to this function

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

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

Link to this function

modify_current_user(options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.modify/1` directly instead. .

See Nostrum.Api.Self.modify/1.

Link to this function

modify_current_user!(options)

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

Link to this function

modify_current_user_nick(guild_id, options \\ %{})

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

See Nostrum.Api.Guild.modify_self_nick/2.

Link to this function

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

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify/3` directly instead. .

See Nostrum.Api.Guild.modify/3.

Link to this function

modify_guild!(guild_id, options \\ [])

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

Link to this function

modify_guild_auto_moderation_rule(guild_id, rule_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.AutoModeration.modify_rule/3` directly instead. .

See Nostrum.Api.AutoModeration.modify_rule/3.

Link to this function

modify_guild_channel_positions(guild_id, positions)

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

See Nostrum.Api.Guild.modify_channel_positions/2.

Link to this function

modify_guild_channel_positions!(guild_id, positions)

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_emoji/4` directly instead. .

See Nostrum.Api.Guild.modify_emoji/4.

Link to this function

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

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

Link to this function

modify_guild_integrations(guild_id, integration_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_integration/3` directly instead. .

See Nostrum.Api.Guild.modify_integration/3.

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_member/4` directly instead. .

See Nostrum.Api.Guild.modify_member/4.

Link to this function

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

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_role/4` directly instead. .

See Nostrum.Api.Guild.modify_role/4.

Link to this function

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

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

Link to this function

modify_guild_role_positions(guild_id, positions, reason \\ nil)

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

See Nostrum.Api.Guild.modify_role_positions/3.

Link to this function

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

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

Link to this function

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

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.ScheduledEvent.modify/4` directly instead. .

See Nostrum.Api.ScheduledEvent.modify/4.

Link to this function

modify_guild_sticker(guild_id, sticker_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Sticker.modify/3` directly instead. .

See Nostrum.Api.Sticker.modify/3.

Link to this function

modify_guild_widget(guild_id, options)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.modify_widget/2` directly instead. .

See Nostrum.Api.Guild.modify_widget/2.

Link to this function

modify_webhook(webhook_id, args, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Webhook.modify/3` directly instead. .

See Nostrum.Api.Webhook.modify/3.

Link to this function

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

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

See Nostrum.Api.Webhook.modify_with_token/4.

Link to this function

remove_guild_ban(guild_id, user_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.unban_member/3` directly instead. .

See Nostrum.Api.Guild.unban_member/3.

Link to this function

remove_guild_member(guild_id, user_id, reason \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.kick_member/3` directly instead. .

See Nostrum.Api.Guild.kick_member/3.

Link to this function

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

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

Link to this function

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

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

See Nostrum.Api.Guild.remove_member_role/4.

Link to this function

remove_thread_member(thread_id, user_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Thread.remove_member/2` directly instead. .

See Nostrum.Api.Thread.remove_member/2.

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

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

View Source
@spec request(atom(), String.t(), any(), keyword() | map()) ::
  {:ok} | {:ok, String.t()} | error()
Link to this function

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

View Source
@spec request_multipart(atom(), String.t(), any(), keyword() | map()) ::
  {:ok} | {:ok, String.t()} | error()
Link to this function

start_thread_in_forum_channel(channel_id, options, reason \\ nil)

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

See Nostrum.Api.Thread.create_in_forum/3.

Link to this function

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

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

See Nostrum.Api.Thread.create_with_message/4.

Link to this function

start_typing(channel_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Channel.start_typing/1` directly instead. .

See Nostrum.Api.Channel.start_typing/1.

Link to this function

start_typing!(channel_id)

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

Link to this function

sync_guild_integrations(guild_id, integration_id)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Guild.sync_integration/2` directly instead. .

See Nostrum.Api.Guild.sync_integration/2.

Link to this function

update_shard_status(pid, status, game, type \\ 0, stream \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.update_shard_status/5` directly instead. .

See Nostrum.Api.Self.update_shard_status/5.

Link to this function

update_status(status, game, type \\ 0, stream \\ nil)

View Source
This function is deprecated. Calling `Nostrum.Api` functions directly will be removed in v1.0 Use `Nostrum.Api.Self.update_status/4` directly instead. .

See Nostrum.Api.Self.update_status/4.

Link to this function

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

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

See Nostrum.Api.Self.update_voice_state/4.