APIClient

APIClient is the base abstraction for interacting with the Discord API.

Constructors

this
this(Client client)

Undocumented in source.

Members

Functions

channelsMessagesCreate
Message channelsMessagesCreate(Snowflake chan, inout(string) content, inout(string) nonce, inout(bool) tts, inout(MessageEmbed) embed)

Sends a message to a channel.

channelsMessagesDelete
void channelsMessagesDelete(Snowflake chan, Snowflake msg)

Deletes a message.

channelsMessagesDeleteBulk
void channelsMessagesDeleteBulk(Snowflake chan, Snowflake[] msgIDs)

Deletes messages in bulk.

channelsMessagesList
Message[] channelsMessagesList(Snowflake chan, uint limit, MessageFilter filter, Snowflake msg)

Returns an array of message IDs for a channel up to limit (max 100), filter with respect to supplied messageID.

channelsMessagesModify
Message channelsMessagesModify(Snowflake chan, Snowflake msg, inout(string) content, inout(MessageEmbed) embed)

Edits a message's contents.

gatewayGet
string gatewayGet()

Returns a valid Gateway Websocket URL

guildMembersBan
void guildMembersBan(Snowflake id, Snowflake user)

Bans a user from a Guild.

guildMembersRemoveBan
void guildMembersRemoveBan(Snowflake id, Snowflake user)

Unbans a user from a Guild.

guildsChannelsList
Channel[] guildsChannelsList(Snowflake id)

Returns a list of channels for a Guild.

guildsDelete
void guildsDelete(Snowflake id)

Deletes a guild.

guildsGet
Guild guildsGet(Snowflake id)

Returns a Guild for a Snowflake ID.

guildsMembersKick
void guildsMembersKick(Snowflake id, Snowflake user)

Removes (kicks) a user from a Guild.

guildsModify
Guild guildsModify(Snowflake id, VibeJSON obj)

Modifies a guild.

requestJSON
APIResponse requestJSON(CompiledRoute route)

Makes a HTTP request to the API (with empty body), returning an APIResponse

requestJSON
APIResponse requestJSON(CompiledRoute route, string[string] params)

Makes a HTTP request to the API (with JSON body), returning an APIResponse

requestJSON
APIResponse requestJSON(CompiledRoute route, VibeJSON obj)

Makes a HTTP request to the API (with JSON body), returning an APIResponse

requestJSON
APIResponse requestJSON(CompiledRoute route, string[string] params, string content)

Makes a HTTP request to the API (with string body), returning an APIResponse

usersGet
User usersGet(Snowflake id)

Return a User object for a Snowflake ID.

usersMeDMSCreate
Channel usersMeDMSCreate(Snowflake recipientID)

Creates a new DM for a recipient (user) ID. Returns a Channel object.

usersMeDMSList
Channel[] usersMeDMSList()

Returns a list of Channel objects for the current user.

usersMeGet
User usersMeGet()

Return the User object for the currently logged in user.

usersMeGuildsLeave
void usersMeGuildsLeave(Snowflake id)

Leaves a guild.

usersMeGuildsList
Guild[] usersMeGuildsList()

Returns a list of Guild objects for the current user.

usersMePatch
User usersMePatch(string username, string avatar)

Modifies the current users settings. Returns a User object.

Variables

baseURL
string baseURL;

Undocumented in source.

client
Client client;

Undocumented in source.

log
Logger log;

Undocumented in source.

ratelimit
RateLimiter ratelimit;

Undocumented in source.

token
string token;

Undocumented in source.

userAgent
string userAgent;

Undocumented in source.

Meta