Skip to main content
Module

x/discordeno/mod.ts

Discord API library for Deno
Latest
import * as discordeno from "https://deno.land/x/discordeno@18.0.1/mod.ts";

Enums

Variables

Functions

Adds a reaction to a message.

Adds multiple a reaction to a message.

Adds a role to a member.

Adds a member to a thread.

Bans a user from a guild.

This function converts an array of permissions into the bitwise string.

This function converts a bitwise string to permission strings

Handler used to determine max number of shards to use based upon the max concurrency.

Check the rate limits for a url or a bucket.

Cleans up the queues by checking if there is nothing left and removing it.

Connects the bot user to a voice or stage channel.

Creates an automod rule in a guild.

Creates a channel within a guild.

Creates an emoji in a guild.

Creates a new thread in a forum channel, and sends a message within the created thread.

Create a new Gateway Manager.

Creates an application command accessible globally; across different guilds and channels.

Creates a guild.

Creates an application command only accessible in a specific guild.

Creates a guild from a template.

Create a new sticker for the guild.

Creates a template from a guild.

Creates an invite to a channel in a guild.

Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord.

Creates a role in a guild.

Creates a scheduled event in a guild.

Create a new Shard manager. This does not manage a specific range of Shard but the provided Shards on create or when an identify is requested. The aim of this is to provide an easy to use manager which can be used by workers or any other kind of separate process.

Creates a stage instance associated with a stage channel.

Creates a webhook.

Cross-posts a message posted in an announcement channel to subscribed channels.

Pause the execution for a given amount of milliseconds.

Deletes an automod rule.

Deletes a channel from within a guild.

Deletes a permission override for a user or role in a channel.

Deletes an emoji from a guild.

Deletes a follow-up message to an interaction.

Deletes an application command registered globally.

Deletes a guild.

Deletes an application command registered in a guild.

Delete a new sticker for the guild.

Deletes a template from a guild.

Deletes an integration attached to a guild.

Deletes an invite to a channel.

Deletes a message from a channel.

Deletes multiple messages from a channel.

Deletes the initial message response to an interaction.

Deletes a reaction added by the bot user from a message.

Deletes all reactions for all emojis from a message.

Deletes all reactions for an emoji from a message.

Deletes a role from a guild.

Deletes a scheduled event from a guild.

Deletes the stage instance associated with a stage channel, if one exists.

Deletes a user's reaction from a message.

Deletes a webhook.

Deletes a webhook message.

Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.

Edits the permissions for a guild application command.

Edits an automod rule.

Edits the nickname of the bot user.

Modifies the bot's username or avatar. NOTE: username: if changed may cause the bot's discriminator to be randomized.

Edits a channel's settings.

Edits the permission overrides for a user or role in a channel.

Edits the positions of a set of channels in a guild.

Edits an emoji.

Edits a follow-up message to an interaction.

Edits a global application command.

Edits a guild's settings.

Edits an application command registered in a guild.

Modify a guild's MFA level. Requires guild ownership.

Edit the given sticker.

Edits a template's settings.

Edits a member's properties.

Edits a message.

Edits the initial message response to an interaction.

Edits the original webhook message.

Edits the voice state of the bot user.

Edits a role in a guild.

Edits a scheduled event.

Edits a stage instance.

Edits the voice state of another user.

Edits a webhook.

Edits a webhook message.

Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.

Edits a guild's welcome screen.

Edits the settings of a guild's widget.

Executes a webhook, causing a message to be posted in the channel configured for the webhook.

Fetches the list of members for a guild over the gateway.

Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.

Help format an image url.

Gets the list of all active threads for a guild.

Gets the permissions of a guild application command.

Gets the permissions of all application commands registered in a guild by the ID of the guild.

Get the applications info

Gets a guild's audit log.

Gets an automod rule by its ID.

Gets the list of automod rules for a guild.

Gets the list of available voice regions.

Builds a URL to a user's avatar stored in the Discord CDN.

Gets a ban by user ID.

Gets the list of bans for a guild.

Get the bot id from the bot token. WARNING: Discord staff has mentioned this may not be stable forever. Use at your own risk. However, note for over 5 years this has never broken.

Gets a channel by its ID.

Gets the list of invites for a channel.

Gets the list of channels for a guild.

Gets a list of webhooks for a channel.

Gets or creates a DM channel with a user.

Gets an emoji by its ID.

Gets the list of emojis for a guild.

Builds a URL to an emoji in the Discord CDN.

Gets a follow-up message to an interaction by the ID of the message.

Get the bots Gateway metadata that can help during the operation of large or sharded bots.

Gets a global application command by its ID.

Gets the list of your bot's global application commands.

Gets a guild by its ID.

Gets a guild application command by its ID.

Gets the list of application commands registered by your bot in a guild.

Builds a URL to the guild banner stored in the Discord CDN.

Builds a URL to the guild icon stored in the Discord CDN.

Gets the preview of a guild by a guild's ID.

Builds the URL to a guild splash stored in the Discord CDN.

Returns a sticker object for the given guild and sticker IDs.

Returns an array of sticker objects for the given guild.

Gets a template by its code.

Gets the list of templates for a guild.

Gets the list of webhooks for a guild.

Gets the list of integrations attached to a guild.

Gets an invite to a channel by its invite code.

Gets the list of invites for a guild.

Gets the member object by user ID.

Gets the list of members for a guild.

Gets a message from a channel by the ID of the message.

Gets multiple messages from a channel.

Returns the list of sticker packs available to Nitro subscribers.

Gets the initial message response to an interaction.

Gets the pinned messages for a channel.

Gets the list of private archived threads for a channel.

Gets the list of private archived threads the bot is a member of for a channel.

Gets the number of members that would be kicked from a guild during pruning.

Gets the list of public archived threads for a channel.

Gets the list of users that reacted with an emoji to a message.

Gets the list of roles for a guild.

Gets a scheduled event by its ID.

Gets the list of scheduled events for a guild.

Gets the list of subscribers to a scheduled event from a guild.

Gets the stage instance associated with a stage channel, if one exists.

Returns a sticker object for the given sticker ID.

Gets a thread member by their user ID.

Gets the list of thread members for a thread.

This function will return the raw user payload in the rare cases you need to fetch a user directly from the API.

Gets information about the vanity url of a guild.

Gets the list of voice regions for a guild.

Gets a webhook by its ID.

Gets a webhook message by its ID.

Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.

Gets the welcome screen for a guild.

Gets the guild widget by guild ID.

Builds a URL to the guild widget image stored in the Discord CDN.

Gets the settings of a guild's widget.

TS save way to check if a property exists in an object

Adds the bot user to a thread.

Kicks a member from a guild.

Leaves a guild.

Removes the bot user from a thread.

Leaves the voice channel the bot user is currently in.

Edits the positions of a set of roles.

Pins a message in a channel.

Processes the queue by looping over each path separately until the queues are empty.

This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed.

Processes a request and assigns it to a queue or creates a queue if none exists for it.

Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available

Initiates the process of pruning inactive members.

Removes a role from a member.

Removes a member from a thread.

Removes the Bot before the token.

Gets the list of members whose usernames or nicknames start with a provided string.

Sends a follow-up message to an interaction.

Sends a response to an interaction.

Sends a message to a channel.

Split a url to separate rate limit buckets based on major/minor parameters.

Begin spawning shards.

Creates a thread, using an existing message as its point of origin.

Creates a thread without using a message as the thread's point of origin.

Synchronises a template with the current state of a guild.

Allows users to hook in and change to communicate to different workers across different servers or anything they like. For example using redis pubsub to talk to other servers.

Triggers a typing indicator for the bot user.

Unbans a user from a guild.

Unpins a pinned message in a channel.

Re-registers the list of global application commands, overwriting the previous commands completely.

Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.

Converts a url to base 64. Useful for example, uploading/creating server emojis.

Validates the length of a string in JS. Certain characters in JS can have multiple numbers in length in unicode and discords api is in python which treats length differently.

Interfaces

A Leaky Bucket. Useful for rate limiting purposes. This uses performance.now() instead of Date.now() for higher accuracy.

Type Aliases

Allows any type but T it is recursive

Array with no utilty methods, aka Object.create(null)

object identity type

alternative to 'object' or '{}'

Makes all of properties in T optional when they're null | undefined it is recursive

Non object primitives

This is a Shard manager. This does not manage a specific range of Shard but the provided Shards on create or when an identify is requested. The aim of this is to provide an easy to use manager which can be used by workers or any other kind of separate process.