discord_gleam/http/endpoints

Functions

pub fn ban_member(
  token: String,
  guild_id: String,
  user_id: String,
  reason: String,
) -> #(String, String)

Ban a member from a server

pub fn delete_message(
  token: String,
  channel_id: String,
  message_id: String,
  reason: String,
) -> #(String, String)

Delete a message by channel id and message id

pub fn interaction_send_text(
  interaction: InteractionCreate,
  message: String,
  ephemeral: Bool,
) -> #(String, String)

Send a basic text reply to an interaction

pub fn kick_member(
  token: String,
  guild_id: String,
  user_id: String,
  reason: String,
) -> #(String, String)

Kick a member from a server

pub fn me(token: String) -> Result(User, DiscordError)

Get the current user

pub fn register_global_command(
  token: String,
  client_id: String,
  command: SlashCommand,
) -> #(String, String)

Register a new global slash command

pub fn register_guild_command(
  token: String,
  client_id: String,
  guild_id: String,
  command: SlashCommand,
) -> #(String, String)

Register a new guild-specific slash command

pub fn reply(
  token: String,
  channel_id: String,
  message: Reply,
) -> Nil

Reply to a message

pub fn send_direct_message(
  token: String,
  user_id: String,
  message: Message,
) -> Nil

Creates a DM channel, then sends a message with send_message().

pub fn send_message(
  token: String,
  channel_id: String,
  message: Message,
) -> Nil

Send a message to a channel

pub fn wipe_global_commands(
  token: String,
  client_id: String,
) -> #(String, String)

Wipes the global commands for the bot

pub fn wipe_guild_commands(
  token: String,
  client_id: String,
  guild_id: String,
) -> #(String, String)

Wipes the guild commands for the bot

Search Document