Skip to content

Releases: IanMitchell/interaction-kit

discord-bitflag v1.0.1

10 Nov 19:55
Compare
Choose a tag to compare

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

09 Aug 21:22
85fae6f
Compare
Choose a tag to compare

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

09 Aug 21:21
85fae6f
Compare
Choose a tag to compare

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

27 Jun 23:49
263a38e
Compare
Choose a tag to compare

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

19 May 18:29
8f7d829
Compare
Choose a tag to compare

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

21 Apr 21:18
3589bc6
Compare
Choose a tag to compare

Fixes documentation errors

discord-request v1.0.1

21 Apr 22:53
c068d86
Compare
Choose a tag to compare

Fixes some documentation oversights

discord-request v1.0.0

21 Apr 21:21
3589bc6
Compare
Choose a tag to compare

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

21 Apr 21:19
3589bc6
Compare
Choose a tag to compare

Fixes a bug encountered when parsing Discord error groups. The error string should now correctly identify array positions

discord-edge-runner v1.0.2

21 Apr 21:19
3589bc6
Compare
Choose a tag to compare

Updates the package to use the new esbuild API