mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fed4749dd4 | ||
|
|
666a0c7152 | ||
|
|
e40530599e | ||
|
|
7992fab135 | ||
|
|
61db1eee25 | ||
|
|
363d914934 | ||
|
|
91c63f05ca | ||
|
|
f058ed6aa1 | ||
|
|
0982610731 |
@@ -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';
|
||||
```
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.5.0",
|
||||
"version": "0.8.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.6.0",
|
||||
"version": "0.8.0",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "default/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -581,7 +581,7 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: number;
|
||||
d: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -605,7 +605,7 @@ export interface GatewayIdentify {
|
||||
large_threshold?: number;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: RawGatewayPresenceUpdate;
|
||||
presence?: GatewayPresenceUpdateData;
|
||||
guild_subscriptions?: boolean;
|
||||
intents: number;
|
||||
};
|
||||
@@ -664,11 +664,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
|
||||
|
||||
@@ -102,7 +102,7 @@ export enum MessageType {
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
INLINE_REPLY,
|
||||
INLINE_REPLY = 19,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import type { APIChannel } from './channel';
|
||||
import type { APIEmoji } from './emoji';
|
||||
import type { GatewayPresenceUpdate } from './gateway';
|
||||
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { GatewayVoiceState } from './voice';
|
||||
@@ -204,7 +204,8 @@ export interface APIGuildWidgetMember {
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
status: string;
|
||||
status: PresenceUpdateStatus;
|
||||
activity?: { name: string };
|
||||
avatar_url: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
message_reference?: Required<Omit<APIMessageReference, 'guild_id'>> & Pick<APIMessageReference, 'guild_id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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}`;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user