Compare commits

...

6 Commits

Author SHA1 Message Date
Vlad Frangu
557b969f35 chore(release): 0.18.1 🎉 (#130) 2021-05-03 23:34:40 +03:00
Jan
bd638b97e5 feat: add new interfaces for interaction-related structures (#129) 2021-05-03 23:19:17 +03:00
Advaith
44b956ad85 fix(APIInvite): expires_at is nullable (#128) 2021-04-30 19:58:16 +03:00
Advaith
82ca0ce5c4 feat(APIInvite): add expires_at field and with_expiration param (#127) 2021-04-30 19:32:24 +03:00
Advaith
91afb0bb49 feat(ApplicationCommandOptionType): add MENTIONABLE (9) (#126) 2021-04-28 20:42:22 +03:00
Vlad Frangu
653b9ff17f chore(release): 0.18.0 🎉 (#125) 2021-04-18 11:03:16 +03:00
10 changed files with 141 additions and 11 deletions

View File

@@ -1,3 +1,30 @@
## [0.18.1](https://github.com/discordjs/discord-api-types/compare/0.18.0...0.18.1) (2021-05-03)
### Bug Fixes
- **APIInvite:** `expires_at` is nullable ([#128](https://github.com/discordjs/discord-api-types/issues/128)) ([44b956a](https://github.com/discordjs/discord-api-types/commit/44b956ad858a457e7671ced38529b433b02efbde))
### Features
- add new interfaces for interaction-related structures ([#129](https://github.com/discordjs/discord-api-types/issues/129)) ([bd638b9](https://github.com/discordjs/discord-api-types/commit/bd638b97e5d26abd8a4f1edbd0f56ddc7d3a30a0))
- **APIInvite:** add `expires_at` field and `with_expiration` param ([#127](https://github.com/discordjs/discord-api-types/issues/127)) ([82ca0ce](https://github.com/discordjs/discord-api-types/commit/82ca0ce5c44ad2e93b3c4875baa82720ea8dd221))
- **ApplicationCommandOptionType:** add `MENTIONABLE` (9) ([#126](https://github.com/discordjs/discord-api-types/issues/126)) ([91afb0b](https://github.com/discordjs/discord-api-types/commit/91afb0bb49015c02b6000c27d07e703011dc540d))
# [0.18.0](https://github.com/discordjs/discord-api-types/compare/0.16.0...0.18.0) (2021-04-18)
### Bug Fixes
- **APIInvite:** `channel` is not optional ([#123](https://github.com/discordjs/discord-api-types/issues/123)) ([abe0513](https://github.com/discordjs/discord-api-types/commit/abe05136fd169f483fe09a213259b4cbd526497b))
### Code Refactoring
- **Invite:** rename `InviteTargetUserType` to `InviteTargetType` ([#124](https://github.com/discordjs/discord-api-types/issues/124)) ([bc9ab45](https://github.com/discordjs/discord-api-types/commit/bc9ab4556ca8a7c8e4c7942c87fa322c91b733dc))
### BREAKING CHANGES
- **Invite:** `InviteTargetUserType` is renamed to `InviteTargetType`, to match the documentation.
- Reference: https://github.com/discord/discord-api-docs/pull/2690
# [0.17.0](https://github.com/discordjs/discord-api-types/compare/0.16.0...0.17.0) (2021-04-17)
### Bug Fixes

View File

@@ -1,3 +1,30 @@
## [0.18.1](https://github.com/discordjs/discord-api-types/compare/0.18.0...0.18.1) (2021-05-03)
### Bug Fixes
- **APIInvite:** `expires_at` is nullable ([#128](https://github.com/discordjs/discord-api-types/issues/128)) ([44b956a](https://github.com/discordjs/discord-api-types/commit/44b956ad858a457e7671ced38529b433b02efbde))
### Features
- add new interfaces for interaction-related structures ([#129](https://github.com/discordjs/discord-api-types/issues/129)) ([bd638b9](https://github.com/discordjs/discord-api-types/commit/bd638b97e5d26abd8a4f1edbd0f56ddc7d3a30a0))
- **APIInvite:** add `expires_at` field and `with_expiration` param ([#127](https://github.com/discordjs/discord-api-types/issues/127)) ([82ca0ce](https://github.com/discordjs/discord-api-types/commit/82ca0ce5c44ad2e93b3c4875baa82720ea8dd221))
- **ApplicationCommandOptionType:** add `MENTIONABLE` (9) ([#126](https://github.com/discordjs/discord-api-types/issues/126)) ([91afb0b](https://github.com/discordjs/discord-api-types/commit/91afb0bb49015c02b6000c27d07e703011dc540d))
# [0.18.0](https://github.com/discordjs/discord-api-types/compare/0.16.0...0.18.0) (2021-04-18)
### Bug Fixes
- **APIInvite:** `channel` is not optional ([#123](https://github.com/discordjs/discord-api-types/issues/123)) ([abe0513](https://github.com/discordjs/discord-api-types/commit/abe05136fd169f483fe09a213259b4cbd526497b))
### Code Refactoring
- **Invite:** rename `InviteTargetUserType` to `InviteTargetType` ([#124](https://github.com/discordjs/discord-api-types/issues/124)) ([bc9ab45](https://github.com/discordjs/discord-api-types/commit/bc9ab4556ca8a7c8e4c7942c87fa322c91b733dc))
### BREAKING CHANGES
- **Invite:** `InviteTargetUserType` is renamed to `InviteTargetType`, to match the documentation.
- Reference: https://github.com/discord/discord-api-docs/pull/2690
# [0.17.0](https://github.com/discordjs/discord-api-types/compare/0.16.0...0.17.0) (2021-04-17)
### Bug Fixes

View File

@@ -39,7 +39,8 @@ interface APIApplicationCommandOptionBase {
| ApplicationCommandOptionType.BOOLEAN
| ApplicationCommandOptionType.USER
| ApplicationCommandOptionType.CHANNEL
| ApplicationCommandOptionType.ROLE;
| ApplicationCommandOptionType.ROLE
| ApplicationCommandOptionType.MENTIONABLE;
name: string;
description: string;
default?: boolean;
@@ -87,6 +88,7 @@ export enum ApplicationCommandOptionType {
USER,
CHANNEL,
ROLE,
MENTIONABLE,
}
/**
@@ -131,6 +133,14 @@ export interface APIBaseInteraction {
version: 1;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionGuildMember extends APIGuildMember {
permissions: Permissions;
user: APIUser;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction
*/
@@ -144,7 +154,7 @@ export interface APIGuildInteraction extends APIBaseInteraction {
/**
* Guild member data for the invoking user, including permissions
*/
member: APIGuildMember & { permissions: Permissions; user: APIUser };
member: APIInteractionGuildMember;
channel_id: Snowflake;
}
@@ -243,6 +253,20 @@ export enum ApplicationCommandPermissionType {
USER,
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata
*/
@@ -253,8 +277,8 @@ export interface APIApplicationCommandInteractionData {
resolved?: {
users?: Record<string, APIUser>;
roles?: Record<string, APIRole>;
members?: Record<string, Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> & { permissions: Permissions }>;
channels?: Record<string, Required<APIPartialChannel> & { permissions: Permissions }>;
members?: Record<string, APIInteractionDataResolvedGuildMember>;
channels?: Record<string, APIInteractionDataResolvedChannel>;
};
}
@@ -283,6 +307,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionRole
| ApplicationCommandInteractionDataOptionChannel
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionBoolean;
@@ -306,6 +331,11 @@ export type ApplicationCommandInteractionDataOptionUser = InteractionDataOptionB
Snowflake
>;
export type ApplicationCommandInteractionDataOptionMentionable = InteractionDataOptionBase<
ApplicationCommandOptionType.MENTIONABLE,
Snowflake
>;
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
ApplicationCommandOptionType.INTEGER,
number

View File

@@ -59,6 +59,10 @@ export interface APIInvite {
* Approximate count of total members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
*/
approximate_member_count?: number;
/**
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
*/
expires_at?: string | null;
}
/**

View File

@@ -8,6 +8,10 @@ export interface RESTGetAPIInviteQuery {
* Whether the invite should contain approximate member counts
*/
with_counts?: boolean;
/**
* Whether the invite should contain the expiration date
*/
with_expiration?: boolean;
}
export type RESTGetAPIInviteResult = APIInvite;

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "discord-api-types",
"version": "0.17.0",
"version": "0.18.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.17.0",
"version": "0.18.1",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.13.15",

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.17.0",
"version": "0.18.1",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"main": "./v8.js",
"module": "./v8.mjs",

View File

@@ -39,7 +39,8 @@ interface APIApplicationCommandOptionBase {
| ApplicationCommandOptionType.BOOLEAN
| ApplicationCommandOptionType.USER
| ApplicationCommandOptionType.CHANNEL
| ApplicationCommandOptionType.ROLE;
| ApplicationCommandOptionType.ROLE
| ApplicationCommandOptionType.MENTIONABLE;
name: string;
description: string;
default?: boolean;
@@ -87,6 +88,7 @@ export const enum ApplicationCommandOptionType {
USER,
CHANNEL,
ROLE,
MENTIONABLE,
}
/**
@@ -131,6 +133,14 @@ export interface APIBaseInteraction {
version: 1;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionGuildMember extends APIGuildMember {
permissions: Permissions;
user: APIUser;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction
*/
@@ -144,7 +154,7 @@ export interface APIGuildInteraction extends APIBaseInteraction {
/**
* Guild member data for the invoking user, including permissions
*/
member: APIGuildMember & { permissions: Permissions; user: APIUser };
member: APIInteractionGuildMember;
channel_id: Snowflake;
}
@@ -243,6 +253,20 @@ export const enum ApplicationCommandPermissionType {
USER,
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata
*/
@@ -253,8 +277,8 @@ export interface APIApplicationCommandInteractionData {
resolved?: {
users?: Record<string, APIUser>;
roles?: Record<string, APIRole>;
members?: Record<string, Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> & { permissions: Permissions }>;
channels?: Record<string, Required<APIPartialChannel> & { permissions: Permissions }>;
members?: Record<string, APIInteractionDataResolvedGuildMember>;
channels?: Record<string, APIInteractionDataResolvedChannel>;
};
}
@@ -283,6 +307,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
| ApplicationCommandInteractionDataOptionRole
| ApplicationCommandInteractionDataOptionChannel
| ApplicationCommandInteractionDataOptionUser
| ApplicationCommandInteractionDataOptionMentionable
| ApplicationCommandInteractionDataOptionInteger
| ApplicationCommandInteractionDataOptionBoolean;
@@ -306,6 +331,11 @@ export type ApplicationCommandInteractionDataOptionUser = InteractionDataOptionB
Snowflake
>;
export type ApplicationCommandInteractionDataOptionMentionable = InteractionDataOptionBase<
ApplicationCommandOptionType.MENTIONABLE,
Snowflake
>;
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
ApplicationCommandOptionType.INTEGER,
number

View File

@@ -59,6 +59,10 @@ export interface APIInvite {
* Approximate count of total members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
*/
approximate_member_count?: number;
/**
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
*/
expires_at?: string | null;
}
/**

View File

@@ -8,6 +8,10 @@ export interface RESTGetAPIInviteQuery {
* Whether the invite should contain approximate member counts
*/
with_counts?: boolean;
/**
* Whether the invite should contain the expiration date
*/
with_expiration?: boolean;
}
export type RESTGetAPIInviteResult = APIInvite;