Liking cljdoc? Tell your friends :D

discljord.connections

Namespace for creating a connection to Discord, and recieving messages. Contains functionality required to create and maintain a sharded and auto-reconnecting connection object which will recieve messages from Discord, and pass them on to client code.

Namespace for creating a connection to Discord, and recieving messages.
Contains functionality required to create and maintain a sharded and auto-reconnecting
connection object which will recieve messages from Discord, and pass them on to client
code.
raw docstring

connect-bot!clj

(connect-bot! token out-ch & {:keys [buffer-size]})

Creates a connection process which will handle the services granted by Discord which interact over websocket.

Takes a token for the bot, and a channel on which all events from Discord will be sent back across.

Returns a channel used to communicate with the process and send packets to Discord.

Keep in mind that Discord sets a limit to how many shards can connect in a given period. This means that communication to Discord may be bounded based on which shard you use to talk to the server immediately after starting the bot.

Creates a connection process which will handle the services granted by
Discord which interact over websocket.

Takes a token for the bot, and a channel on which all events from Discord
will be sent back across.

Returns a channel used to communicate with the process and send packets to
Discord.

Keep in mind that Discord sets a limit to how many shards can connect in a
given period. This means that communication to Discord may be bounded based
on which shard you use to talk to the server immediately after starting the bot.
sourceraw docstring

create-activityclj

(create-activity & {:keys [name type url] :or {type :game} :as args})

Takes keyword arguments and constructs an activity to be used in status updates.

Keyword Arguments: name: a string which will display as the bot's status message, required type: keywords :game, :stream, or :music which change how the status message displays, as "Playing", "Streaming", or "Listening to" respectively, defaults to :game url: link to display with the :stream type, currently only urls starting with https://twitch.tv/ will work, defaults to nil

Takes keyword arguments and constructs an activity to be used in status updates.

Keyword Arguments:
name: a string which will display as the bot's status message, required
type: keywords :game, :stream, or :music which change how the status message displays, as "Playing", "Streaming", or "Listening to" respectively, defaults to :game
url: link to display with the :stream type, currently only urls starting with https://twitch.tv/ will work, defaults to nil
sourceraw docstring

disconnect-bot!clj

(disconnect-bot! connection-ch)

Takes the channel returned by connect-bot! and stops the connection.

Takes the channel returned by connect-bot! and stops the connection.
sourceraw docstring

guild-request-members!clj

(guild-request-members! connection-ch guild-id & args)

Takes the channel returned by connect-bot!, the snowflake guild id, and optional arguments about the members you want to get information about, and signals Discord to send you :guild-members-chunk events.

Keyword Arguments: query: a string that the username of the searched user starts with, or empty string for all users, defaults to empty string limit: the maximum number of members to give based on the query

Takes the channel returned by connect-bot!, the snowflake guild id, and optional arguments
about the members you want to get information about, and signals Discord to send you
:guild-members-chunk events.

Keyword Arguments:
query: a string that the username of the searched user starts with, or empty string for all users, defaults to empty string
limit: the maximum number of members to give based on the query
sourceraw docstring

status-update!clj

(status-update! connection-ch & args)

Takes the channel returned by connect-bot! and a set of keyword options, and updates Discord with a new status for your bot.

Keyword Arguments: idle-since: epoch time in milliseconds of when the bot went idle, defaults to nil activity: an activity map, from create-activity, which is used for the bot, defaults to nil status: a keyword representing the current status of the bot, can be :online, :dnd, :idle, :invisible, or :offline, defaults to :online afk: a boolean to say if the bot is afk, defaults to false

Takes the channel returned by connect-bot! and a set of keyword options, and updates
Discord with a new status for your bot.

Keyword Arguments:
idle-since: epoch time in milliseconds of when the bot went idle, defaults to nil
activity: an activity map, from create-activity, which is used for the bot, defaults to nil
status: a keyword representing the current status of the bot, can be :online, :dnd, :idle, :invisible, or :offline, defaults to :online
afk: a boolean to say if the bot is afk, defaults to false
sourceraw docstring

voice-state-update!clj

(voice-state-update! connection-ch guild-id & args)

Takes the channel returned by connect-bot!, a guild id, and a set of keyword options and updates Discord with a new voice state.

Keyword Arguments: channel-id: the new channel id snowflake that your bot is in, disconnect if nil, defaults to nil mute: boolean which says if the bot is muted deaf: boolean which says if the bot is deafened

Takes the channel returned by connect-bot!, a guild id, and a set of keyword options and
updates Discord with a new voice state.

Keyword Arguments:
channel-id: the new channel id snowflake that your bot is in, disconnect if nil, defaults to nil
mute: boolean which says if the bot is muted
deaf: boolean which says if the bot is deafened
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close