Methods

@:value({ cb : null })acceptInvite (invite_code:String, ?cb:Invite ‑> ErrorReport ‑> Void):Void

(NOT AVAILABLE FOR BOTS) Accept an invite code and join the server.

Parameters:

invite_code
  • The invite code to join.
cb
  • Returns the invite that was joined, or an error.

@:value({ cb : null })addChannelPin (channel_id:String, message_id:String, ?cb:EmptyResponseCallback):Void

Add a channel pin

Parameters:

channel_id
  • The channel
message_id
  • The message
cb
  • Called once completed. Leave blank to ignore.

@:value({ cb : null })addGuildMember (guild_id:String, user_id:String, member_data:AddGuildMember, ?cb:GuildMember ‑> String ‑> Void):Void

Add a guild member using a token received through Oauth2. Requires the CREATE_INSTANT_INVITE permission along with various other permissions depending on member_data parameters

Parameters:

guild_id
  • The id of the guild.
user_id
  • The id of the user
member_data
  • The access token, along with other optional parameters.
cb
  • The added guildmember. or an error.

@:value({ cb : null })addIntegration (guild_id:String, int_data:IntegrationCreate, ?cb:EmptyResponseCallback):Void

Add a new integration from the user onto the guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The id to add the integration to.
int_data
  • The data of the new integration.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null, reason : "", days : 7 })banMember (guild_id:String, user_id:String, days:Int = 7, reason:String = "", ?cb:EmptyResponseCallback):Void

Ban a member of the guild. Requires the BAN_MEMBERS permission.

Parameters:

guild_id
  • The guild to ban from.
user_id
  • The user to ban.
days
  • Number of days (from 0-7) to remove the user's messages server wide.
reason
  • The reason for this ban, for audit log.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null, days : 1 })beginPrune (guild_id:String, days:Int = 1, ?cb:Int ‑> ErrorReport ‑> Void):Void

Prune the members of a server. Requires the KICK_MEMBERS permission

Parameters:

guild_id
  • The guild to prune in.
days
  • The number of days to count prune for.
cb
  • Returns the number of users that were pruned, or an error.

@:value({ authorized : true, data : null, callback : null })callEndpoint (method:String, endpoint:EndpointPath, ?callback:Dynamic ‑> ErrorReport ‑> Void, ?data:{}, authorized:Bool = true):Void

Call an endpoint while respecting ratelimits and such. Only use this if the endpoint call is not a function of its own (and make an issue on the github if that is the case)

Parameters:

method
  • The HTTP method to use.
endpoint
  • The method url (not including the discord api part).
callback
  • The function to callback to.
data
  • Any extra data to send along (as POST body).
authorized
  • Whether the endpoint requires a token or not.

@:value({ cb : null })changeNickname (guild_id:String, nickname:String, ?cb:String ‑> ErrorReport ‑> Void):Void

Change this user's nickname.

Parameters:

guild_id
  • The guild to change nickname in.
nickname
  • The nickname to change to.
cb
  • Returns the nickname, or an error.

@:value({ cb : null })createChannel (guild_id:String, channel_data:ChannelCreate, ?cb:EmptyResponseCallback):Void

Create a channel in a guild

Parameters:

guild_id
  • The guild to create the channel in
channel_data
  • The channel's starting data
cb
  • Callback to send the new channel object to. Or null if result is not desired.

@:value({ cb : null })createChannelInvite (channel_id:String, invite:InviteCreate, ?cb:EmptyResponseCallback):Void

Create a new invite for a given channel

Parameters:

channel_id
  • The channel
invite
  • The invite data.
cb
  • Return the invite or an error.

@:value({ cb : null })createDM (data:{recipient_id:String}, ?cb:DMChannel ‑> ErrorReport ‑> Void):Void

Create a dm with another individual

Parameters:

data
  • A struct that contains the recipient's id.
cb
  • Returns the dm channel requested, or an error.

@:value({ cb : null })createEmoji (guild_id:String, emoji:EmojiCreate, ?cb:Emoji ‑> String ‑> Void):Void

Create an emoji in a guild.

Parameters:

guild_id
  • The guild to add the emoji to.
emoji
  • The emoji to create.
cb
  • The created emoji, or an error

@:value({ cb : null })createGroupDM (data:CreateGroupDM, ?cb:DMChannel ‑> ErrorReport ‑> Void):Void

Create a DM group.

Parameters:

data
  • A struct that contains the necessary arguments required to invite members.
cb
  • Returns the group dm channel, or an error.

@:value({ cb : null })createGuild (guild_data:GuildCreate, ?cb:Guild ‑> ErrorReport ‑> Void):Void

Create a new guild based on the data given

Parameters:

guild_data
  • The data to be changed, All fields are optional.
cb
  • Returns the new guild object, or an error.

@:value({ cb : null })createReaction (channel_id:String, message_id:String, emoji:String, ?cb:EmptyResponseCallback):Void

Add a reaction to a message. requires READ_MESSAGE_HISTORY and ADD_REACTIONS if the emoji is not already present.

Parameters:

channel_id
  • The channel that contains the message.
message_id
  • The message to react to.
emoji
  • The emote to be added, Custom emotes require their TAG.
cb
  • Called when completed, good for checking for errors.

@:value({ cb : null })createRole (guild_id:String, role_data:RoleInfo, ?cb:Role ‑> ErrorReport ‑> Void):Void

Create a role. Requires the MANAGE_ROLES permission.

Parameters:

guild_id
  • The guild to add a role to.
role_data
  • The role's data.
cb
  • Returns the new role, or an error.

@:value({ cb : null })createWebhook (channel_id:String, data:{name:String, avatar:String}, ?cb:Webhook ‑> ErrorReport ‑> Void):Void

Create a webhook for a given channel based on the given data.

Parameters:

channel_id
  • The channel to create for.
data
  • The data to create with.
cb
  • Returns the webhook object, or an error.

@:value({ cb : null })deleteAllReactions (channel_id:String, message_id:String, ?cb:EmptyResponseCallback):Void

Delete all reactions from a message. Requires the MANAGE_MESSAGES permission.

Parameters:

channel_id
  • The channel that contains the message.
message_id
  • The message to remove reactions from.
cb
  • Called when completed, good for looking for errors.

@:value({ cb : null })deleteChannel (channel_id:String, ?cb:Channel ‑> ErrorReport ‑> Void):Void

Delete the given channel.

Parameters:

channel_id
  • Channel id of channel to delete
cb
  • Callback to send old channel to. Or null if result is not desired.

@:value({ cb : null })deleteChannelPermission (channel_id:String, overwrite_id:String, ?cb:EmptyResponseCallback):Void

Delete a channel override

Parameters:

channel_id
  • The channel
overwrite_id
  • The overwrite id to delete
cb
  • Call once finished.

@:value({ cb : null })deleteChannelPin (channel_id:String, message_id:String, ?cb:EmptyResponseCallback):Void

Delete a channel's pin

Parameters:

channel_id
  • The channel
message_id
  • The pin id
cb
  • Called once completed. Leave blank to ignore.

@:value({ cb : null })deleteGuild (guild_id:String, ?cb:EmptyResponseCallback):Void

Delete a guild. The account must be the owner of the guild.

Parameters:

guild_id
  • The guild to delete.
cb
  • Return the old guild object, or an error.

@:value({ cb : null })deleteIntegration (guild_id:String, int_id:String, ?cb:EmptyResponseCallback):Void

Remove an integration from a guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The guild that contains the integration.
int_id
  • The id of the integration to remove.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })deleteInvite (invite_code:String, ?cb:Invite ‑> ErrorReport ‑> Void):Void

Delete an invite based on it's invite code. Requires the MANAGE_CHANNELS permission in the guild the invite is from.

Parameters:

invite_code
  • The invite code of the invite to delete.
cb
  • Returns the Invite that was removed, or an error.

@:value({ cb : null })deleteMessage (channel_id:String, message_id:String, ?cb:EmptyResponseCallback):Void

Delete a given message. If the author is not the current user, the MANAGE_MESSAGES permission is required

Parameters:

channel_id
  • The channel the message is in.
message_id
  • The id of the message.
cb
  • Return when complete.

@:value({ cb : null })deleteMessages (channel_id:String, message_ids:MessageBulkDelete, ?cb:EmptyResponseCallback):Void

Delete a given messages. MANAGE_MESSAGES is required.

Parameters:

channel_id
  • The channel the message is in.
message_ids
  • an array of id of the messages.
cb
  • Return when complete.

@:value({ cb : null })deleteOwnReaction (channel_id:String, message_id:String, emoji:String, ?cb:EmptyResponseCallback):Void

Delete a reaction of your own off of a message.

Parameters:

channel_id
  • The channel that contains the message.
message_id
  • The message to delete the reaction from.
emoji
  • The emote to be removed. Custom emotes require their TAG
cb
  • Called when completed, good for checking for errors.

@:value({ cb : null })deleteRole (guild_id:String, role_id:String, ?cb:EmptyResponseCallback):Void

Delete a role from a guild. Requires the MANAGE_ROLES permission.

Parameters:

guild_id
  • The guild to remove from.
role_id
  • The role to remove.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })deleteUserReaction (channel_id:String, message_id:String, user_id:String, emoji:String, ?cb:EmptyResponseCallback):Void

Delete another user's reaction off of a message.

Parameters:

channel_id
  • The channel that contains the message.
message_id
  • The message to delete the reaction from.
user_id
  • The user to delete the reaction from.
emoji
  • The emote to be removed. Custom emotes require their TAG
cb
  • Called when completed, good for checking for errors.

@:value({ cb : null })deleteWebhook (webhook_id:String, ?cb:EmptyResponseCallback):Void

Delete a webhook based on it's id. Requires the MANAGE_WEBHOOKS permission in the guild/channel that the webhook is part of.

Parameters:

webhook_id
  • The id of the webhook to delete.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })deleteWebhookWithToken (webhook_id:String, webhook_token:String, ?cb:EmptyResponseCallback):Void

Delete a webhook based on it's id and token.

Parameters:

webhook_id
  • The id of the webhook to delete.
webhook_token
  • The webhook's token.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })editChannelPermissions (channel_id:String, overwrite_id:String, new_permission:Overwrite, ?cb:EmptyResponseCallback):Void

Edit or Create a channel's overwrite permissions;

Parameters:

channel_id
  • The channel
overwrite_id
  • The overwrite Id, Id of user or role.
new_permission
  • The modified overwrite permission object
cb
  • Call once finished.

@:value({ cb : null })editGuildMember (guild_id:String, user_id:String, member_data:EditGuildMember, ?cb:EmptyResponseCallback):Void

Edit a guild member's properties, requires various permissions depending on the data provided.

Parameters:

guild_id
  • The guild the member is in.
user_id
  • The id of the member.
member_data
  • The updated data, all parameters are optional. All parameters require a different permission.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })editIntegration (guild_id:String, int_id:String, int_data:IntegrationModify, ?cb:EmptyResponseCallback):Void

Edit an integration in a guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The guild that contains the integration.
int_id
  • The id of the integration to change.
int_data
  • The new data for the integration. All parameters are optional.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })editMessage (channel_id:String, message_id:String, message:MessageEdit, ?cb:Message ‑> ErrorReport ‑> Void):Void

Edit a message previously sent by you.

Parameters:

channel_id
  • The channel the message is in.
message_id
  • The id of the message desired to be changed.
message
  • The new content of the message, all fields are optional.
cb
  • Return the new message, or an error.

@:value({ cb : null })editRole (guild_id:String, role_id:String, role_data:RoleInfo, ?cb:Role ‑> ErrorReport ‑> Void):Void

Edit a role's data. Requires the MANAGE_ROLES permission.

Parameters:

guild_id
  • The guild id to make the changes in.
role_id
  • The role to change.
role_data
  • The new data, All fields are optional.
cb
  • Returns the new role, or an error.

@:value({ cb : null })editUser (user_data:{username:String, avatar:String}, ?cb:User ‑> ErrorReport ‑> Void):Void

Edit the current user's settings.

Parameters:

user_data
  • The parameters to change, all fields are optional.
cb
  • Return the changed user, or an error.

@:value({ cb : null })editWebhook (webhook_id:String, data:{name:Null<String>, avatar:Null<String>}, ?cb:Webhook ‑> ErrorReport ‑> Void):Void

Edit a webhook based on it's id. Requires the MANAGE_WEBHOOKS permission in the guild/channel that the webhook is part of.

Parameters:

webhook_id
  • The id of the webhook to change.
data
  • The updated data for the webhook. All parameters are optional.
cb
  • Returns a webhook object, or an error.

@:value({ cb : null })editWebhookWithToken (webhook_id:String, webhook_token:String, data:{name:Null<String>, avatar:Null<String>}, ?cb:Webhook ‑> ErrorReport ‑> Void):Void

Edit a webhook using it's id and token

Parameters:

webhook_id
  • The webhook's id.
webhook_token
  • The webhook's token.
data
  • The updated data for the webhook. All parameters are optional.
cb
  • Returns a webhook object, or an error.

@:value({ cb : null, wait : false })executeWebhook (webhook_id:String, webhook_token:String, data:WebhookMessage, wait:Bool = false, ?cb:EmptyResponseCallback):Void

Execute a given webhook and send a message.

Parameters:

webhook_id
  • The id of the webhook.
webhook_token
  • The token of the webhook.
data
  • The message data to send.
wait
  • Whether or not the request should wait until the message is successfully sent.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null, filter : null })getAuditLogs (guild_id:String, ?filter:AuditLogFilter, ?cb:AuditLog ‑> ErrorReport ‑> Void):Void

Get a guild's audit logs

Parameters:

guild_id
  • The guild id to get
filter
  • Filter audit logs by these parameters.
cb
  • Returns the AuditLog object, or an error.

@:value({ cb : null })getChannel (channel_id:String, ?cb:Channel ‑> ErrorReport ‑> Void):Void

Get a channel based on a given channel id.

Parameters:

channel_id
  • The channel id to get the channel from
cb
  • Callback to send the receivied channel object to. Or null if result is not desired.

@:value({ cb : null })getChannelInvites (channel_id:String, ?cb:Array<Invite> ‑> ErrorReport ‑> Void):Void

Get the invites of a given channel

Parameters:

channel_id
  • The channel
cb
  • Array of Invites (or error).

@:value({ cb : null })getChannelPins (channel_id:String, ?cb:Array<Message> ‑> ErrorReport ‑> Void):Void

Get the pins of a channel

Parameters:

channel_id
  • The channel
cb
  • Return an array of pins (or an error)

@:value({ cb : null })getChannelWebhooks (channel_id:String, ?cb:Array<Webhook> ‑> ErrorReport ‑> Void):Void

Get all webhooks for a given channel. Requires the MANAGE_WEBHOOKS permission.

Parameters:

channel_id
  • The channel id to get webhooks about.
cb
  • Returns an array of webhooks, or an error.

@:value({ cb : null })getChannels (guild_id:String, ?cb:Array<Channel> ‑> ErrorReport ‑> Void):Void

Get the channels in a guild

Parameters:

guild_id
  • The guild id.
cb
  • Return an array of channel objects, or an error.

@:value({ cb : null })getConnections (?cb:Array<Connection> ‑> ErrorReport ‑> Void):Void

Get a list of connections hooked up to the current account.

Parameters:

cb
  • Returns a list of connections, or an error.

@:value({ cb : null })getDMChannels (?cb:Array<DMChannel> ‑> ErrorReport ‑> Void):Void

Get the dm channels that the current user has open.

Parameters:

cb
  • Returns an array of all dm channels the user currently has open, or an error.

@:value({ cb : null })getEmoji (guild_id:String, emoji_id:String, ?cb:Emoji ‑> String ‑> Void):Void

Get an emojis from a guild by id of guild and emoji.

Parameters:

guild_id
  • The guild to get the emoji from
emoji_id
  • The emoji to get
cb
  • Returns an emoji object, or an error.

@:value({ cb : null, bot : false })getGateway (bot:Bool = false, ?cb:Gateway ‑> ErrorReport ‑> Void):Void

Get the gateway that the client should connect to.

Parameters:

bot
  • Will get the bot gateway along with reccomended shard info if true.
cb
  • The callback to call once gotten. Or null if result is not desired.

@:value({ cb : null })getGuild (guild_id:String, ?cb:Guild ‑> String ‑> Void):Void

Get a guild by the id.

Parameters:

guild_id
  • The guild id
cb
  • Return the guild object, or an error.

@:value({ cb : null })getGuildBans (guild_id:String, ?cb:Array<User> ‑> ErrorReport ‑> Void):Void

List all the bans in a guild. Requires the BAN_MEMBERS permission.

Parameters:

guild_id
  • The guild id.
cb
  • Returns an array of users, or an error.

@:value({ cb : null })getGuildMember (guild_id:String, user_id:String, ?cb:GuildMember ‑> ErrorReport ‑> Void):Void

Get a member of the guild.

Parameters:

guild_id
  • The guild id.
user_id
  • The member's id.
cb
  • Return a member instance of the user. Or an error.

@:value({ cb : null })getGuildMembers (guild_id:String, format:ListGuildMember, ?cb:Array<GuildMember> ‑> String ‑> Void):Void

Get all members of a guild.

Parameters:

guild_id
  • The id of the guild.
format
  • The limit, and after. both are optional. used for paginating.
cb
  • The array of guild members. or an error.

@:value({ cb : null })getGuildRoles (guild_id:String, ?cb:Array<Role> ‑> ErrorReport ‑> Void):Void

Get the roles of a guild. Requires the MANAGE_ROLES permission.

Parameters:

guild_id
  • The guild to fetch roles for.
cb
  • Returns an array of guilds, or an error.

@:value({ cb : null })getGuildWebhooks (guild_id:String, ?cb:Array<Webhook> ‑> ErrorReport ‑> Void):Void

Get all webhooks for a given guild. Requires the MANAGE_WEBHOOKS permission.

Parameters:

guild_id
  • The guild id to get webhooks about.
cb
  • Returns an array of webhooks, or an error.

@:value({ cb : null })getGuilds (filter:GetGuildFilter, ?cb:Array<Guild> ‑> ErrorReport ‑> Void):Void

Get a list of all guilds that the current user is in. Normal users do not need to use the filter and can leave it blank {}

Parameters:

filter
  • Filter the list depending on these parameters, Only one of BEFORE or AFTER can be specified.
cb
  • Returns the list of Guilds according to the filter specified, or an error.

@:value({ cb : null })getIntegrations (guild_id:String, ?cb:Array<GuildIntegration> ‑> ErrorReport ‑> Void):Void

Get a list of integrations for a given guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The guild to get the list for.
cb
  • Returns an array of guildintegration objects, or an error.

@:value({ cb : null, with_counts : true })getInvite (invite_code:String, with_counts:Bool = true, ?cb:Invite ‑> ErrorReport ‑> Void):Void

Get information about an invite code.

Parameters:

invite_code
  • The invite code.
with_counts
  • Get some extra data from the invite's server
cb
  • Returns an Invite object, or an error.

@:value({ cb : null })getInvites (guild_id:String, ?cb:Array<Invite> ‑> ErrorReport ‑> Void):Void

Get a list of all invites in a guild. requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The id to get the list from.
cb
  • Returns an array of invites, or an error.

@:value({ cb : null })getMessage (channel_id:String, message_id:String, ?cb:Message ‑> ErrorReport ‑> Void):Void

Get a message in a channel

Parameters:

channel_id
  • The channel id
message_id
  • The message id
cb
  • Return the message, or an error.

@:value({ cb : null })getMessages (channel_id:String, format:MessagesRequest, ?cb:Array<Message> ‑> ErrorReport ‑> Void):Void

Get messages from a given channel according to the given format.

Parameters:

channel_id
  • The channel
format
  • Before, After, or Around.
cb
  • The array of messages, or an error.

@:value({ cb : null, days : 1 })getPruneCount (guild_id:String, days:Int = 1, ?cb:Int ‑> ErrorReport ‑> Void):Void

Get the number of users that will be pruned if a prune was run. Requires the KICK_MEMBERS permission.

Parameters:

guild_id
  • The guild to prune in.
days
  • The number of days to count prune for.
cb
  • Returns the number of users that would be pruned on a real request, or an error.

@:value({ cb : null })getReactions (channel_id:String, message_id:String, emoji:String, ?cb:Array<Reaction> ‑> String ‑> Void):Void

Get all reactions of emoji by user on a message.

Parameters:

channel_id
  • The channel that contains the message.
message_id
  • The message to get reactions from.
emoji
  • The emoji to look for.
cb
  • Returns an array of Reaction objects, or an error.

@:value({ cb : null, user_id : "@me" })getUser (user_id:String = "@me", ?cb:User ‑> ErrorReport ‑> Void):Void

Get a user based on their Id. @me" to return self.

Parameters:

user_id
  • Get any user based on their id, or set to "
cb
  • Return the user object, or an error.

@:value({ cb : null })getWebhook (webhook_id:String, ?cb:Webhook ‑> ErrorReport ‑> Void):Void

Get a webhook based on it's id. Requires the MANAGE_WEBHOOKS permission in the guild/channel that the webhook is part of.

Parameters:

webhook_id
  • The id of the webhook.
cb
  • Returns a webhook object, or an error.

@:value({ cb : null })getWebhookWithToken (webhook_id:String, webhook_token:String, ?cb:Webhook ‑> ErrorReport ‑> Void):Void

Get a webhook using it's id and token.

Parameters:

webhook_id
  • The webhook's id.
webhook_token
  • The webhook's token.
cb
  • Returns a webhook object, or an error.

@:value({ cb : null })getWidget (guild_id:String, ?cb:GuildEmbed ‑> ErrorReport ‑> Void):Void

Get the widget/embed for a guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The id of the guild to fetch the widget from.
cb
  • Returns the GuildEmbed object of the guild, or an error.

@:value({ cb : null })giveMemberRole (guild_id:String, user_id:String, role_id:String, ?cb:EmptyResponseCallback):Void

Give a role to a member. Requires the MANAGE_ROLES permission

Parameters:

guild_id
  • The guild that the user is in.
user_id
  • The id of the user.
role_id
  • The id of the role desired to be added.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })groupDMAddRecipient (channel_id:String, user_id:String, access_token:String, nick:String, ?cb:EmptyResponseCallback):Void

Add a user to a group dm.

Parameters:

channel_id
  • The group dm's channel.
user_id
  • The user to be added.
access_token
  • An OAUTH2 token received from authenticating the user.
nick
  • The nickname of the user.
cb
  • Called once completed.

@:value({ cb : null })groupDMRemoveRecipient (channel_id:String, user_id:String, ?cb:EmptyResponseCallback):Void

Remove a user from a group dm.

Parameters:

channel_id
  • The group dm's channel.
user_id
  • The user to be removed
cb
  • Called once completed, or errored

@:value({ cb : null })guildVoiceRegions (guild_id:String, ?cb:Array<VoiceRegion> ‑> ErrorReport ‑> Void):Void

Get a list of voice regions for the guild. Including VIP servers if the server is a VIP-Enabled server.

Parameters:

guild_id
  • The guild to get the list for.
cb
  • Returns an array of voiceregion objects, or an error.

@:value({ cb : null, reason : "" })kickMember (guild_id:String, user_id:String, reason:String = "", ?cb:EmptyResponseCallback):Void

Kick a member from the guild. Requires the KICK_MEMBERS permission

Parameters:

guild_id
  • The guild id.
user_id
  • The user id.
reason
  • The reason for this kick, for audit log.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })leaveGuild (guild_id:String, ?cb:EmptyResponseCallback):Void

Make the current user leave the specified guild.

Parameters:

guild_id
  • The guild to leave.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })listEmojis (guild_id:String, ?cb:Array<Emoji> ‑> String ‑> Void):Void

Get all emojis on a guild by guild_id.

Parameters:

guild_id
  • The guild to list emojis from.
cb
  • Returns an array of emoji objects, or an error.

@:value({ cb : null })listVoiceRegions (?cb:Array<VoiceRegion> ‑> ErrorReport ‑> Void):Void

Get a list of voice regions.

Parameters:

cb
  • Returns a list of voice regions, or an error.

@:value({ cb : null })modifyChannel (channel_id:String, channel_data:ChannelUpdate, ?cb:Channel ‑> ErrorReport ‑> Void):Void

Change a channel's parameters

Parameters:

channel_id
  • The id of the channel to be modified
channel_data
  • The changed channel data, all fields are optional
cb
  • Callback to send the new channel object to. Or null if result is not desired.

@:value({ cb : null })modifyEmoji (guild_id:String, emoji_id:String, emoji:EmojiModify, ?cb:Emoji ‑> String ‑> Void):Void

Modify an emoji in a guild.

Parameters:

guild_id
  • The guild that contains the emoji.
emoji_id
  • The emoji to edit.
emoji
  • The new emoji data.
cb
  • The edited emoji, or an error

@:value({ cb : null })modifyGuild (guild_id:String, guild_data:GuildUpdate, ?cb:Guild ‑> ErrorReport ‑> Void):Void

Edit a guild's settings. Requires the MANAGE_GUILD permission

Parameters:

guild_id
  • The guild id.
guild_data
  • The data to be changed, All fields are optional.
cb
  • Returns the new guild object, or an error.

@:value({ cb : null })modifyWidget (guild_id:String, edits:GuildEmbed, ?cb:GuildEmbed ‑> ErrorReport ‑> Void):Void

Change the properties of a guild's embed or widget. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The guild that contains the widget/embed.
edits
  • The changes to be made to the widget/embed. All parameters are optional.
cb
  • Returns the changed GuildEmbed object, or an error.

@:value({ cb : null })moveChannel (guild_id:String, changes:PositionChange, ?cb:Array<Channel> ‑> String ‑> Void):Void

Move two or more channel's positions within a guild. Requires the MANAGE_CHANNELS permission.

Parameters:

guild_id
  • The id of the guild
changes
  • An array of changes to channel positions
cb
  • Return an array of the channels within the guild, or an error.

@:value({ cb : null })moveRole (guild_id:String, changes:PositionChange, ?cb:Array<Role> ‑> ErrorReport ‑> Void):Void

Move the position of two or more roles in the hierarchy, requiers the MANAGE_ROLES permission.

Parameters:

guild_id
  • The guild to make the changes in.
changes
  • An array of changes to position.
cb
  • Returns an array of the roles of the server with their new positions, or an error.

@:value({ authorized : true, data : null, callback : null })rawCallEndpoint (method:String, endpoint:String, ?callback:Dynamic ‑> Map<String, String> ‑> Void, ?data:{}, authorized:Bool = true):Void

Call an endpoint directly, no ratelimits no nothin.

Parameters:

method
  • The HTTP method to use.
endpoint
  • The method url (not including the discord api part).
callback
  • The function to callback to.
data
  • Any extra data to send along (as POST body).
authorized
  • Whether the endpoint requires a token or not.

@:value({ cb : null })removeEmoji (guild_id:String, emoji_id:String, ?cb:EmptyResponseCallback):Void

Remove an emoji by ID in a guild

Parameters:

guild_id
  • The guild to remove the emoji from.
emoji_id
  • The emoji to remove.
cb
  • Called when completed, good for looking for errors

@:value({ cb : null })sendMessage (channel_id:String, message:MessageCreate, ?cb:Message ‑> ErrorReport ‑> Void):Void

Send a message to a channel

Parameters:

channel_id
  • The channel to send to
message
  • Message data
cb
  • Return the message sent, or an error

@:value({ cb : null })startTyping (channel_id:String, ?cb:EmptyResponseCallback):Void

Send a typing event in the given channel. This lasts for 10 seconds or when a message is sent, whichever comes first.

Parameters:

channel_id
  • The channel to type in.
cb
  • Return when complete.

@:value({ cb : null })syncIntegration (guild_id:String, int_id:String, ?cb:EmptyResponseCallback):Void

Sync a given integration in a guild. Requires the MANAGE_GUILD permission.

Parameters:

guild_id
  • The id of the guild that contains the integration.
int_id
  • The id of the integration to sync.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null })takeMemberRole (guild_id:String, user_id:String, role_id:String, ?cb:EmptyResponseCallback):Void

Take a role away from a member. Requires the MANAGE_ROLES permission

Parameters:

guild_id
  • The guild id.
user_id
  • The id of the user.
role_id
  • The id of the role to take away.
cb
  • Called on completion, useful for checking for errors.

@:value({ cb : null, reason : "" })unbanMember (guild_id:String, user_id:String, reason:String = "", ?cb:EmptyResponseCallback):Void

Unban a member of the guild. Requires the BAN_MEMBERS permission.

Parameters:

guild_id
  • The guild to unban from.
user_id
  • The user to unban.
cb
  • Called on completion, useful for checking for errors.