Discord Elixir v1.1.4 DiscordEx.Client

Connect to Discord to recieve and send data in realtime You shouldn’t be using this directly. You should shold pass it to a handler.

Examples

token = "<your-token>"
DiscordEx.Client.start_link(%{token: token, handler: DiscordEx.EchoBot})
#=> {:ok, #PID<0.178.0>}

Summary

Functions

Start a voice connection listener process

Callback implementation for c::websocket_client.init/1

Callback implementation for c::websocket_client.onconnect/2

Callback implementation for c::websocket_client.ondisconnect/2

Voice State Update for Users ( move users around voice channels )

Callback implementation for c::websocket_client.websocket_handle/3

Initiate voice connection update state call

Callback implementation for c::websocket_client.websocket_terminate/3

Functions

_voice_setup_gather_data(caller_pid, data \\ %{}, state)

Start a voice connection listener process

handle_event(arg, state)
identify(state)
init(state)

Callback implementation for c::websocket_client.init/1.

onconnect(WSReq, state)

Callback implementation for c::websocket_client.onconnect/2.

ondisconnect(arg, state)

Callback implementation for c::websocket_client.ondisconnect/2.

opcodes()
socket_url(opts)

Specs

socket_url(map) :: String.t
start_link(opts)
voice_state_update(client_pid, guild_id, channel_id, user_id, options \\ %{})

Specs

voice_state_update(pid, String.t, String.t, String.t, map) :: atom

Voice State Update for Users ( move users around voice channels )

Parameters

  • client_pid: Base client process
  • guild_id: Which guild to move this user in
  • channel_id: Which channel the user is in or you want to move them to
  • user_id: User to manipulate
  • options: Options to set on the user

Examples

DiscordEx.Client.voice_state_update(client, guild_id, user_id, channel_id, %{self_deaf: true, self_mute: false})
websocket_handle(arg, socket, state)

Callback implementation for c::websocket_client.websocket_handle/3.

websocket_info(arg1, connection, state)

Initiate voice connection update state call

websocket_terminate(reason, conn_state, state)

Callback implementation for c::websocket_client.websocket_terminate/3.