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.
(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.
(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, :music, or :watch which change how the status message displays, as "Playing", "Streaming", "Listening to", or "Watching" respectively, defaults to :game. You can also pass the number of the discord status type directly if it isn't listed here. 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, :music, or :watch which change how the status message displays, as "Playing", "Streaming", "Listening to", or "Watching" respectively, defaults to :game. You can also pass the number of the discord status type directly if it isn't listed here. url: link to display with the :stream type, currently only urls starting with https://twitch.tv/ will work, defaults to nil
(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.
(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
(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
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close