Skip to main content
Module

x/discordeno/util/mod.ts

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

Functions

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

This function converts a bitwise string to permission strings

Pause the execution for a given amount of milliseconds.

CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation

Help format an image url.

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.

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

Removes the Bot before the token.

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.