Module discord_bot_light_client

Behaviours: gen_server.

Function Index

code_change/3
edit_message/4Edit an existing message in a Discord channel.
handle_call/3
handle_cast/2
handle_info/2Handle connection initiation.
init/1Initialize the gen_server with token and command handler.
send_message/3Send a message to a Discord channel.
send_message_with_files/4
start_link/1Start the Discord bot client with just a token (no command handler).
start_link/2Start the Discord bot client with token and options Options can include: - {command_handler, Module} - Module implementing handle_message/4 - {command_handler, {Module, Function}} - MFA style handler - {command_handler, Fun} - Function with arity 4.
terminate/2

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> any()

edit_message/4

edit_message(ChannelId::binary(), MessageId::binary(), Content::binary(), Token::binary()) -> {ok, integer(), binary()} | {error, term()}

Edit an existing message in a Discord channel

handle_call/3

handle_call(Request, From, State) -> any()

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

Handle connection initiation

init/1

init(X1) -> any()

Initialize the gen_server with token and command handler

send_message/3

send_message(ChannelId::binary(), Content::binary(), Token::binary()) -> {ok, binary()} | {error, term()}

Send a message to a Discord channel

send_message_with_files/4

send_message_with_files(ChannelId::binary(), Content::binary(), Token::binary(), Files::[{binary(), binary()}]) -> {ok, binary()} | {error, term()}

start_link/1

start_link(Token::binary() | string()) -> {ok, pid()} | {error, term()}

Start the Discord bot client with just a token (no command handler)

start_link/2

start_link(Token::binary() | string(), Options::list()) -> {ok, pid()} | {error, term()}

Start the Discord bot client with token and options Options can include: - {command_handler, Module} - Module implementing handle_message/4 - {command_handler, {Module, Function}} - MFA style handler - {command_handler, Fun} - Function with arity 4

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc