Compare commits

...

11 Commits
0.7.0 ... 0.9.1

Author SHA1 Message Date
Vlad Frangu
60c38fd32c chore: add missing voice op code; release 0.9.1 (#42) 2020-11-22 21:18:12 +02:00
Vlad Frangu
e196e65254 chore: release 0.9.0 (#41) 2020-11-22 20:42:55 +02:00
Advaith
21b9ae4aaf feat(Message): reply updates (#34)
* feat(allowedmentions): replied_user

* feat(message): message_reference channel_id is now optional

* fix: make message_id required when sending

* chore: export APIMessageReferenceSend
2020-11-21 16:22:32 +02:00
Advaith
39ea1f4429 feat(Message): Stickers (#32)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2020-11-21 16:19:13 +02:00
Vlad Frangu
fde45f9235 chore: rename INLINE_REPLY to REPLY (#40) 2020-11-17 13:37:25 +02:00
Vlad Frangu
2ee557a598 chore: remove RESTGetAPIGuildIntegrationQuery (per Discord) (#38) 2020-11-04 11:38:45 +02:00
Vlad Frangu
fed4749dd4 chore: release 0.8.0 (#37) 2020-11-03 18:55:27 +02:00
Souji
666a0c7152 fix: webhookPlatform route (#36) 2020-11-03 18:29:18 +02:00
Souji
e40530599e chore: update API import to use v8 in readme (#35) 2020-11-03 16:48:42 +02:00
Vlad Frangu
7992fab135 chore: fix mistypes (literally) for inline replies (#33) 2020-10-19 11:08:43 +03:00
Jan
61db1eee25 fix(GatewayPresence): correct type for sent activity objects (#30) 2020-10-18 23:46:29 +03:00
10 changed files with 47 additions and 19 deletions

View File

@@ -61,10 +61,10 @@ import { APIUser } from 'discord-api-types';
You should instead consider adding the API version you want to target by appending `/v*`, where the `*` represents the API version.
```js
const { APIUser } = require('discord-api-types/v6');
const { APIUser } = require('discord-api-types/v8');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v6';
import { APIUser } from 'discord-api-types/v8';
```

View File

@@ -92,6 +92,8 @@ export enum RESTJSONErrorCodes {
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
InvalidStickerSent = 50081,
TwoFactorAuthenticationIsRequired = 60003,
ReactionWasBlocked = 90001,

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.7.0",
"version": "0.9.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.7.0",
"version": "0.9.1",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"main": "default/index.js",
"scripts": {

View File

@@ -74,7 +74,8 @@ export enum VoiceOPCodes {
Hello,
Resumed,
ClientDisconnect = 13,
ClientConnect = 12,
ClientDisconnect,
}
/**
@@ -664,11 +665,16 @@ export interface GatewayUpdatePresence {
*/
export interface GatewayPresenceUpdateData {
since: number | null;
activities: GatewayActivity[] | null;
activities: GatewayActivityUpdateData[] | null;
status: PresenceUpdateStatus;
afk: boolean;
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
// #endregion Sendable Payloads
// #region Shared

View File

@@ -79,6 +79,7 @@ export interface APIMessage {
message_reference?: APIMessageReference;
flags?: MessageFlags;
referenced_message?: APIMessage | null;
stickers?: APISticker[];
}
/**
@@ -102,7 +103,7 @@ export enum MessageType {
GUILD_DISCOVERY_REQUALIFIED,
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
INLINE_REPLY,
REPLY = 19,
}
/**
@@ -129,7 +130,7 @@ export interface APIMessageApplication {
*/
export interface APIMessageReference {
message_id?: string;
channel_id: string;
channel_id?: string;
guild_id?: string;
}
@@ -154,6 +155,29 @@ export enum MessageFlags {
URGENT = 1 << 4,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
*/
export interface APISticker {
id: string;
pack_id: string;
name: string;
description: string;
tags?: string;
asset: string;
preview_asset: string | null;
format_type: StickerFormatType;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
*/
export enum StickerFormatType {
PNG = 1,
APNG,
LOTTIE,
}
/**
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
*/

View File

@@ -56,7 +56,7 @@ export enum PresenceUpdateStatus {
export type GatewayPresenceClientStatus = Partial<Record<'desktop' | 'mobile' | 'web', PresenceUpdateStatus>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
*/
export interface GatewayActivity {
name: string;

View File

@@ -31,6 +31,7 @@ export interface APIAllowedMentionsSend {
parse?: AllowedMentionsTypes[];
roles?: string[];
users?: string[];
replied_user?: boolean;
}
// #endregion TypeDefs
@@ -66,6 +67,8 @@ export interface RESTGetAPIChannelMessagesQuery {
export type RESTGetAPIChannelMessagesResult = APIMessage[];
export type APIMessageReferenceSend = APIMessageReference & Required<Pick<APIMessageReference, 'message_id'>>;
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
@@ -75,7 +78,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
message_reference?: APIMessageReferenceSend;
}
/**
@@ -98,7 +101,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
message_reference?: APIMessageReferenceSend;
/**
* The file contents
*/

View File

@@ -308,13 +308,6 @@ export type RESTGetAPIGuildVoiceRegionsResult = APIVoiceRegion[];
*/
export type RESTGetAPIGuildInvitesResult = APIInvite[];
/**
* https://discord.com/developers/docs/resources/guild#get-guild-integrations
*/
export interface RESTGetAPIGuildIntegrationsQuery {
include_applications?: boolean;
}
export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
/**

View File

@@ -484,7 +484,7 @@ export const Routes = {
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
*/
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
return `/${webhookID}/${webhookToken}/${platform}`;
return `/webhooks/${webhookID}/${webhookToken}/${platform}`;
},
/**