mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-29 23:00:08 +00:00
chore: move to eslint-config-marine
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": ["@skyra", "plugin:prettier/recommended"],
|
||||
"extends": "marine/prettier/node",
|
||||
"plugins": ["import"],
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
@@ -14,18 +14,6 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"prettier/prettier": [
|
||||
2,
|
||||
{
|
||||
"printWidth": 120,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf",
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/naming-convention": 0,
|
||||
"@typescript-eslint/indent": 0
|
||||
"@typescript-eslint/naming-convention": 0
|
||||
}
|
||||
}
|
||||
|
||||
190
common/index.ts
190
common/index.ts
@@ -2,141 +2,141 @@
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
||||
*/
|
||||
export enum RESTJSONErrorCodes {
|
||||
GeneralError,
|
||||
GeneralError,
|
||||
|
||||
UnknownAccount = 10001,
|
||||
UnknownApplication,
|
||||
UnknownChannel,
|
||||
UnknownGuild,
|
||||
UnknownIntegration,
|
||||
UnknownInvite,
|
||||
UnknownMember,
|
||||
UnknownMessage,
|
||||
UnknownPermissionOverwrite,
|
||||
UnknownProvider,
|
||||
UnknownRole,
|
||||
UnknownToken,
|
||||
UnknownUser,
|
||||
UnknownEmoji,
|
||||
UnknownWebook,
|
||||
UnknownAccount = 10001,
|
||||
UnknownApplication,
|
||||
UnknownChannel,
|
||||
UnknownGuild,
|
||||
UnknownIntegration,
|
||||
UnknownInvite,
|
||||
UnknownMember,
|
||||
UnknownMessage,
|
||||
UnknownPermissionOverwrite,
|
||||
UnknownProvider,
|
||||
UnknownRole,
|
||||
UnknownToken,
|
||||
UnknownUser,
|
||||
UnknownEmoji,
|
||||
UnknownWebook,
|
||||
|
||||
UnknownBan = 10026,
|
||||
UnknownSKU,
|
||||
UnknownStoreListing,
|
||||
UnknownEntitlement,
|
||||
UnknownBuild,
|
||||
UnknownLobby,
|
||||
UnknownBranch,
|
||||
UnknownBan = 10026,
|
||||
UnknownSKU,
|
||||
UnknownStoreListing,
|
||||
UnknownEntitlement,
|
||||
UnknownBuild,
|
||||
UnknownLobby,
|
||||
UnknownBranch,
|
||||
|
||||
UnknownRedistributable = 10036,
|
||||
UnknownRedistributable = 10036,
|
||||
|
||||
BotsCannotUseThisEndpoint = 20001,
|
||||
OnlyBotsCanUseThisEndpoint,
|
||||
BotsCannotUseThisEndpoint = 20001,
|
||||
OnlyBotsCanUseThisEndpoint,
|
||||
|
||||
MaximumNumberOfGuildsReached = 30001,
|
||||
MaximumNumberOfFriendsReached,
|
||||
MaximumNumberOfPinsReachedForTheChannel,
|
||||
MaximumNumberOfGuildsReached = 30001,
|
||||
MaximumNumberOfFriendsReached,
|
||||
MaximumNumberOfPinsReachedForTheChannel,
|
||||
|
||||
MaximumNumberOfGuildRolesReached = 30005,
|
||||
MaximumNumberOfGuildRolesReached = 30005,
|
||||
|
||||
MaximumNumberOfWebhooksReached = 30007,
|
||||
MaximumNumberOfWebhooksReached = 30007,
|
||||
|
||||
MaximumNumberOfReactionsReached = 30010,
|
||||
MaximumNumberOfReactionsReached = 30010,
|
||||
|
||||
MaximumNumberOfGuildChannelsReached = 30013,
|
||||
MaximumNumberOfGuildChannelsReached = 30013,
|
||||
|
||||
MaximumNumberOfAttachmentsInAMessageReached = 30015,
|
||||
MaximumNumberOfInvitesReached,
|
||||
MaximumNumberOfAttachmentsInAMessageReached = 30015,
|
||||
MaximumNumberOfInvitesReached,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
GuildWidgetDisabled,
|
||||
CannotEditMessageAuthoredByAnotherUser,
|
||||
CannotSendAnEmptyMessage,
|
||||
CannotSendMessagesToThisUser,
|
||||
CannotSendMessagesInVoiceChannel,
|
||||
ChannelVerificationLevelTooHighForYouToGainAccess,
|
||||
Oauth2ApplicationDoesNotHaveBot,
|
||||
Oauth2ApplicationLimitReached,
|
||||
InvalidOauth2State,
|
||||
MissingPermissions,
|
||||
InvalidToken,
|
||||
NoteWasTooLong,
|
||||
ProvidedTooFewOrTooManyMessagesToDelete,
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
GuildWidgetDisabled,
|
||||
CannotEditMessageAuthoredByAnotherUser,
|
||||
CannotSendAnEmptyMessage,
|
||||
CannotSendMessagesToThisUser,
|
||||
CannotSendMessagesInVoiceChannel,
|
||||
ChannelVerificationLevelTooHighForYouToGainAccess,
|
||||
Oauth2ApplicationDoesNotHaveBot,
|
||||
Oauth2ApplicationLimitReached,
|
||||
InvalidOauth2State,
|
||||
MissingPermissions,
|
||||
InvalidToken,
|
||||
NoteWasTooLong,
|
||||
ProvidedTooFewOrTooManyMessagesToDelete,
|
||||
|
||||
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
|
||||
InviteCodeInvalidOrTaken,
|
||||
CannotExecuteActionOnSystemMessage,
|
||||
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
|
||||
InviteCodeInvalidOrTaken,
|
||||
CannotExecuteActionOnSystemMessage,
|
||||
|
||||
CannotExecuteActionOnThisChannelType = 50024,
|
||||
InvalidOauth2AccessToken,
|
||||
CannotExecuteActionOnThisChannelType = 50024,
|
||||
InvalidOauth2AccessToken,
|
||||
|
||||
InvalidRecipients = 50033,
|
||||
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
|
||||
InvalidFormBodyOrContentType,
|
||||
InviteAcceptedToGuildWithoutTheBotBeingIn,
|
||||
InvalidRecipients = 50033,
|
||||
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
|
||||
InvalidFormBodyOrContentType,
|
||||
InviteAcceptedToGuildWithoutTheBotBeingIn,
|
||||
|
||||
InvalidAPIVersion = 50041,
|
||||
InvalidAPIVersion = 50041,
|
||||
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
APIResourceOverloaded = 130000,
|
||||
APIResourceOverloaded = 130000,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export enum RPCErrorCodes {
|
||||
UnknownError = 1000,
|
||||
UnknownError = 1000,
|
||||
|
||||
InvalidPayload = 4000,
|
||||
InvalidPayload = 4000,
|
||||
|
||||
InvalidCommand = 4002,
|
||||
InvalidGuild,
|
||||
InvalidEvent,
|
||||
InvalidChannel,
|
||||
InvalidPermissions,
|
||||
InvalidClientID,
|
||||
InvalidOrigin,
|
||||
InvalidToken,
|
||||
InvalidUser,
|
||||
InvalidCommand = 4002,
|
||||
InvalidGuild,
|
||||
InvalidEvent,
|
||||
InvalidChannel,
|
||||
InvalidPermissions,
|
||||
InvalidClientID,
|
||||
InvalidOrigin,
|
||||
InvalidToken,
|
||||
InvalidUser,
|
||||
|
||||
Oauth2Error = 5000,
|
||||
SelectChannelTimedOut,
|
||||
GetGuildTimedOut,
|
||||
SelectVoiceForceRequired,
|
||||
CaptureShortcutAlreadyListening,
|
||||
Oauth2Error = 5000,
|
||||
SelectChannelTimedOut,
|
||||
GetGuildTimedOut,
|
||||
SelectVoiceForceRequired,
|
||||
CaptureShortcutAlreadyListening,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
|
||||
*/
|
||||
export enum RPCCloseEventCodes {
|
||||
InvalidClientID = 4000,
|
||||
InvalidOrigin,
|
||||
RateLimited,
|
||||
TokenRevoked,
|
||||
InvalidVersion,
|
||||
InvalidEncoding,
|
||||
InvalidClientID = 4000,
|
||||
InvalidOrigin,
|
||||
RateLimited,
|
||||
TokenRevoked,
|
||||
InvalidVersion,
|
||||
InvalidEncoding,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
*/
|
||||
export interface GatewayConnectQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^9.1.2",
|
||||
"@commitlint/config-angular": "^9.1.2",
|
||||
"@skyra/eslint-config": "^5.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
||||
"@typescript-eslint/parser": "^3.9.1",
|
||||
"eslint": "^7.7.0",
|
||||
"eslint-config-marine": "^7.2.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
@@ -19,365 +19,365 @@ import type { APIWebhook } from './webhook';
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
webhooks: APIWebhook[];
|
||||
users: APIUser[];
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
integrations: APIGuildIntegration[];
|
||||
webhooks: APIWebhook[];
|
||||
users: APIUser[];
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
target_id: string | null;
|
||||
changes?: APIAuditLogChange[];
|
||||
user_id: string | null;
|
||||
id: string;
|
||||
action_type: AuditLogEvent;
|
||||
options?: APIAuditLogOptions;
|
||||
reason?: string;
|
||||
target_id: string | null;
|
||||
changes?: APIAuditLogChange[];
|
||||
user_id: string | null;
|
||||
id: string;
|
||||
action_type: AuditLogEvent;
|
||||
options?: APIAuditLogOptions;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
*/
|
||||
export enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
type: AuditLogOptionsType;
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
type: AuditLogOptionsType;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "role"**
|
||||
*/
|
||||
role_name?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "role"**
|
||||
*/
|
||||
role_name?: string;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export interface APIAuditLogChange {
|
||||
new_value?: APIAuditLogChangeKey;
|
||||
old_value?: APIAuditLogChangeKey;
|
||||
key: string;
|
||||
new_value?: APIAuditLogChangeKey;
|
||||
old_value?: APIAuditLogChangeKey;
|
||||
key: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key
|
||||
*/
|
||||
export interface APIAuditLogChangeKey {
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
icon_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
splash_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
owner_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
region?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
mfa_level?: GuildMFALevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
vanity_url_code?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$add?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$remove?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
prune_delete_days?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_enabled?: boolean;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
system_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
icon_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
splash_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
owner_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
region?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
mfa_level?: GuildMFALevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
vanity_url_code?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$add?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$remove?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
prune_delete_days?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_enabled?: boolean;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
system_channel_id?: string;
|
||||
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
topic?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
application_id?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
topic?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
application_id?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
hoist?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
mentionable?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
allow_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
deny_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
hoist?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
mentionable?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
allow_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
deny_new?: string;
|
||||
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
channel_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
inviter_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_age?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
temporary?: boolean;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
channel_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
inviter_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_age?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
temporary?: boolean;
|
||||
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
deaf?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
mute?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
nick?: string;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
avatar_hash?: string;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
deaf?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
mute?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
nick?: string;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
avatar_hash?: string;
|
||||
|
||||
/**
|
||||
* The ID of the changed entry
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The type of the changed entity
|
||||
*/
|
||||
type?: ChannelType | string;
|
||||
/**
|
||||
* The ID of the changed entry
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The type of the changed entity
|
||||
*/
|
||||
type?: ChannelType | string;
|
||||
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
enable_emoticons?: boolean;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_behavior?: IntegrationExpireBehavior;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_grace_period?: number;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
enable_emoticons?: boolean;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_behavior?: IntegrationExpireBehavior;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_grace_period?: number;
|
||||
}
|
||||
|
||||
@@ -10,200 +10,200 @@ import type { APIUser } from './user';
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
id: string;
|
||||
type: ChannelType;
|
||||
name?: string;
|
||||
id: string;
|
||||
type: ChannelType;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
guild_id?: string;
|
||||
position: number;
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
name?: string;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean;
|
||||
last_message_id?: string | null;
|
||||
bitrate?: number;
|
||||
user_limit?: number;
|
||||
rate_limit_per_user?: number;
|
||||
recipients?: APIUser[];
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
application_id?: string;
|
||||
parent_id?: string | null;
|
||||
last_pin_timestamp?: string | null;
|
||||
guild_id?: string;
|
||||
position: number;
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
name?: string;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean;
|
||||
last_message_id?: string | null;
|
||||
bitrate?: number;
|
||||
user_limit?: number;
|
||||
rate_limit_per_user?: number;
|
||||
recipients?: APIUser[];
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
application_id?: string;
|
||||
parent_id?: string | null;
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
export enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
DM,
|
||||
GUILD_VOICE,
|
||||
GROUP_DM,
|
||||
GUILD_CATEGORY,
|
||||
GUILD_NEWS,
|
||||
GUILD_STORE,
|
||||
GUILD_TEXT = 0,
|
||||
DM,
|
||||
GUILD_VOICE,
|
||||
GROUP_DM,
|
||||
GUILD_CATEGORY,
|
||||
GUILD_NEWS,
|
||||
GUILD_STORE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
*/
|
||||
export interface APIMessage {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
author: APIUser;
|
||||
member?: APIGuildMember;
|
||||
content: string;
|
||||
timestamp: string;
|
||||
edited_timestamp: string | null;
|
||||
tts: boolean;
|
||||
mention_everyone: boolean;
|
||||
mentions: APIUser & { member?: Omit<APIGuildMember, 'user'> };
|
||||
mention_roles: string[];
|
||||
mention_channels?: APIChannelMention[];
|
||||
attachments: APIAttachment[];
|
||||
embeds: APIEmbed[];
|
||||
reactions?: APIReaction[];
|
||||
nonce?: string | number;
|
||||
pinned: boolean;
|
||||
webhook_id?: string;
|
||||
type: MessageType;
|
||||
activity?: APIMessageActivity;
|
||||
application?: APIMessageApplication;
|
||||
message_reference?: APIMessageReference;
|
||||
flags?: MessageFlags;
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
author: APIUser;
|
||||
member?: APIGuildMember;
|
||||
content: string;
|
||||
timestamp: string;
|
||||
edited_timestamp: string | null;
|
||||
tts: boolean;
|
||||
mention_everyone: boolean;
|
||||
mentions: APIUser & { member?: Omit<APIGuildMember, 'user'> };
|
||||
mention_roles: string[];
|
||||
mention_channels?: APIChannelMention[];
|
||||
attachments: APIAttachment[];
|
||||
embeds: APIEmbed[];
|
||||
reactions?: APIReaction[];
|
||||
nonce?: string | number;
|
||||
pinned: boolean;
|
||||
webhook_id?: string;
|
||||
type: MessageType;
|
||||
activity?: APIMessageActivity;
|
||||
application?: APIMessageApplication;
|
||||
message_reference?: APIMessageReference;
|
||||
flags?: MessageFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
export enum MessageType {
|
||||
DEFAULT = 0,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
DEFAULT = 0,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
type: MessageActivityType;
|
||||
party_id?: string;
|
||||
type: MessageActivityType;
|
||||
party_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
*/
|
||||
export interface APIMessageApplication {
|
||||
id: string;
|
||||
cover_image?: string;
|
||||
description: string;
|
||||
icon: string | null;
|
||||
name: string;
|
||||
id: string;
|
||||
cover_image?: string;
|
||||
description: string;
|
||||
icon: string | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
message_id?: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
message_id?: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
export enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5,
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
export enum MessageFlags {
|
||||
CROSSPOSTED = 1 << 0,
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
URGENT = 1 << 4,
|
||||
CROSSPOSTED = 1 << 0,
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
URGENT = 1 << 4,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
*/
|
||||
export interface APIReaction {
|
||||
count: number;
|
||||
me: boolean;
|
||||
emoji: APIPartialEmoji;
|
||||
count: number;
|
||||
me: boolean;
|
||||
emoji: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow: number;
|
||||
allow_new: string;
|
||||
/**
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny: number;
|
||||
deny_new: string;
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow: number;
|
||||
allow_new: string;
|
||||
/**
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny: number;
|
||||
deny_new: string;
|
||||
}
|
||||
|
||||
export enum OverwriteType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
title?: string;
|
||||
/**
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
type?: EmbedType;
|
||||
description?: string;
|
||||
url?: string;
|
||||
timestamp?: string;
|
||||
color?: number;
|
||||
footer?: APIEmbedFooter;
|
||||
image?: APIEmbedImage;
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
video?: APIEmbedVideo;
|
||||
provider?: APIEmbedProvider;
|
||||
author?: APIEmbedAuthor;
|
||||
fields?: APIEmbedField[];
|
||||
title?: string;
|
||||
/**
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
type?: EmbedType;
|
||||
description?: string;
|
||||
url?: string;
|
||||
timestamp?: string;
|
||||
color?: number;
|
||||
footer?: APIEmbedFooter;
|
||||
image?: APIEmbedImage;
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
video?: APIEmbedVideo;
|
||||
provider?: APIEmbedProvider;
|
||||
author?: APIEmbedAuthor;
|
||||
fields?: APIEmbedField[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,103 +211,103 @@ export interface APIEmbed {
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
export enum EmbedType {
|
||||
Rich = 'rich',
|
||||
Image = 'image',
|
||||
Video = 'video',
|
||||
GifV = 'gifv',
|
||||
Article = 'article',
|
||||
Link = 'link',
|
||||
Rich = 'rich',
|
||||
Image = 'image',
|
||||
Video = 'video',
|
||||
GifV = 'gifv',
|
||||
Article = 'article',
|
||||
Link = 'link',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
name?: string;
|
||||
url?: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
name?: string;
|
||||
url?: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
text: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
text: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
name: string;
|
||||
value: string;
|
||||
inline?: boolean;
|
||||
name: string;
|
||||
value: string;
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
id: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
url: string;
|
||||
proxy_url: string;
|
||||
height: number | null;
|
||||
width: number | null;
|
||||
id: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
url: string;
|
||||
proxy_url: string;
|
||||
height: number | null;
|
||||
width: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
id: string;
|
||||
guild_id: string;
|
||||
type: ChannelType;
|
||||
name: string;
|
||||
id: string;
|
||||
guild_id: string;
|
||||
type: ChannelType;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface APIFollowedChannel {
|
||||
channel_id: string;
|
||||
webhook_id: string;
|
||||
channel_id: string;
|
||||
webhook_id: string;
|
||||
}
|
||||
|
||||
@@ -8,18 +8,18 @@ import type { APIUser } from './user';
|
||||
* Not documented but mentioned
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
animated?: boolean;
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
|
||||
*/
|
||||
export interface APIEmoji extends APIPartialEmoji {
|
||||
roles?: string[];
|
||||
user?: APIUser;
|
||||
require_colons?: boolean;
|
||||
managed?: boolean;
|
||||
available?: boolean;
|
||||
roles?: string[];
|
||||
user?: APIUser;
|
||||
require_colons?: boolean;
|
||||
managed?: boolean;
|
||||
available?: boolean;
|
||||
}
|
||||
|
||||
@@ -13,252 +13,252 @@ import type { GatewayVoiceState } from './voice';
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
id: string;
|
||||
unavailable: boolean;
|
||||
id: string;
|
||||
unavailable: boolean;
|
||||
}
|
||||
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
banner?: string | null;
|
||||
description?: string | null;
|
||||
features?: GuildFeature[];
|
||||
verification_level?: GuildVerificationLevel;
|
||||
vanity_url_code?: string | null;
|
||||
unavailable?: boolean;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
banner?: string | null;
|
||||
description?: string | null;
|
||||
features?: GuildFeature[];
|
||||
verification_level?: GuildVerificationLevel;
|
||||
vanity_url_code?: string | null;
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
export interface APIGuild extends APIPartialGuild {
|
||||
discovery_splash: string | null;
|
||||
owner?: boolean;
|
||||
owner_id: string;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions?: number;
|
||||
permissions_new?: string;
|
||||
region: string;
|
||||
afk_channel_id: string | null;
|
||||
afk_timeout: number;
|
||||
/**
|
||||
* @deprecated Use `widget_enabled` instead
|
||||
*/
|
||||
embed_enabled?: boolean;
|
||||
/**
|
||||
* @deprecated Use `widget_channel_id` instead
|
||||
*/
|
||||
embed_channel_id?: string | null;
|
||||
verification_level: GuildVerificationLevel;
|
||||
default_message_notifications: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter: GuildExplicitContentFilter;
|
||||
roles: APIRole[];
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
mfa_level: GuildMFALevel;
|
||||
application_id: string | null;
|
||||
widget_enabled?: boolean;
|
||||
widget_channel_id?: string | null;
|
||||
system_channel_id: string | null;
|
||||
system_channel_flags: GuildSystemChannelFlags;
|
||||
rules_channel_id: string | null;
|
||||
joined_at?: string;
|
||||
large?: boolean;
|
||||
member_count?: number;
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
members?: APIGuildMember[];
|
||||
channels?: APIChannel[];
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
max_presences?: number | null;
|
||||
max_members?: number;
|
||||
vanity_url_code: string | null;
|
||||
description: string | null;
|
||||
banner: string | null;
|
||||
premium_tier: GuildPremiumTier;
|
||||
premium_subscription_count?: number;
|
||||
preferred_locale: string;
|
||||
public_updates_channel_id: string | null;
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
discovery_splash: string | null;
|
||||
owner?: boolean;
|
||||
owner_id: string;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions?: number;
|
||||
permissions_new?: string;
|
||||
region: string;
|
||||
afk_channel_id: string | null;
|
||||
afk_timeout: number;
|
||||
/**
|
||||
* @deprecated Use `widget_enabled` instead
|
||||
*/
|
||||
embed_enabled?: boolean;
|
||||
/**
|
||||
* @deprecated Use `widget_channel_id` instead
|
||||
*/
|
||||
embed_channel_id?: string | null;
|
||||
verification_level: GuildVerificationLevel;
|
||||
default_message_notifications: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter: GuildExplicitContentFilter;
|
||||
roles: APIRole[];
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
mfa_level: GuildMFALevel;
|
||||
application_id: string | null;
|
||||
widget_enabled?: boolean;
|
||||
widget_channel_id?: string | null;
|
||||
system_channel_id: string | null;
|
||||
system_channel_flags: GuildSystemChannelFlags;
|
||||
rules_channel_id: string | null;
|
||||
joined_at?: string;
|
||||
large?: boolean;
|
||||
member_count?: number;
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
members?: APIGuildMember[];
|
||||
channels?: APIChannel[];
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
max_presences?: number | null;
|
||||
max_members?: number;
|
||||
vanity_url_code: string | null;
|
||||
description: string | null;
|
||||
banner: string | null;
|
||||
premium_tier: GuildPremiumTier;
|
||||
premium_subscription_count?: number;
|
||||
preferred_locale: string;
|
||||
public_updates_channel_id: string | null;
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
export enum GuildDefaultMessageNotifications {
|
||||
ALL_MESSAGES,
|
||||
ONLY_MENTIONS,
|
||||
ALL_MESSAGES,
|
||||
ONLY_MENTIONS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
export enum GuildExplicitContentFilter {
|
||||
DISABLED,
|
||||
MEMBERS_WITHOUT_ROLES,
|
||||
ALL_MEMBERS,
|
||||
DISABLED,
|
||||
MEMBERS_WITHOUT_ROLES,
|
||||
ALL_MEMBERS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||
*/
|
||||
export enum GuildMFALevel {
|
||||
NONE,
|
||||
ELEVATED,
|
||||
NONE,
|
||||
ELEVATED,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
export enum GuildVerificationLevel {
|
||||
NONE,
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH,
|
||||
VERY_HIGH,
|
||||
NONE,
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH,
|
||||
VERY_HIGH,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
*/
|
||||
export enum GuildPremiumTier {
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
export enum GuildSystemChannelFlags {
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
INVITE_SPLASH = 'INVITE_SPLASH',
|
||||
VIP_REGIONS = 'VIP_REGIONS',
|
||||
VANITY_URL = 'VANITY_URL',
|
||||
VERIFIED = 'VERIFIED',
|
||||
PARTNERED = 'PARTNERED',
|
||||
COMMUNITY = 'COMMUNITY',
|
||||
COMMERCE = 'COMMERCE',
|
||||
NEWS = 'NEWS',
|
||||
DISCOVERABLE = 'DISCOVERABLE',
|
||||
FEATURABLE = 'FEATURABLE',
|
||||
ANIMATED_ICON = 'ANIMATED_ICON',
|
||||
BANNER = 'BANNER',
|
||||
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
|
||||
INVITE_SPLASH = 'INVITE_SPLASH',
|
||||
VIP_REGIONS = 'VIP_REGIONS',
|
||||
VANITY_URL = 'VANITY_URL',
|
||||
VERIFIED = 'VERIFIED',
|
||||
PARTNERED = 'PARTNERED',
|
||||
COMMUNITY = 'COMMUNITY',
|
||||
COMMERCE = 'COMMERCE',
|
||||
NEWS = 'NEWS',
|
||||
DISCOVERABLE = 'DISCOVERABLE',
|
||||
FEATURABLE = 'FEATURABLE',
|
||||
ANIMATED_ICON = 'ANIMATED_ICON',
|
||||
BANNER = 'BANNER',
|
||||
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||
*/
|
||||
export interface APIGuildPreview {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
discovery_splash: string | null;
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
approximate_member_count: number;
|
||||
approximate_presence_count: number;
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
discovery_splash: string | null;
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
approximate_member_count: number;
|
||||
approximate_presence_count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
enabled: boolean;
|
||||
channel_id: string | null;
|
||||
enabled: boolean;
|
||||
channel_id: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
user?: APIUser;
|
||||
nick: string | null;
|
||||
roles: string[];
|
||||
joined_at: string;
|
||||
premium_since?: string | null;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
user?: APIUser;
|
||||
nick: string | null;
|
||||
roles: string[];
|
||||
joined_at: string;
|
||||
premium_since?: string | null;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
export interface APIGuildIntegration {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
enabled: boolean;
|
||||
syncing: boolean;
|
||||
role_id: string;
|
||||
enable_emoticons?: boolean;
|
||||
expire_behavior: IntegrationExpireBehavior;
|
||||
expire_grace_period: number;
|
||||
user: APIUser;
|
||||
account: APIIntegrationAccount;
|
||||
synced_at: string;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
enabled: boolean;
|
||||
syncing: boolean;
|
||||
role_id: string;
|
||||
enable_emoticons?: boolean;
|
||||
expire_behavior: IntegrationExpireBehavior;
|
||||
expire_grace_period: number;
|
||||
user: APIUser;
|
||||
account: APIIntegrationAccount;
|
||||
synced_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
*/
|
||||
export enum IntegrationExpireBehavior {
|
||||
RemoveRole,
|
||||
Kick,
|
||||
RemoveRole,
|
||||
Kick,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-account-object
|
||||
*/
|
||||
export interface APIIntegrationAccount {
|
||||
id: string;
|
||||
name: string;
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#ban-object
|
||||
*/
|
||||
export interface APIBan {
|
||||
reason: string | null;
|
||||
user: APIUser;
|
||||
reason: string | null;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
|
||||
*/
|
||||
export enum GuildWidgetStyle {
|
||||
Shield = 'shield',
|
||||
Banner1 = 'banner1',
|
||||
Banner2 = 'banner2',
|
||||
Banner3 = 'banner3',
|
||||
Banner4 = 'banner4',
|
||||
Shield = 'shield',
|
||||
Banner1 = 'banner1',
|
||||
Banner2 = 'banner2',
|
||||
Banner3 = 'banner3',
|
||||
Banner4 = 'banner4',
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreen {
|
||||
description: string | null;
|
||||
welcome_channels: APIGuildWelcomeScreenChannel[];
|
||||
description: string | null;
|
||||
welcome_channels: APIGuildWelcomeScreenChannel[];
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreenChannel {
|
||||
channel_id: string;
|
||||
emoji_id: string | null;
|
||||
emoji_name: string | null;
|
||||
channel_id: string;
|
||||
emoji_id: string | null;
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
@@ -10,30 +10,30 @@ import type { APIUser } from './user';
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
*/
|
||||
export interface APIInvite {
|
||||
code: string;
|
||||
guild?: APIPartialGuild;
|
||||
channel?: Required<APIPartialChannel>;
|
||||
inviter?: APIUser;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
approximate_presence_count?: number;
|
||||
approximate_member_count?: number;
|
||||
code: string;
|
||||
guild?: APIPartialGuild;
|
||||
channel?: Required<APIPartialChannel>;
|
||||
inviter?: APIUser;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
approximate_presence_count?: number;
|
||||
approximate_member_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
export enum InviteTargetUserType {
|
||||
STREAM = 1,
|
||||
STREAM = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
|
||||
*/
|
||||
export interface APIExtendedInvite extends APIInvite {
|
||||
uses: number;
|
||||
max_uses: number;
|
||||
max_age: number;
|
||||
temporary: boolean;
|
||||
created_at: string;
|
||||
uses: number;
|
||||
max_uses: number;
|
||||
max_age: number;
|
||||
temporary: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
@@ -9,19 +9,19 @@ import type { APIUser } from './user';
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information-response-structure
|
||||
*/
|
||||
export interface APIApplication {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
rpc_origins?: string[];
|
||||
bot_public: boolean;
|
||||
bot_require_code_grant: boolean;
|
||||
owner: APIUser;
|
||||
summary: string;
|
||||
verify_key: string;
|
||||
team: APITeam | null;
|
||||
guild_id?: string;
|
||||
primary_sku_id?: string;
|
||||
slug?: string;
|
||||
cover_image?: string;
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
rpc_origins?: string[];
|
||||
bot_public: boolean;
|
||||
bot_require_code_grant: boolean;
|
||||
owner: APIUser;
|
||||
summary: string;
|
||||
verify_key: string;
|
||||
team: APITeam | null;
|
||||
guild_id?: string;
|
||||
primary_sku_id?: string;
|
||||
slug?: string;
|
||||
cover_image?: string;
|
||||
}
|
||||
|
||||
@@ -11,37 +11,37 @@
|
||||
* or modules that can replicate them in some way.
|
||||
*/
|
||||
export const PermissionFlagsBits = {
|
||||
CREATE_INSTANT_INVITE: 1n,
|
||||
KICK_MEMBERS: 2n,
|
||||
BAN_MEMBERS: 4n,
|
||||
ADMINISTRATOR: 8n,
|
||||
MANAGE_CHANNELS: 16n,
|
||||
MANAGE_GUILD: 32n,
|
||||
ADD_REACTIONS: 64n,
|
||||
VIEW_AUDIT_LOG: 128n,
|
||||
PRIORITY_SPEAKER: 256n,
|
||||
STREAM: 512n,
|
||||
VIEW_CHANNEL: 1024n,
|
||||
SEND_MESSAGES: 2048n,
|
||||
SEND_TTS_MESSAGES: 4096n,
|
||||
MANAGE_MESSAGES: 8192n,
|
||||
EMBED_LINKS: 16384n,
|
||||
ATTACH_FILES: 32768n,
|
||||
READ_MESSAGE_HISTORY: 65536n,
|
||||
MENTION_EVERYONE: 131072n,
|
||||
USE_EXTERNAL_EMOJIS: 262144n,
|
||||
VIEW_GUILD_INSIGHTS: 524288n,
|
||||
CONNECT: 1048576n,
|
||||
SPEAK: 2097152n,
|
||||
MUTE_MEMBERS: 4194304n,
|
||||
DEAFEN_MEMBERS: 8388608n,
|
||||
MOVE_MEMBERS: 16777216n,
|
||||
USE_VAD: 33554432n,
|
||||
CHANGE_NICKNAME: 67108864n,
|
||||
MANAGE_NICKNAMES: 134217728n,
|
||||
MANAGE_ROLES: 268435456n,
|
||||
MANAGE_WEBHOOKS: 536870912n,
|
||||
MANAGE_EMOJIS: 1073741824n,
|
||||
CREATE_INSTANT_INVITE: 1n,
|
||||
KICK_MEMBERS: 2n,
|
||||
BAN_MEMBERS: 4n,
|
||||
ADMINISTRATOR: 8n,
|
||||
MANAGE_CHANNELS: 16n,
|
||||
MANAGE_GUILD: 32n,
|
||||
ADD_REACTIONS: 64n,
|
||||
VIEW_AUDIT_LOG: 128n,
|
||||
PRIORITY_SPEAKER: 256n,
|
||||
STREAM: 512n,
|
||||
VIEW_CHANNEL: 1024n,
|
||||
SEND_MESSAGES: 2048n,
|
||||
SEND_TTS_MESSAGES: 4096n,
|
||||
MANAGE_MESSAGES: 8192n,
|
||||
EMBED_LINKS: 16384n,
|
||||
ATTACH_FILES: 32768n,
|
||||
READ_MESSAGE_HISTORY: 65536n,
|
||||
MENTION_EVERYONE: 131072n,
|
||||
USE_EXTERNAL_EMOJIS: 262144n,
|
||||
VIEW_GUILD_INSIGHTS: 524288n,
|
||||
CONNECT: 1048576n,
|
||||
SPEAK: 2097152n,
|
||||
MUTE_MEMBERS: 4194304n,
|
||||
DEAFEN_MEMBERS: 8388608n,
|
||||
MOVE_MEMBERS: 16777216n,
|
||||
USE_VAD: 33554432n,
|
||||
CHANGE_NICKNAME: 67108864n,
|
||||
MANAGE_NICKNAMES: 134217728n,
|
||||
MANAGE_ROLES: 268435456n,
|
||||
MANAGE_WEBHOOKS: 536870912n,
|
||||
MANAGE_EMOJIS: 1073741824n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -54,23 +54,23 @@ Object.freeze(PermissionFlagsBits);
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
export interface APIRole {
|
||||
id: string;
|
||||
name: string;
|
||||
color: number;
|
||||
hoist: boolean;
|
||||
position: number;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
managed: boolean;
|
||||
mentionable: boolean;
|
||||
tags?: APIRoleTags;
|
||||
id: string;
|
||||
name: string;
|
||||
color: number;
|
||||
hoist: boolean;
|
||||
position: number;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
managed: boolean;
|
||||
mentionable: boolean;
|
||||
tags?: APIRoleTags;
|
||||
}
|
||||
|
||||
export interface APIRoleTags {
|
||||
bot_id?: string;
|
||||
premium_subscriber?: null;
|
||||
integration_id?: string;
|
||||
bot_id?: string;
|
||||
premium_subscriber?: null;
|
||||
integration_id?: string;
|
||||
}
|
||||
|
||||
@@ -8,26 +8,26 @@ import type { APIUser } from './user';
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
*/
|
||||
export interface APITeam {
|
||||
id: string;
|
||||
icon: string | null;
|
||||
members: APITeamMember[];
|
||||
owner_user_id: string;
|
||||
id: string;
|
||||
icon: string | null;
|
||||
members: APITeamMember[];
|
||||
owner_user_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
membership_state: TeamMemberMembershipState;
|
||||
permissions: string[];
|
||||
team_id: string;
|
||||
user: APIUser;
|
||||
membership_state: TeamMemberMembershipState;
|
||||
permissions: string[];
|
||||
team_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
|
||||
*/
|
||||
export enum TeamMemberMembershipState {
|
||||
INVITED = 1,
|
||||
ACCEPTED,
|
||||
INVITED = 1,
|
||||
ACCEPTED,
|
||||
}
|
||||
|
||||
@@ -8,66 +8,66 @@ import type { APIGuildIntegration } from './guild';
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
export interface APIUser {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
bot?: boolean;
|
||||
system?: boolean;
|
||||
mfa_enabled?: boolean;
|
||||
locale?: string;
|
||||
verified?: boolean;
|
||||
email?: string | null;
|
||||
flags?: UserFlags;
|
||||
premium_type: UserPremiumType;
|
||||
public_flags?: UserFlags;
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
bot?: boolean;
|
||||
system?: boolean;
|
||||
mfa_enabled?: boolean;
|
||||
locale?: string;
|
||||
verified?: boolean;
|
||||
email?: string | null;
|
||||
flags?: UserFlags;
|
||||
premium_type: UserPremiumType;
|
||||
public_flags?: UserFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export enum UserFlags {
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
DiscordPartner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
VerifiedBotDeveloper = 1 << 17,
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
DiscordPartner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
VerifiedBotDeveloper = 1 << 17,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
*/
|
||||
export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#connection-object
|
||||
*/
|
||||
export interface APIConnection {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
revoked?: boolean;
|
||||
integrations?: Partial<APIGuildIntegration>[];
|
||||
verified: boolean;
|
||||
friend_sync: boolean;
|
||||
show_activity: boolean;
|
||||
visibility: ConnectionVisibility;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
revoked?: boolean;
|
||||
integrations?: Partial<APIGuildIntegration>[];
|
||||
verified: boolean;
|
||||
friend_sync: boolean;
|
||||
show_activity: boolean;
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
None,
|
||||
Everyone,
|
||||
None,
|
||||
Everyone,
|
||||
}
|
||||
|
||||
@@ -8,28 +8,28 @@ import type { APIGuildMember } from './guild';
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
guild_id?: string;
|
||||
channel_id: string | null;
|
||||
user_id: string;
|
||||
member?: APIGuildMember;
|
||||
session_id: string;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
self_deaf: boolean;
|
||||
self_mute: boolean;
|
||||
self_stream?: boolean;
|
||||
self_video: boolean;
|
||||
suppress: boolean;
|
||||
guild_id?: string;
|
||||
channel_id: string | null;
|
||||
user_id: string;
|
||||
member?: APIGuildMember;
|
||||
session_id: string;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
self_deaf: boolean;
|
||||
self_mute: boolean;
|
||||
self_stream?: boolean;
|
||||
self_video: boolean;
|
||||
suppress: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
export interface APIVoiceRegion {
|
||||
id: string;
|
||||
name: string;
|
||||
vip: boolean;
|
||||
optimal: boolean;
|
||||
deprecated: boolean;
|
||||
custom: boolean;
|
||||
id: string;
|
||||
name: string;
|
||||
vip: boolean;
|
||||
optimal: boolean;
|
||||
deprecated: boolean;
|
||||
custom: boolean;
|
||||
}
|
||||
|
||||
@@ -10,19 +10,19 @@ import type { APIUser } from './user';
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
*/
|
||||
export interface APIWebhook {
|
||||
id: string;
|
||||
type: WebhookType;
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
user?: APIUser;
|
||||
name: string | null;
|
||||
avatar: string | null;
|
||||
token?: string;
|
||||
source_guild?: APIPartialGuild;
|
||||
source_channel?: APIPartialChannel;
|
||||
id: string;
|
||||
type: WebhookType;
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
user?: APIUser;
|
||||
name: string | null;
|
||||
avatar: string | null;
|
||||
token?: string;
|
||||
source_guild?: APIPartialGuild;
|
||||
source_channel?: APIPartialChannel;
|
||||
}
|
||||
|
||||
export enum WebhookType {
|
||||
Incoming = 1,
|
||||
ChannelFollower,
|
||||
Incoming = 1,
|
||||
ChannelFollower,
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog';
|
||||
* https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
||||
*/
|
||||
export interface RESTGetAPIAuditLogQuery {
|
||||
user_id?: string;
|
||||
action_type?: AuditLogEvent;
|
||||
before?: string;
|
||||
limit?: number;
|
||||
user_id?: string;
|
||||
action_type?: AuditLogEvent;
|
||||
before?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIAuditLogResult = APIAuditLog;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import type {
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIFollowedChannel,
|
||||
APIInvite,
|
||||
APIMessage,
|
||||
APIOverwrite,
|
||||
APIUser,
|
||||
ChannelType,
|
||||
InviteTargetUserType,
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIFollowedChannel,
|
||||
APIInvite,
|
||||
APIMessage,
|
||||
APIOverwrite,
|
||||
APIUser,
|
||||
ChannelType,
|
||||
InviteTargetUserType,
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
} from '../payloads';
|
||||
|
||||
// #region TypeDefs
|
||||
@@ -18,28 +18,28 @@ import type {
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwriteSend {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
export enum AllowedMentionsTypes {
|
||||
Role = 'roles',
|
||||
User = 'users',
|
||||
Everyone = 'everyone',
|
||||
Role = 'roles',
|
||||
User = 'users',
|
||||
Everyone = 'everyone',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
|
||||
*/
|
||||
export interface APIAllowedMentionsSend {
|
||||
parse?: AllowedMentionsTypes[];
|
||||
roles?: string[];
|
||||
users?: string[];
|
||||
parse?: AllowedMentionsTypes[];
|
||||
roles?: string[];
|
||||
users?: string[];
|
||||
}
|
||||
|
||||
// #endregion TypeDefs
|
||||
@@ -48,15 +48,15 @@ export interface APIAllowedMentionsSend {
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
name?: string;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
position?: number | null;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean | null;
|
||||
rate_limit_per_user?: number | null;
|
||||
user_limit?: number | null;
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
parent_id?: string | null;
|
||||
name?: string;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
position?: number | null;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean | null;
|
||||
rate_limit_per_user?: number | null;
|
||||
user_limit?: number | null;
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelResult = APIChannel;
|
||||
@@ -67,10 +67,10 @@ export type RESTDeleteAPIChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessagesQuery {
|
||||
around?: string;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
around?: string;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
@@ -79,47 +79,47 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
};
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
@@ -131,9 +131,9 @@ export type RESTDeleteAPIChannelMessageResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessageReactionsResult = APIUser[];
|
||||
@@ -146,7 +146,7 @@ export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
|
||||
messages: string[];
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
@@ -155,9 +155,9 @@ export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export interface RESTPutAPIChannelPermissionsJSONBody {
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
type: OverwriteType;
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
type: OverwriteType;
|
||||
}
|
||||
|
||||
export type RESTPutAPIChannelPermissionsResult = never;
|
||||
@@ -169,12 +169,12 @@ export type RESTDeleteAPIChannelPermissionsResult = never;
|
||||
export type RESTGetAPIChannelInvitesResult = APIInvite[];
|
||||
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,8 +197,8 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
}
|
||||
|
||||
export type RESTPutAPIChannelRecipientResult = unknown;
|
||||
@@ -209,7 +209,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
|
||||
|
||||
export interface RESTPostAPIChannelFollowersJSONBody {
|
||||
webhook_channel_id: string;
|
||||
webhook_channel_id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
|
||||
|
||||
@@ -14,12 +14,12 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
name: string;
|
||||
/**
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
name: string;
|
||||
/**
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
@@ -28,8 +28,8 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
212
v6/rest/guild.ts
212
v6/rest/guild.ts
@@ -1,45 +1,45 @@
|
||||
import type {
|
||||
APIBan,
|
||||
APIChannel,
|
||||
APIGuild,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIGuildPreview,
|
||||
APIGuildWidget,
|
||||
APIInvite,
|
||||
APIRole,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildFeature,
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
IntegrationExpireBehavior,
|
||||
APIBan,
|
||||
APIChannel,
|
||||
APIGuild,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIGuildPreview,
|
||||
APIGuildWidget,
|
||||
APIInvite,
|
||||
APIRole,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildFeature,
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
IntegrationExpireBehavior,
|
||||
} from '../payloads';
|
||||
|
||||
export type APIGuildCreatePartialChannel = Partial<
|
||||
Pick<
|
||||
APIChannel,
|
||||
'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id'
|
||||
>
|
||||
Pick<
|
||||
APIChannel,
|
||||
'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id'
|
||||
>
|
||||
> &
|
||||
Required<Pick<APIChannel, 'name'>>;
|
||||
Required<Pick<APIChannel, 'name'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: string;
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildsResult = APIGuild;
|
||||
@@ -48,7 +48,7 @@ export type RESTPostAPIGuildsResult = APIGuild;
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildQuery {
|
||||
with_counts?: boolean;
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildResult = APIGuild;
|
||||
@@ -62,24 +62,24 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
name?: string;
|
||||
region?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
afk_channel_id?: string | null;
|
||||
afk_timeout?: number;
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
splash?: string | null;
|
||||
discovery_splash?: string | null;
|
||||
banner?: string | null;
|
||||
system_channel_id?: string | null;
|
||||
rules_channel_id?: string | null;
|
||||
public_updates_channel_id?: string | null;
|
||||
preferred_locale?: string;
|
||||
features?: GuildFeature[];
|
||||
description?: string | null;
|
||||
name?: string;
|
||||
region?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
afk_channel_id?: string | null;
|
||||
afk_timeout?: number;
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
splash?: string | null;
|
||||
discovery_splash?: string | null;
|
||||
banner?: string | null;
|
||||
system_channel_id?: string | null;
|
||||
rules_channel_id?: string | null;
|
||||
public_updates_channel_id?: string | null;
|
||||
preferred_locale?: string;
|
||||
features?: GuildFeature[];
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildResult = APIGuild;
|
||||
@@ -105,10 +105,10 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
}>;
|
||||
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
@@ -122,15 +122,15 @@ export type RESTGetAPIGuildMemberResult = APIGuildMember;
|
||||
* https://discord.com/developers/docs/resources/guild#list-guild-members
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersQuery {
|
||||
limit?: number;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
after?: string;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildMembersResult = APIGuildMember[];
|
||||
|
||||
export interface RESTGetAPIGuildMembersSearchQuery {
|
||||
query: string;
|
||||
limit?: number;
|
||||
query: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
@@ -139,11 +139,11 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
@@ -152,11 +152,11 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberResult = never;
|
||||
@@ -165,7 +165,7 @@ export type RESTPatchAPIGuildMemberResult = never;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
nick?: string | null;
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameResult = Required<RESTPatchAPICurrentGuildMemberNicknameJSONBody>;
|
||||
@@ -199,8 +199,8 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildBanResult = never;
|
||||
@@ -219,11 +219,11 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
@@ -232,8 +232,8 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position?: number;
|
||||
id: string;
|
||||
position?: number;
|
||||
}>;
|
||||
|
||||
export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
@@ -242,11 +242,11 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildRoleResult = APIRole;
|
||||
@@ -260,31 +260,31 @@ export type RESTDeleteAPIGuildRoleResult = never;
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountQuery {
|
||||
days?: number;
|
||||
/**
|
||||
* While this is typed as a string, it represents an array of
|
||||
* role IDs delimited by commas.
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||
*/
|
||||
include_roles?: string;
|
||||
days?: number;
|
||||
/**
|
||||
* While this is typed as a string, it represents an array of
|
||||
* role IDs delimited by commas.
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||
*/
|
||||
include_roles?: string;
|
||||
}
|
||||
|
||||
export interface RESTGetAPIGuildPruneCountResult {
|
||||
pruned: number;
|
||||
pruned: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
}
|
||||
|
||||
export interface RESTPostAPIGuildPruneResult {
|
||||
pruned: number | null;
|
||||
pruned: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,7 +301,7 @@ export type RESTGetAPIGuildInvitesResult = APIInvite[];
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
||||
*/
|
||||
export interface RESTGetAPIGuildIntegrationsQuery {
|
||||
include_applications?: boolean;
|
||||
include_applications?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
|
||||
@@ -310,8 +310,8 @@ export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-integration
|
||||
*/
|
||||
export interface RESTPostAPIGuildIntegrationJSONBody {
|
||||
type: string;
|
||||
id: string;
|
||||
type: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildIntegrationResult = never;
|
||||
@@ -320,9 +320,9 @@ export type RESTPostAPIGuildIntegrationResult = never;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-integration
|
||||
*/
|
||||
export interface RESTPatchAPIGuildIntegrationJSONBody {
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildIntegrationResult = never;
|
||||
@@ -353,15 +353,15 @@ export type RESTPatchAPIGuildWidgetResult = APIGuildWidget;
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
|
||||
*/
|
||||
export interface RESTGetAPIGuildVanityUrlResult {
|
||||
code: string | null;
|
||||
uses: number;
|
||||
code: string | null;
|
||||
uses: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
||||
*/
|
||||
export interface RESTGetAPIGuildWidgetImageQuery {
|
||||
style?: GuildWidgetStyle;
|
||||
style?: GuildWidgetStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
870
v6/rest/index.ts
870
v6/rest/index.ts
@@ -11,495 +11,495 @@ export * from './webhook';
|
||||
|
||||
export const APIVersion = '6';
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: string) {
|
||||
return `/guilds/${guildID}/audit-logs`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: string) {
|
||||
return `/guilds/${guildID}/audit-logs`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: string) {
|
||||
return `/channels/${channelID}/messages`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: string) {
|
||||
return `/channels/${channelID}/messages`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelCrosspost(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/message/${messageID}/crosspost`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelCrosspost(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/message/${messageID}/crosspost`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageSpecificReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageSpecificReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: string) {
|
||||
return `/channels/${channelID}/bulk-delete`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: string) {
|
||||
return `/channels/${channelID}/bulk-delete`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermissions(channelID: string, overwriteID: string) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermissions(channelID: string, overwriteID: string) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvite(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvite(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: string) {
|
||||
return `/channels/${channelID}/followers`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: string) {
|
||||
return `/channels/${channelID}/followers`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: string) {
|
||||
return `/channels/${channelID}/typing`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: string) {
|
||||
return `/channels/${channelID}/typing`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: string) {
|
||||
return `/channels/${channelID}/pins`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: string) {
|
||||
return `/channels/${channelID}/pins`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/pins/${messageID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/pins/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: string, userID: string) {
|
||||
return `/channels/${channelID}/recipients/${userID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: string, userID: string) {
|
||||
return `/channels/${channelID}/recipients/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: string) {
|
||||
return `/guilds/${guildID}/emojis`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: string) {
|
||||
return `/guilds/${guildID}/emojis`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: string, emojiID: string) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: string, emojiID: string) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds';
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds';
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: string) {
|
||||
return `/guilds/${guildID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: string) {
|
||||
return `/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: string) {
|
||||
return `/guilds/${guildID}/preview`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: string) {
|
||||
return `/guilds/${guildID}/preview`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: string) {
|
||||
return `/guilds/${guildID}/channels`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: string) {
|
||||
return `/guilds/${guildID}/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/members/${userID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/members/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: string) {
|
||||
return `/guilds/${guildID}/members`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: string) {
|
||||
return `/guilds/${guildID}/members`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: string) {
|
||||
return `/guilds/${guildID}/members/search`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: string) {
|
||||
return `/guilds/${guildID}/members/search`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: string) {
|
||||
return `/guilds/${guildID}/members/@me/nick`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: string) {
|
||||
return `/guilds/${guildID}/members/@me/nick`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: string, memberID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: string, memberID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: string) {
|
||||
return `/guilds/${guildID}/bans`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: string) {
|
||||
return `/guilds/${guildID}/bans`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/bans/${userID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/bans/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: string) {
|
||||
return `/guilds/${guildID}/roles`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: string) {
|
||||
return `/guilds/${guildID}/roles`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/roles/${roleID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: string) {
|
||||
return `/guilds/${guildID}/prune`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: string) {
|
||||
return `/guilds/${guildID}/prune`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: string) {
|
||||
return `/guilds/${guildID}/regions`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: string) {
|
||||
return `/guilds/${guildID}/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: string) {
|
||||
return `/guilds/${guildID}/invites`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: string) {
|
||||
return `/guilds/${guildID}/invites`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
* - POST `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: string) {
|
||||
return `/guilds/${guildID}/integrations`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
* - POST `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: string) {
|
||||
return `/guilds/${guildID}/integrations`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
|
||||
*/
|
||||
guildIntegrationSync(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
|
||||
*/
|
||||
guildIntegrationSync(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidget(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidget(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: string) {
|
||||
return `/guilds/${guildID}/vanity-url`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: string) {
|
||||
return `/guilds/${guildID}/vanity-url`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.png`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.png`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: string) {
|
||||
return `/users/@me/guilds/${guildID}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: string) {
|
||||
return `/users/@me/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhook(channelID: string) {
|
||||
return `/channels/${channelID}/webhooks`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhook(channelID: string) {
|
||||
return `/channels/${channelID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: string) {
|
||||
return `/guilds/${guildID}/webhooks`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: string) {
|
||||
return `/guilds/${guildID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*/
|
||||
webhook(webhookID: string, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*/
|
||||
webhook(webhookID: string, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/');
|
||||
},
|
||||
return parts.join('/');
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
*/
|
||||
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/${webhookID}/${webhookToken}/${platform}`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
*/
|
||||
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/${webhookID}/${webhookToken}/${platform}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me`;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me`;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { APIInvite } from '../payloads';
|
||||
* https://discord.com/developers/docs/resources/invite#get-invite
|
||||
*/
|
||||
export interface RESTGetAPIInviteQuery {
|
||||
with_counts?: boolean;
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
@@ -14,8 +14,8 @@ export type RESTGetAPIUserResult = APIUser;
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
@@ -24,22 +24,22 @@ export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
}
|
||||
|
||||
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
|
||||
@@ -53,7 +53,7 @@ export type RESTDeleteAPICurrentUserGuildResult = never;
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
|
||||
recipient_id: string;
|
||||
recipient_id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
|
||||
@@ -5,8 +5,8 @@ import type { APIEmbed, APIMessage, APIWebhook } from '../payloads';
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelWebhookResult = APIWebhook;
|
||||
@@ -35,9 +35,9 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIWebhookResult = APIWebhook;
|
||||
@@ -59,40 +59,40 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenQuery {
|
||||
wait?: boolean;
|
||||
wait?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPostAPIWebhookWithTokenResult = never;
|
||||
|
||||
17
yarn.lock
17
yarn.lock
@@ -171,11 +171,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-9.1.2.tgz#d05f66db03e3a3638a654e8badf2deb489eb220d"
|
||||
integrity sha512-r3fwVbVH+M8W0qYlBBZFsUwKe6NT5qvz+EmU7sr8VeN1cQ63z+3cfXyTo7WGGEMEgKiT0jboNAK3b1FZp8k9LQ==
|
||||
|
||||
"@skyra/eslint-config@^5.3.0":
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@skyra/eslint-config/-/eslint-config-5.3.0.tgz#9f4f49bea425d0aac6877fa42daec0c4fc00f0ad"
|
||||
integrity sha512-MO/JbDZjd5NvdS82pooOBiDHq3Njb54lo8XsMBYUM2vUxYAzpFcjZ2SIVnfj76MWZS9yQcvV+2MFLtTKaOuFOQ==
|
||||
|
||||
"@types/color-name@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
|
||||
@@ -714,6 +709,18 @@ escape-string-regexp@^1.0.5:
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
eslint-config-aqua@^7.3.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-aqua/-/eslint-config-aqua-7.3.0.tgz#b07a3cd98493a9f2a2b6b467b76289421f6f0d62"
|
||||
integrity sha512-rSOMrG5fpv/DtITtGKeOwTWYMeLiCaNLIsJlLABp2oeDs4qTaIE4Y3UdWc/10/C7Vuy/aNGiOidb/XAa6veFFg==
|
||||
|
||||
eslint-config-marine@^7.2.0:
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-marine/-/eslint-config-marine-7.2.0.tgz#ba17b2f7cfe31af78428b68a5f6029d226ea410c"
|
||||
integrity sha512-emIoQpexPl5Of4d/qZ+lf91JObvnJefGdsuNUQWH8p2E7iSSw8nQmOSocVdEUWjZoTzhf1z0x/UP4g9g6S2Kdw==
|
||||
dependencies:
|
||||
eslint-config-aqua "^7.3.0"
|
||||
|
||||
eslint-config-prettier@^6.11.0:
|
||||
version "6.11.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
|
||||
|
||||
Reference in New Issue
Block a user