Releases: IanMitchell/interaction-kit
discord-bitflag v1.0.1
Fixes a typing issue with the flags. They now should autcomplete correctly while using them. Special thanks to @Darker-Ink for finding and fixing this issue, and for @ckohen for improving the typing.
discord-bitflag v1.0.0
A JavaScript wrapper for Discord bitflags. You can easily modify Permissions, Intents, User flags, Channel Flags, and more with this library.
Usage
import { PermissionFlags, PermissionsBitField } from "discord-bitflag";
const response = await fetch(DISCORD_API, { ...options });
const permissions = new PermissionsBitField(response.permissions);
if (permissions.has(PermissionFlags.BanMembers)) {
console.log("This user can ban members!");
}
if (permissions.has(PermissionsBitField.ALL)) {
console.log("This user has all permissions!");
}
if (permissions.hasWithoutAdmin(PermissionsBitField.ALL)) {
console.log("This user REALLY has all permissions!");
}
bitflag-js v1.0.0
This package provides a class for working with bitflag fields. These structures are very useful as a way to condense a list of boolean values into a single number. They are perfect matches for things like user flags, permissions, and more.
bitflag-js is written in TypeScript and uses bigints instead of numbers.
Usage
import { BitField } from "bitflags-js";
const UserBadges = {
VERIFIED: 1n << 0n,
CONTRIBUTOR: 1n << 1n,
SUPPORTER: 1n << 2n,
VIP: 1n << 3n,
};
const bitfield = new BitField();
bitfield.add(UserBadges.VERIFIED);
bitfield.add(UserBadges.CONTRIBUTOR);
if (bitfield.has(UserBadges.VERIFIED)) {
console.log("This user is verified!");
}
console.log(bitfield.value);
discord-verify v1.2.0
Adds an AWS export to enable discord-verify usage on Lambda. Within your function, you can use it like this:
import { isValid } from "discord-verify/aws";
const handler = (event: APIGatewayProxyEvent) => {
const isValid = await isValid(event);
if (!isValid) {
return {
statusCode: 401,
body: 'Invalid request signature',
};
}
// ...
}
Special thanks to @suneettipirneni for writing the PR!
discord-verify v1.1.0
This adds replay attack protection. By default, any request received 15 minutes after the timestamp header is rejected. You can customize this behavior by setting an optional parameter.
Special thanks to @jaw0r3k and @botatooo for contributing to this release!
discord-verify v1.0.3
Fixes documentation errors
discord-request v1.0.1
Fixes some documentation oversights
discord-request v1.0.0
The first stable version of discord-request
. This package is a thin wrapper around the discord-api, but does not handle rate limits or other errors automatically for you. It does handle formatting requests and uploads. For more information on this project, check the package README!
discord-error v3.0.1
Fixes a bug encountered when parsing Discord error groups. The error string should now correctly identify array positions
discord-edge-runner v1.0.2
Updates the package to use the new esbuild API