Jido.Chat.Discord.Transport behaviour (Jido Chat Discord v1.0.0)

Copy Markdown View Source

Transport contract for Discord API operations.

Summary

Types

api_result()

@type api_result() :: {:ok, map() | boolean()} | {:error, term()}

Callbacks

add_reaction(channel_id, message_id, emoji, opts)

@callback add_reaction(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  emoji :: String.t(),
  opts :: keyword()
) :: api_result()

create_interaction_response(interaction_id, interaction_token, payload, opts)

@callback create_interaction_response(
  interaction_id :: String.t() | integer(),
  interaction_token :: String.t(),
  payload :: map(),
  opts :: keyword()
) :: api_result()

delete_message(channel_id, message_id, opts)

@callback delete_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  opts :: keyword()
) :: api_result()

edit_message(channel_id, message_id, text, opts)

@callback edit_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  text :: String.t(),
  opts :: keyword()
) :: api_result()

fetch_channel_messages(channel_id, opts)

@callback fetch_channel_messages(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_message(channel_id, message_id, opts)

@callback fetch_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  opts :: keyword()
) :: api_result()

fetch_messages(channel_id, opts)

@callback fetch_messages(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_metadata(channel_id, opts)

@callback fetch_metadata(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_thread(channel_id, opts)

@callback fetch_thread(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

list_threads(channel_id, opts)

@callback list_threads(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

open_dm(user_id, opts)

@callback open_dm(user_id :: String.t() | integer(), opts :: keyword()) ::
  {:ok, String.t() | integer()} | {:error, term()}

open_thread(channel_id, message_id, opts)

@callback open_thread(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  opts :: keyword()
) :: api_result()

remove_reaction(channel_id, message_id, emoji, opts)

@callback remove_reaction(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  emoji :: String.t(),
  opts :: keyword()
) :: api_result()

send_message(channel_id, text, opts)

@callback send_message(
  channel_id :: String.t() | integer(),
  text :: String.t(),
  opts :: keyword()
) :: api_result()

start_typing(channel_id, opts)

@callback start_typing(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()