mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f52efabbb1 | ||
|
|
9074621085 | ||
|
|
8e2a5d2451 | ||
|
|
311b7a2eb9 | ||
|
|
4aa9646d05 | ||
|
|
d8435774d6 | ||
|
|
8f9370d259 | ||
|
|
0cd9b0debb | ||
|
|
4723d29c9e | ||
|
|
2a78a517d2 | ||
|
|
08cbcd74a8 | ||
|
|
9e68e0c9e0 | ||
|
|
590e0e4883 | ||
|
|
0d47c69ca8 |
135
.eslintplugin/index.ts
Normal file
135
.eslintplugin/index.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
import { AST_NODE_TYPES, ESLintUtils, TSESTree } from '@typescript-eslint/utils';
|
||||
import * as typescript from 'typescript';
|
||||
import * as tsutils from 'tsutils';
|
||||
|
||||
type Options = [
|
||||
{
|
||||
interfaceEndings: string[];
|
||||
},
|
||||
];
|
||||
|
||||
function shouldRun(eslNode: TSESTree.TSPropertySignature, interfaceEndings: string[]): boolean {
|
||||
// The first parent is the TSInterfaceBody, the second is the TSInterfaceDeclaration
|
||||
const interfaceNode = eslNode.parent?.parent;
|
||||
if (!(interfaceNode && 'id' in interfaceNode && interfaceNode.id?.type === AST_NODE_TYPES.Identifier)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { name } = interfaceNode.id;
|
||||
if (typeof name !== 'string') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return interfaceEndings.some((ending) => name.endsWith(ending));
|
||||
}
|
||||
|
||||
const schema = [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
interfaceEndings: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export = {
|
||||
rules: {
|
||||
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
|
||||
create: (context) => {
|
||||
const { interfaceEndings } = context.options[0];
|
||||
return {
|
||||
TSPropertySignature: (eslNode) => {
|
||||
if (!shouldRun(eslNode, interfaceEndings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (eslNode.optional) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parserServices = ESLintUtils.getParserServices(context);
|
||||
const checker = parserServices.program.getTypeChecker();
|
||||
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(eslNode);
|
||||
const type = checker.getApparentType(checker.getTypeAtLocation(tsNode));
|
||||
const unionParts = tsutils.unionTypeParts(type);
|
||||
|
||||
// If our prop is not optional, but has undefined in its union, we should report
|
||||
if (!unionParts.some((ty) => tsutils.isTypeFlagSet(ty, typescript.TypeFlags.Undefined))) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.report({
|
||||
node: eslNode,
|
||||
messageId: 'missingOptional',
|
||||
fix: (fixer) => fixer.insertTextAfter(eslNode.key, '?'),
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
meta: {
|
||||
fixable: 'code',
|
||||
messages: {
|
||||
missingOptional: 'When a property has `| undefined`, it should be marked as optional.',
|
||||
},
|
||||
type: 'problem',
|
||||
schema: schema,
|
||||
},
|
||||
defaultOptions: [{ interfaceEndings: [] }],
|
||||
}),
|
||||
'explicit-undefined-on-optional-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingUndefined'>({
|
||||
create: (context) => {
|
||||
const { interfaceEndings } = context.options[0];
|
||||
return {
|
||||
// This is done naively because type-checking the node will always include `| undefined`
|
||||
// due to it being optional. ideally, we'd have a way to get the type of the node disregarding
|
||||
// the optional flag, which would make this check a lot more trivial
|
||||
TSPropertySignature: (eslNode) => {
|
||||
if (!shouldRun(eslNode, interfaceEndings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If our prop is't optional or if it doesn't have a type annotation, we don't need to do anything
|
||||
if (!eslNode.optional || !eslNode.typeAnnotation) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { typeAnnotation } = eslNode.typeAnnotation;
|
||||
switch (typeAnnotation.type) {
|
||||
case AST_NODE_TYPES.TSUnionType: {
|
||||
if (typeAnnotation.types.some((t) => t.type === AST_NODE_TYPES.TSUndefinedKeyword)) {
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AST_NODE_TYPES.TSUndefinedKeyword: {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
context.report({
|
||||
node: eslNode,
|
||||
messageId: 'missingUndefined',
|
||||
fix: (fixer) => fixer.insertTextAfter(eslNode.typeAnnotation!, ' | undefined'),
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
meta: {
|
||||
fixable: 'code',
|
||||
messages: {
|
||||
missingUndefined: 'When a property is optional, explicitly include `undefined` in the union.',
|
||||
},
|
||||
type: 'suggestion',
|
||||
schema: schema,
|
||||
},
|
||||
defaultOptions: [{ interfaceEndings: [] }],
|
||||
}),
|
||||
},
|
||||
};
|
||||
20
.eslintplugin/tsconfig.json
Normal file
20
.eslintplugin/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"lib": ["esnext"],
|
||||
"module": "commonjs",
|
||||
"noUnusedParameters": true,
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"noUnusedLocals": true,
|
||||
"removeComments": false,
|
||||
"target": "ES2020",
|
||||
"importsNotUsedAsValues": "error",
|
||||
"strictNullChecks": true,
|
||||
"preserveConstEnums": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["./index.ts"]
|
||||
}
|
||||
@@ -4,5 +4,10 @@
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.eslint.json",
|
||||
"extraFileExtensions": [".mjs"]
|
||||
},
|
||||
"plugins": ["local"],
|
||||
"rules": {
|
||||
"local/explicitly-optional-undefined-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
|
||||
"local/explicit-undefined-on-optional-properties": ["error", { "interfaceEndings": ["JSONBody"] }]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
run: npm ci
|
||||
|
||||
- name: Install website dependencies
|
||||
run: pushd website && npm ci --ignore-scripts && popd
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
run: npm ci
|
||||
|
||||
- name: Publish release to npm
|
||||
run: npm publish
|
||||
|
||||
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,15 +1,25 @@
|
||||
node_modules/
|
||||
|
||||
# Custom ESLint rules
|
||||
.eslintplugin/*
|
||||
!.eslintplugin/index.ts
|
||||
!.eslintplugin/tsconfig.json
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
globals.*map
|
||||
globals.d.ts
|
||||
globals.mjs
|
||||
|
||||
./v*.js
|
||||
./v*.*map
|
||||
./v*.d.ts
|
||||
./v*.mjs
|
||||
v*.js
|
||||
v*.*map
|
||||
v*.d.ts
|
||||
v*.mjs
|
||||
|
||||
deno/**/*.js
|
||||
deno/**/*.map
|
||||
deno/**/*.d.ts
|
||||
deno/**/*.mjs
|
||||
|
||||
gateway/**/*.js
|
||||
gateway/**/*.map
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# Node modules
|
||||
node_modules/
|
||||
|
||||
@@ -11,3 +10,8 @@ website/versioned_docs/
|
||||
website/versions.json
|
||||
website/.docusaurus/
|
||||
website/build
|
||||
|
||||
# Don't format build outputs
|
||||
*.js
|
||||
*.d.ts
|
||||
*.mjs
|
||||
|
||||
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,3 +1,28 @@
|
||||
## [0.37.38](https://github.com/discordjs/discord-api-types/compare/0.37.37...0.37.38) (2023-04-10)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `channel` ([#741](https://github.com/discordjs/discord-api-types/issues/741)) ([311b7a2](https://github.com/discordjs/discord-api-types/commit/311b7a2eb9bdc6ad9d6ed7af2b7faf6f95631698))
|
||||
- **RESTJSONErrorCodes:** add error `50163` ([#725](https://github.com/discordjs/discord-api-types/issues/725)) ([9074621](https://github.com/discordjs/discord-api-types/commit/9074621085d0e2d7b32b82c0bf0604e3cf42bbdf))
|
||||
|
||||
## [0.37.37](https://github.com/discordjs/discord-api-types/compare/0.37.36...0.37.37) (2023-03-23)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add missing `RESTGetAPIWebhookWithTokenQuery` ([#735](https://github.com/discordjs/discord-api-types/issues/735)) ([2a78a51](https://github.com/discordjs/discord-api-types/commit/2a78a517d2a3511913a8b2b74bba942db097b577))
|
||||
|
||||
### Features
|
||||
|
||||
- add various new flags ([#733](https://github.com/discordjs/discord-api-types/issues/733)) ([4723d29](https://github.com/discordjs/discord-api-types/commit/4723d29c9ee17c3efa8e8e86351754dee13428ef))
|
||||
- **RESTGetAPICurrentUserGuildsQuery:** add `with_counts` ([#641](https://github.com/discordjs/discord-api-types/issues/641)) ([0cd9b0d](https://github.com/discordjs/discord-api-types/commit/0cd9b0debbf17f60267bf2f42349fcebea5bf588))
|
||||
- **RESTPostAPIGuildChannelJSONBody:** add `default_thread_rate_limit_per_user` ([#730](https://github.com/discordjs/discord-api-types/issues/730)) ([8f9370d](https://github.com/discordjs/discord-api-types/commit/8f9370d2592d6a450820bee52fe153eb00ba830f))
|
||||
|
||||
## [0.37.36](https://github.com/discordjs/discord-api-types/compare/0.37.35...0.37.36) (2023-03-13)
|
||||
|
||||
### Features
|
||||
|
||||
- **AutoModeration:** add `custom_message` field support ([#727](https://github.com/discordjs/discord-api-types/issues/727)) ([0d47c69](https://github.com/discordjs/discord-api-types/commit/0d47c69ca80909205f14004aaf26645f367c06d0))
|
||||
|
||||
## [0.37.35](https://github.com/discordjs/discord-api-types/compare/0.37.34...0.37.35) (2023-02-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
## [0.37.38](https://github.com/discordjs/discord-api-types/compare/0.37.37...0.37.38) (2023-04-10)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `channel` ([#741](https://github.com/discordjs/discord-api-types/issues/741)) ([311b7a2](https://github.com/discordjs/discord-api-types/commit/311b7a2eb9bdc6ad9d6ed7af2b7faf6f95631698))
|
||||
- **RESTJSONErrorCodes:** add error `50163` ([#725](https://github.com/discordjs/discord-api-types/issues/725)) ([9074621](https://github.com/discordjs/discord-api-types/commit/9074621085d0e2d7b32b82c0bf0604e3cf42bbdf))
|
||||
|
||||
## [0.37.37](https://github.com/discordjs/discord-api-types/compare/0.37.36...0.37.37) (2023-03-23)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add missing `RESTGetAPIWebhookWithTokenQuery` ([#735](https://github.com/discordjs/discord-api-types/issues/735)) ([2a78a51](https://github.com/discordjs/discord-api-types/commit/2a78a517d2a3511913a8b2b74bba942db097b577))
|
||||
|
||||
### Features
|
||||
|
||||
- add various new flags ([#733](https://github.com/discordjs/discord-api-types/issues/733)) ([4723d29](https://github.com/discordjs/discord-api-types/commit/4723d29c9ee17c3efa8e8e86351754dee13428ef))
|
||||
- **RESTGetAPICurrentUserGuildsQuery:** add `with_counts` ([#641](https://github.com/discordjs/discord-api-types/issues/641)) ([0cd9b0d](https://github.com/discordjs/discord-api-types/commit/0cd9b0debbf17f60267bf2f42349fcebea5bf588))
|
||||
- **RESTPostAPIGuildChannelJSONBody:** add `default_thread_rate_limit_per_user` ([#730](https://github.com/discordjs/discord-api-types/issues/730)) ([8f9370d](https://github.com/discordjs/discord-api-types/commit/8f9370d2592d6a450820bee52fe153eb00ba830f))
|
||||
|
||||
## [0.37.36](https://github.com/discordjs/discord-api-types/compare/0.37.35...0.37.36) (2023-03-13)
|
||||
|
||||
### Features
|
||||
|
||||
- **AutoModeration:** add `custom_message` field support ([#727](https://github.com/discordjs/discord-api-types/issues/727)) ([0d47c69](https://github.com/discordjs/discord-api-types/commit/0d47c69ca80909205f14004aaf26645f367c06d0))
|
||||
|
||||
## [0.37.35](https://github.com/discordjs/discord-api-types/compare/0.37.34...0.37.35) (2023-02-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -115,7 +115,10 @@ export type APIApplicationCommandInteractionData =
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
|
||||
@@ -81,6 +81,12 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
|
||||
/**
|
||||
* The id of the channel it was sent from
|
||||
*
|
||||
* @deprecated Use {@apilink APIBaseInteraction#channel} instead
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
|
||||
@@ -123,19 +123,27 @@ export interface APIApplicationInstallParams {
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedIAP = 1 << 3,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
* Indicates if an app uses the Auto Moderation API
|
||||
*/
|
||||
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
@@ -174,7 +182,7 @@ export enum ApplicationFlags {
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
|
||||
@@ -169,7 +169,8 @@ export interface APIAutoModerationAction {
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
* Blocks a member's message and prevents it from being posted.
|
||||
* A custom explanation can be specified and shown to members whenever their message is blocked
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
@@ -200,4 +201,10 @@ export interface APIAutoModerationActionMetadata {
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
/**
|
||||
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
|
||||
*
|
||||
* Associated action type {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
custom_message?: string;
|
||||
}
|
||||
|
||||
@@ -798,10 +798,18 @@ export enum MessageFlags {
|
||||
* This message failed to mention some roles and add their members to the thread
|
||||
*/
|
||||
FailedToMentionSomeRolesInThread = 1 << 8,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ShouldShowLinkNotDiscordWarning = 1 << 10,
|
||||
/**
|
||||
* This message will not trigger push and desktop notifications
|
||||
*/
|
||||
SuppressNotifications = 1 << 12,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -970,7 +978,24 @@ export interface APIThreadMember {
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
export enum ThreadMemberFlags {
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasInteracted = 1 << 0,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AllMessages = 1 << 1,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
OnlyMentions = 1 << 2,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
NoMessages = 1 << 3,
|
||||
}
|
||||
|
||||
export interface APIThreadList {
|
||||
/**
|
||||
@@ -1661,15 +1686,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GuildFeedRemoved = 1 << 0,
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ActiveChannelsRemoved = 1 << 2,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsSpam = 1 << 5,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsGuildResourceChannel = 1 << 7,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ClydeAI = 1 << 8,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsScheduledForDeletion = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -236,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of non-offline members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
@@ -675,6 +677,22 @@ export enum GuildMemberFlags {
|
||||
* Member has started onboarding
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,14 @@ export enum UserFlags {
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
MFASMS = 1 << 4,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
PremiumPromoDismissed = 1 << 5,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
@@ -121,6 +129,10 @@ export enum UserFlags {
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasUnreadUrgentMessages = 1 << 13,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
@@ -147,6 +159,10 @@ export enum UserFlags {
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
DisablePremium = 1 << 21,
|
||||
/**
|
||||
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
@@ -161,6 +177,22 @@ export enum UserFlags {
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Collaborator = 1125899906842624,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
RestrictedCollaborator = 2251799813685248,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,10 @@ export type APIApplicationCommandInteractionData =
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v9.ts';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
|
||||
@@ -81,6 +81,12 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
|
||||
/**
|
||||
* The id of the channel it was sent from
|
||||
*
|
||||
* @deprecated Use {@apilink APIBaseInteraction#channel} instead
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
|
||||
@@ -123,19 +123,27 @@ export interface APIApplicationInstallParams {
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedIAP = 1 << 3,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
* Indicates if an app uses the Auto Moderation API
|
||||
*/
|
||||
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
@@ -174,7 +182,7 @@ export enum ApplicationFlags {
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
|
||||
@@ -169,7 +169,8 @@ export interface APIAutoModerationAction {
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
* Blocks a member's message and prevents it from being posted.
|
||||
* A custom explanation can be specified and shown to members whenever their message is blocked
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
@@ -200,4 +201,10 @@ export interface APIAutoModerationActionMetadata {
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
/**
|
||||
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
|
||||
*
|
||||
* Associated action type {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
custom_message?: string;
|
||||
}
|
||||
|
||||
@@ -784,10 +784,18 @@ export enum MessageFlags {
|
||||
* This message failed to mention some roles and add their members to the thread
|
||||
*/
|
||||
FailedToMentionSomeRolesInThread = 1 << 8,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ShouldShowLinkNotDiscordWarning = 1 << 10,
|
||||
/**
|
||||
* This message will not trigger push and desktop notifications
|
||||
*/
|
||||
SuppressNotifications = 1 << 12,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -934,7 +942,24 @@ export interface APIThreadMember {
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
export enum ThreadMemberFlags {
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasInteracted = 1 << 0,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AllMessages = 1 << 1,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
OnlyMentions = 1 << 2,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
NoMessages = 1 << 3,
|
||||
}
|
||||
|
||||
export interface APIThreadList {
|
||||
/**
|
||||
@@ -1629,15 +1654,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GuildFeedRemoved = 1 << 0,
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ActiveChannelsRemoved = 1 << 2,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsSpam = 1 << 5,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsGuildResourceChannel = 1 << 7,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ClydeAI = 1 << 8,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsScheduledForDeletion = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -236,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of non-offline members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
@@ -667,6 +669,22 @@ export enum GuildMemberFlags {
|
||||
* Member has started onboarding
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,14 @@ export enum UserFlags {
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
MFASMS = 1 << 4,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
PremiumPromoDismissed = 1 << 5,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
@@ -121,6 +129,10 @@ export enum UserFlags {
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasUnreadUrgentMessages = 1 << 13,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
@@ -147,6 +159,10 @@ export enum UserFlags {
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
DisablePremium = 1 << 21,
|
||||
/**
|
||||
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
@@ -161,6 +177,22 @@ export enum UserFlags {
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Collaborator = 1125899906842624,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
RestrictedCollaborator = 2251799813685248,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -232,6 +232,8 @@ export enum RESTJSONErrorCodes {
|
||||
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
|
||||
UploadedFileNotFound,
|
||||
|
||||
CannotDeleteGuildSubscriptionIntegration = 50163,
|
||||
|
||||
YouDoNotHavePermissionToSendThisSticker = 50600,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
||||
@@ -21,7 +20,7 @@ export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIAutoModerationRuleJSONBody {
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
@@ -39,7 +38,7 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
|
||||
*/
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata | undefined;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
@@ -49,16 +48,16 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles?: Snowflake[];
|
||||
exempt_roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels?: Snowflake[];
|
||||
}>;
|
||||
exempt_channels?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
|
||||
@@ -38,13 +38,13 @@ export type RESTGetAPIChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 1-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
@@ -52,25 +52,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText | undefined;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
position?: number | null;
|
||||
position?: number | null | undefined;
|
||||
/**
|
||||
* 0-1024 character channel topic (0-4096 characters for forum channels)
|
||||
*
|
||||
* Channel types: text, news, forum
|
||||
*/
|
||||
topic?: string | null;
|
||||
topic?: string | null | undefined;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, voice, news, forum
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
nsfw?: boolean | null | undefined;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
@@ -78,105 +78,105 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, newsThread, publicThread, privateThread, forum
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
bitrate?: number | null | undefined;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
user_limit?: number | null | undefined;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null;
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, voice, news
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
rtc_region?: string | null | undefined;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
video_quality_mode?: VideoQualityMode | null | undefined;
|
||||
/**
|
||||
* Whether the thread should be archived
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
archived?: boolean;
|
||||
archived?: boolean | undefined;
|
||||
/**
|
||||
* The amount of time in minutes to wait before automatically archiving the thread
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether the thread should be locked
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
locked?: boolean;
|
||||
locked?: boolean | undefined;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread
|
||||
*
|
||||
* Channel types: privateThread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
invitable?: boolean | undefined;
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel; limited to 20
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
available_tags?: APIGuildForumTag[];
|
||||
available_tags?: APIGuildForumTag[] | undefined;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number | null;
|
||||
default_thread_rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_sort_order?: SortOrderType | null;
|
||||
default_sort_order?: SortOrderType | null | undefined;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType;
|
||||
}>;
|
||||
default_forum_layout?: ForumLayoutType | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
@@ -226,71 +226,70 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
}>;
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
nonce?: number | string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* IDs of up to 3 stickers in the server to send in the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -300,7 +299,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -363,17 +362,17 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
content?: string | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[] | null;
|
||||
embeds?: APIEmbed[] | null | undefined;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
@@ -382,13 +381,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
allowed_mentions?: APIAllowedMentions | null | undefined;
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
@@ -396,14 +395,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
|
||||
}>;
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -413,7 +412,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -453,7 +452,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
allow?: Permissions | null;
|
||||
allow?: Permissions | null | undefined;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
@@ -461,7 +460,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
deny?: Permissions | null;
|
||||
deny?: Permissions | null | undefined;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
@@ -481,51 +480,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
max_age?: number | undefined;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
max_uses?: number | undefined;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
temporary?: boolean | undefined;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
unique?: boolean | undefined;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
target_type?: InviteTargetType | undefined;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
target_user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}>;
|
||||
target_application_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
@@ -575,7 +574,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
@@ -583,8 +582,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}>;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
@@ -599,7 +598,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* 1-100 character thread name
|
||||
*/
|
||||
@@ -613,8 +612,8 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600)
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}>;
|
||||
rate_limit_per_user?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
|
||||
@@ -627,7 +626,7 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -648,24 +647,23 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
*/
|
||||
export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
}>;
|
||||
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
@@ -15,7 +14,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
@@ -29,8 +28,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}>;
|
||||
roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
@@ -40,16 +39,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}>;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
|
||||
@@ -26,7 +26,6 @@ import type {
|
||||
GuildWidgetStyle,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
DistributiveOmit,
|
||||
DistributivePick,
|
||||
Nullable,
|
||||
@@ -57,14 +56,14 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'default_forum_layout'
|
||||
| 'default_thread_rate_limit_per_user'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string | null;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
}>;
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
@@ -73,7 +72,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -83,31 +82,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string;
|
||||
region?: string | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
icon?: string | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
/**
|
||||
* New guild roles
|
||||
*
|
||||
@@ -120,7 +119,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[];
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -133,30 +132,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
afk_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null;
|
||||
system_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
@@ -205,106 +204,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* New name for the guild (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string | null;
|
||||
region?: string | null | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel | null;
|
||||
verification_level?: GuildVerificationLevel | null | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
afk_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* User id to transfer guild ownership to (must be owner)
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
owner_id?: Snowflake | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
splash?: string | null;
|
||||
splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
|
||||
*/
|
||||
discovery_splash?: string | null;
|
||||
discovery_splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
|
||||
*/
|
||||
banner?: string | null;
|
||||
banner?: string | null | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: Snowflake | null;
|
||||
system_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* The id of the channel where Community guilds display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id?: Snowflake | null;
|
||||
rules_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id?: Snowflake | null;
|
||||
public_updates_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US" (if the value is set to `null`)
|
||||
*/
|
||||
preferred_locale?: string | null;
|
||||
preferred_locale?: string | null | undefined;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
features?: GuildFeature[] | undefined;
|
||||
/**
|
||||
* The description for the guild
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
@@ -334,26 +333,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean | undefined;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
@@ -414,7 +411,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
|
||||
*/
|
||||
@@ -424,68 +421,68 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean;
|
||||
mute?: boolean | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean;
|
||||
}>;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean | null;
|
||||
mute?: boolean | null | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean | null;
|
||||
deaf?: boolean | null | undefined;
|
||||
/**
|
||||
* ID of channel to move user to (if they are connected to voice)
|
||||
*
|
||||
* Requires `MOVE_MEMBERS` permission
|
||||
*/
|
||||
channel_id?: Snowflake | null;
|
||||
channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
}>;
|
||||
communication_disabled_until?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
@@ -497,26 +494,26 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
|
||||
*
|
||||
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-member
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
@@ -574,18 +571,18 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*
|
||||
* @deprecated use `delete_message_seconds` instead
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
delete_message_days?: number | undefined;
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number;
|
||||
}>;
|
||||
delete_message_seconds?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
@@ -605,46 +602,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* @default "new role"
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*
|
||||
* @default "default role permissions in guild"
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
@@ -654,18 +651,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
@@ -675,36 +670,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
@@ -747,24 +742,24 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
days?: number | undefined;
|
||||
/**
|
||||
* Whether `pruned is returned, discouraged for large guilds
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
compute_prune_count?: boolean;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*/
|
||||
include_roles?: Snowflake[];
|
||||
}>;
|
||||
include_roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
@@ -841,40 +836,40 @@ export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
|
||||
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
/**
|
||||
* Whether Membership Screening is enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* Array of field objects serialized in a string
|
||||
*/
|
||||
form_fields?: string;
|
||||
form_fields?: string | undefined;
|
||||
/**
|
||||
* The server description to show in the screening form
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null;
|
||||
}>;
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
@@ -884,7 +879,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
@@ -892,8 +887,8 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
@@ -908,13 +903,12 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
*/
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
@@ -27,11 +27,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
@@ -47,24 +47,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
scheduled_end_time?: string | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
description?: string | undefined;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
entity_type?: GuildScheduledEventEntityType | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
|
||||
/**
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
}>;
|
||||
image?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
@@ -89,21 +89,20 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -58,11 +58,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
description: string;
|
||||
}>;
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput | undefined;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
@@ -171,7 +170,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -213,7 +212,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
||||
@@ -19,11 +18,11 @@ export interface RESTPostAPIStageInstanceJSONBody {
|
||||
*
|
||||
* @default GuildOnly
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
/**
|
||||
* Notify @everyone that a stage instance has started
|
||||
*/
|
||||
send_start_notification?: boolean;
|
||||
send_start_notification?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
*/
|
||||
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIStageInstanceJSONBody {
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic?: string;
|
||||
topic?: string | undefined;
|
||||
/**
|
||||
* The privacy level of the stage instance
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
}>;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { APISticker, APIStickerPack } from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker
|
||||
@@ -55,20 +54,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
*/
|
||||
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildStickerJSONBody {
|
||||
/**
|
||||
* Name of the sticker (2-30 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Description of the sticker (2-100 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
|
||||
*/
|
||||
tags?: string;
|
||||
}>;
|
||||
tags?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { APIGuild, APITemplate } from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
|
||||
@@ -9,7 +9,7 @@ export type RESTGetAPITemplateResult = APITemplate;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
*/
|
||||
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPITemplateCreateGuildJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
}>;
|
||||
icon?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
@@ -35,7 +35,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
*/
|
||||
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildTemplatesJSONBody {
|
||||
/**
|
||||
* Name of the template (1-100 characters)
|
||||
*/
|
||||
@@ -43,8 +43,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Description for the template (0-120 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
|
||||
@@ -7,7 +7,6 @@ import type {
|
||||
APIApplicationRoleConnection,
|
||||
GuildFeature,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
@@ -27,16 +26,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
@@ -61,6 +60,12 @@ export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
* @default 200
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Include approximate member and presence counts in response
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
@@ -70,6 +75,8 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
approximate_member_count?: number;
|
||||
approximate_presence_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,15 +121,15 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name?: string;
|
||||
platform_name?: string | undefined;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username?: string;
|
||||
platform_username?: string | undefined;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata?: Record<string, string | number>;
|
||||
metadata?: Record<string, string | number> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
@@ -23,8 +23,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
@@ -54,22 +54,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
}>;
|
||||
channel_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
@@ -99,35 +99,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
avatar_url?: string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -135,22 +135,22 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
flags?: MessageFlags | undefined;
|
||||
/**
|
||||
* Name of thread to create
|
||||
*
|
||||
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
|
||||
*/
|
||||
thread_name?: string;
|
||||
}>;
|
||||
thread_name?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
@@ -160,7 +160,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -237,21 +237,28 @@ export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params
|
||||
*/
|
||||
export interface RESTGetAPIWebhookWithTokenMessageQuery {
|
||||
thread_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
}
|
||||
>;
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
|
||||
> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
@@ -261,7 +268,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@ export interface APIAllowedMentionsSend {
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
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 | undefined;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT | undefined;
|
||||
position?: number | null | undefined;
|
||||
topic?: string | null | undefined;
|
||||
nsfw?: boolean | null | undefined;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
user_limit?: number | null | undefined;
|
||||
permission_overwrites?: APIOverwrite[] | null | undefined;
|
||||
parent_id?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,12 +100,12 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
content?: string | undefined;
|
||||
nonce?: number | string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embed?: APIEmbed | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
message_reference?: APIMessageReference | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,19 +117,19 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
content?: string | undefined;
|
||||
nonce?: number | string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embed?: APIEmbed | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
message_reference?: APIMessageReference | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
@@ -141,10 +141,10 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
content?: string | null | undefined;
|
||||
embed?: APIEmbed | null | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null | undefined;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,12 +240,12 @@ export type RESTGetAPIChannelInvitesResult = APIInvite[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
max_age?: number | undefined;
|
||||
max_uses?: number | undefined;
|
||||
temporary?: boolean | undefined;
|
||||
unique?: boolean | undefined;
|
||||
target_user_id?: string | undefined;
|
||||
target_user_type?: InviteTargetUserType | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,7 +277,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
roles?: string[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,8 +35,8 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
name?: string | undefined;
|
||||
roles?: string[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,9 +32,9 @@ export type APIGuildCreatePartialChannel = Partial<
|
||||
Pick<APIChannel, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'>
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -50,16 +50,16 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIGuildCreateRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: number | string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: number | string;
|
||||
region?: string | undefined;
|
||||
icon?: string | undefined;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
afk_channel_id?: number | string | undefined;
|
||||
afk_timeout?: number | undefined;
|
||||
system_channel_id?: number | string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,24 +91,24 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
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 | undefined;
|
||||
region?: string | undefined;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
afk_channel_id?: string | null | undefined;
|
||||
afk_timeout?: number | undefined;
|
||||
icon?: string | null | undefined;
|
||||
owner_id?: string | undefined;
|
||||
splash?: string | null | undefined;
|
||||
discovery_splash?: string | null | undefined;
|
||||
banner?: string | null | undefined;
|
||||
system_channel_id?: string | null | undefined;
|
||||
rules_channel_id?: string | null | undefined;
|
||||
public_updates_channel_id?: string | null | undefined;
|
||||
preferred_locale?: string | undefined;
|
||||
features?: GuildFeature[] | undefined;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,8 +152,8 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
lock_permissions?: boolean | undefined;
|
||||
parent_id?: string | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -200,10 +200,10 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
nick?: string | undefined;
|
||||
roles?: string[] | undefined;
|
||||
mute?: boolean | undefined;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,11 +216,11 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
roles?: string[] | null | undefined;
|
||||
mute?: boolean | null | undefined;
|
||||
deaf?: boolean | null | undefined;
|
||||
channel_id?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +233,7 @@ export type RESTPatchAPIGuildMemberResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,8 +276,8 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
delete_message_days?: number | undefined;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,11 +302,11 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
name?: string | null | undefined;
|
||||
permissions?: number | string | null | undefined;
|
||||
color?: number | null | undefined;
|
||||
hoist?: boolean | null | undefined;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,7 +320,7 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position?: number;
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -333,11 +333,11 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
name?: string | undefined;
|
||||
permissions?: number | string | undefined;
|
||||
color?: number | undefined;
|
||||
hoist?: boolean | undefined;
|
||||
mentionable?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,9 +378,9 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
days?: number | undefined;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
include_roles?: string[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -434,9 +434,9 @@ export type RESTPostAPIGuildIntegrationResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildIntegrationJSONBody {
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
expire_behavior?: IntegrationExpireBehavior | null | undefined;
|
||||
expire_grace_period?: number | null | undefined;
|
||||
enable_emoticons?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ export type RESTGetAPIUserResult = APIUser;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
username?: string | undefined;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/mod.ts'
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,9 +44,9 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
name?: string | undefined;
|
||||
avatar?: string | null | undefined;
|
||||
channel_id?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,12 +81,12 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
content?: string | undefined;
|
||||
username?: string | undefined;
|
||||
avatar_url?: string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
|
||||
@@ -36,13 +36,13 @@ export type RESTGetAPIChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 1-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
@@ -50,25 +50,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText | undefined;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
position?: number | null;
|
||||
position?: number | null | undefined;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
topic?: string | null;
|
||||
topic?: string | null | undefined;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, news, store
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
nsfw?: boolean | null | undefined;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
@@ -76,44 +76,44 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
bitrate?: number | null | undefined;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
user_limit?: number | null | undefined;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null;
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, news, store, voice
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
rtc_region?: string | null | undefined;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
}>;
|
||||
video_quality_mode?: VideoQualityMode | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
@@ -169,79 +169,78 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
}>;
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
nonce?: number | string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed;
|
||||
embed?: APIEmbed | undefined;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* IDs of up to 3 stickers in the server to send in the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -252,7 +251,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -325,24 +324,24 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
content?: string | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[] | null;
|
||||
embeds?: APIEmbed[] | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed | null;
|
||||
embed?: APIEmbed | null | undefined;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
@@ -351,13 +350,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
allowed_mentions?: APIAllowedMentions | null | undefined;
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
@@ -365,14 +364,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
|
||||
}>;
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -383,7 +382,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -428,7 +427,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
allow?: Permissions | null;
|
||||
allow?: Permissions | null | undefined;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
@@ -436,7 +435,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
deny?: Permissions | null;
|
||||
deny?: Permissions | null | undefined;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
@@ -459,51 +458,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
max_age?: number | undefined;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
max_uses?: number | undefined;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
temporary?: boolean | undefined;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
unique?: boolean | undefined;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
target_type?: InviteTargetType | undefined;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
target_user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}>;
|
||||
target_application_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
@@ -562,7 +561,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
@@ -570,8 +569,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}>;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from '../../payloads/v8/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
@@ -18,7 +17,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
@@ -32,8 +31,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}>;
|
||||
roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
@@ -45,16 +44,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}>;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
|
||||
@@ -23,13 +23,7 @@ import type {
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
} from '../../payloads/v8/mod.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
Nullable,
|
||||
StrictPartial,
|
||||
StrictRequired,
|
||||
UnionToIntersection,
|
||||
} from '../../utils/internals.ts';
|
||||
import type { Nullable, StrictPartial, StrictRequired, UnionToIntersection } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -51,13 +45,12 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
UnionToIntersection<APIGuildChannelResolvable>,
|
||||
'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string | null;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
}>;
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -70,7 +63,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -80,31 +73,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string;
|
||||
region?: string | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
icon?: string | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
/**
|
||||
* New guild roles
|
||||
*
|
||||
@@ -117,7 +110,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[];
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -130,30 +123,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
afk_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: number | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null;
|
||||
system_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
@@ -190,106 +183,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* New name for the guild (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string | null;
|
||||
region?: string | null | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel | null;
|
||||
verification_level?: GuildVerificationLevel | null | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
afk_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: number | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* User id to transfer guild ownership to (must be owner)
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
owner_id?: Snowflake | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
splash?: string | null;
|
||||
splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
|
||||
*/
|
||||
discovery_splash?: string | null;
|
||||
discovery_splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
|
||||
*/
|
||||
banner?: string | null;
|
||||
banner?: string | null | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: Snowflake | null;
|
||||
system_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* The id of the channel where Community guilds display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id?: Snowflake | null;
|
||||
rules_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id?: Snowflake | null;
|
||||
public_updates_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US" (if the value is set to `null`)
|
||||
*/
|
||||
preferred_locale?: string | null;
|
||||
preferred_locale?: string | null | undefined;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
features?: GuildFeature[] | undefined;
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
@@ -325,26 +318,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean | undefined;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
@@ -409,7 +400,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
|
||||
*/
|
||||
@@ -419,26 +410,26 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean;
|
||||
mute?: boolean | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean;
|
||||
}>;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -449,42 +440,42 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean | null;
|
||||
mute?: boolean | null | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean | null;
|
||||
deaf?: boolean | null | undefined;
|
||||
/**
|
||||
* ID of channel to move user to (if they are connected to voice)
|
||||
*
|
||||
* Requires `MOVE_MEMBERS` permission
|
||||
*/
|
||||
channel_id?: Snowflake | null;
|
||||
channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
}>;
|
||||
communication_disabled_until?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
@@ -498,27 +489,27 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
|
||||
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-member
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
@@ -563,18 +554,18 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
delete_message_days?: number | undefined;
|
||||
/**
|
||||
* Reason for the ban
|
||||
*
|
||||
* @deprecated Removed in API v10, use the `X-Audit-Log-Reason` header instead.
|
||||
*/
|
||||
reason?: string;
|
||||
}>;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
@@ -598,46 +589,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* @default "new role"
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*
|
||||
* @default "default role permissions in guild"
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
@@ -649,18 +640,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
@@ -672,36 +661,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
@@ -749,24 +738,24 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
days?: number | undefined;
|
||||
/**
|
||||
* Whether `pruned is returned, discouraged for large guilds
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
compute_prune_count?: boolean;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*/
|
||||
include_roles?: Snowflake[];
|
||||
}>;
|
||||
include_roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
@@ -861,20 +850,20 @@ export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreenin
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
/**
|
||||
* Whether Membership Screening is enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* Array of field objects serialized in a string
|
||||
*/
|
||||
form_fields?: string;
|
||||
form_fields?: string | undefined;
|
||||
/**
|
||||
* The server description to show in the screening form
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -884,7 +873,7 @@ export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreen
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
@@ -892,17 +881,17 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null;
|
||||
}>;
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
@@ -910,8 +899,8 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
@@ -923,10 +912,9 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
@@ -30,11 +30,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
@@ -50,24 +50,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
scheduled_end_time?: string | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
description?: string | undefined;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
entity_type?: GuildScheduledEventEntityType | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
|
||||
/**
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
}>;
|
||||
image?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
@@ -96,13 +96,12 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -36,11 +36,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
description: string;
|
||||
}>;
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput | undefined;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
@@ -151,7 +150,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -200,7 +199,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v8/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
||||
@@ -20,7 +19,7 @@ export interface RESTPostAPIStageInstanceJSONBody {
|
||||
*
|
||||
* @default GuildOnly
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
|
||||
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIStageInstanceJSONBody {
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic?: string;
|
||||
topic?: string | undefined;
|
||||
/**
|
||||
* The privacy level of the stage instance
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
}>;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { APISticker, APIStickerPack } from '../../payloads/v8/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -53,20 +52,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildStickerJSONBody {
|
||||
/**
|
||||
* Name of the sticker (2-30 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Description of the sticker (2-100 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
|
||||
*/
|
||||
tags?: string;
|
||||
}>;
|
||||
tags?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { APIGuild, APITemplate } from '../../payloads/v8/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#get-template
|
||||
@@ -11,7 +11,7 @@ export type RESTGetAPITemplateResult = APITemplate;
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-from-template
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPITemplateCreateGuildJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -21,8 +21,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
}>;
|
||||
icon?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-from-template
|
||||
@@ -40,7 +40,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-template
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildTemplatesJSONBody {
|
||||
/**
|
||||
* Name of the template (1-100 characters)
|
||||
*/
|
||||
@@ -48,8 +48,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Description for the template (0-120 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-template
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../../payloads/v8/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
@@ -24,16 +23,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
@@ -25,8 +25,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
@@ -62,22 +62,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
}>;
|
||||
channel_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
@@ -113,35 +113,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
avatar_url?: string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -149,16 +149,16 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
@@ -169,7 +169,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -259,17 +259,17 @@ export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
}
|
||||
>;
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
|
||||
> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
@@ -280,7 +280,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
||||
@@ -21,7 +20,7 @@ export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIAutoModerationRuleJSONBody {
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
@@ -39,7 +38,7 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
|
||||
*/
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata | undefined;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
@@ -49,16 +48,16 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles?: Snowflake[];
|
||||
exempt_roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels?: Snowflake[];
|
||||
}>;
|
||||
exempt_channels?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
|
||||
@@ -38,13 +38,13 @@ export type RESTGetAPIChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 1-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
@@ -52,25 +52,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText | undefined;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
position?: number | null;
|
||||
position?: number | null | undefined;
|
||||
/**
|
||||
* 0-1024 character channel topic (0-4096 characters for forum channels)
|
||||
*
|
||||
* Channel types: text, news, forum
|
||||
*/
|
||||
topic?: string | null;
|
||||
topic?: string | null | undefined;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, voice, news, forum
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
nsfw?: boolean | null | undefined;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
@@ -78,105 +78,105 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, newsThread, publicThread, privateThread, forum
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
bitrate?: number | null | undefined;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
user_limit?: number | null | undefined;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null;
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, voice, news
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
rtc_region?: string | null | undefined;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
video_quality_mode?: VideoQualityMode | null | undefined;
|
||||
/**
|
||||
* Whether the thread should be archived
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
archived?: boolean;
|
||||
archived?: boolean | undefined;
|
||||
/**
|
||||
* The amount of time in minutes to wait before automatically archiving the thread
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether the thread should be locked
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
locked?: boolean;
|
||||
locked?: boolean | undefined;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread
|
||||
*
|
||||
* Channel types: privateThread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
invitable?: boolean | undefined;
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel; limited to 20
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
available_tags?: APIGuildForumTag[];
|
||||
available_tags?: APIGuildForumTag[] | undefined;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number | null;
|
||||
default_thread_rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_sort_order?: SortOrderType | null;
|
||||
default_sort_order?: SortOrderType | null | undefined;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType;
|
||||
}>;
|
||||
default_forum_layout?: ForumLayoutType | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
@@ -226,78 +226,77 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
}>;
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
nonce?: number | string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed;
|
||||
embed?: APIEmbed | undefined;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* IDs of up to 3 stickers in the server to send in the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -307,7 +306,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -370,24 +369,24 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
content?: string | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[] | null;
|
||||
embeds?: APIEmbed[] | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed | null;
|
||||
embed?: APIEmbed | null | undefined;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
@@ -396,13 +395,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
allowed_mentions?: APIAllowedMentions | null | undefined;
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
@@ -410,14 +409,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
|
||||
}>;
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -427,7 +426,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -467,7 +466,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
allow?: Permissions | null;
|
||||
allow?: Permissions | null | undefined;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
@@ -475,7 +474,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
deny?: Permissions | null;
|
||||
deny?: Permissions | null | undefined;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
@@ -495,51 +494,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
max_age?: number | undefined;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
max_uses?: number | undefined;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
temporary?: boolean | undefined;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
unique?: boolean | undefined;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
target_type?: InviteTargetType | undefined;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
target_user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}>;
|
||||
target_application_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
@@ -589,7 +588,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
@@ -597,8 +596,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}>;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
@@ -613,7 +612,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* 1-100 character thread name
|
||||
*/
|
||||
@@ -627,8 +626,8 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600)
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}>;
|
||||
rate_limit_per_user?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
|
||||
@@ -641,7 +640,7 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -662,24 +661,23 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
*/
|
||||
export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
}>;
|
||||
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
@@ -15,7 +14,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
@@ -29,8 +28,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}>;
|
||||
roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
@@ -40,16 +39,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}>;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
|
||||
@@ -26,7 +26,6 @@ import type {
|
||||
APIGroupDMChannel,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
DistributiveOmit,
|
||||
DistributivePick,
|
||||
Nullable,
|
||||
@@ -57,14 +56,14 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'default_forum_layout'
|
||||
| 'default_thread_rate_limit_per_user'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string | null;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
}>;
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
@@ -73,7 +72,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -83,31 +82,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string;
|
||||
region?: string | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
icon?: string | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
/**
|
||||
* New guild roles
|
||||
*
|
||||
@@ -120,7 +119,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[];
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -133,30 +132,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
afk_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null;
|
||||
system_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
@@ -205,106 +204,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* New name for the guild (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string | null;
|
||||
region?: string | null | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel | null;
|
||||
verification_level?: GuildVerificationLevel | null | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
afk_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* User id to transfer guild ownership to (must be owner)
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
owner_id?: Snowflake | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
splash?: string | null;
|
||||
splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
|
||||
*/
|
||||
discovery_splash?: string | null;
|
||||
discovery_splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
|
||||
*/
|
||||
banner?: string | null;
|
||||
banner?: string | null | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: Snowflake | null;
|
||||
system_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* The id of the channel where Community guilds display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id?: Snowflake | null;
|
||||
rules_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id?: Snowflake | null;
|
||||
public_updates_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US" (if the value is set to `null`)
|
||||
*/
|
||||
preferred_locale?: string | null;
|
||||
preferred_locale?: string | null | undefined;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
features?: GuildFeature[] | undefined;
|
||||
/**
|
||||
* The description for the guild
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
@@ -334,26 +333,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean | undefined;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
@@ -414,7 +411,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
|
||||
*/
|
||||
@@ -424,68 +421,68 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean;
|
||||
mute?: boolean | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean;
|
||||
}>;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean | null;
|
||||
mute?: boolean | null | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean | null;
|
||||
deaf?: boolean | null | undefined;
|
||||
/**
|
||||
* ID of channel to move user to (if they are connected to voice)
|
||||
*
|
||||
* Requires `MOVE_MEMBERS` permission
|
||||
*/
|
||||
channel_id?: Snowflake | null;
|
||||
channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
}>;
|
||||
communication_disabled_until?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
@@ -497,26 +494,26 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
|
||||
*
|
||||
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-member
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
@@ -574,24 +571,24 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*
|
||||
* @deprecated use `delete_message_seconds` instead
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
delete_message_days?: number | undefined;
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number;
|
||||
delete_message_seconds?: number | undefined;
|
||||
/**
|
||||
* Reason for the ban
|
||||
*
|
||||
* @deprecated Removed in API v10, use the `X-Audit-Log-Reason` header instead.
|
||||
*/
|
||||
reason?: string;
|
||||
}>;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
@@ -611,46 +608,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* @default "new role"
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*
|
||||
* @default "default role permissions in guild"
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
@@ -660,18 +657,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
@@ -681,36 +676,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
@@ -753,24 +748,24 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
days?: number | undefined;
|
||||
/**
|
||||
* Whether `pruned is returned, discouraged for large guilds
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
compute_prune_count?: boolean;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*/
|
||||
include_roles?: Snowflake[];
|
||||
}>;
|
||||
include_roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
@@ -847,40 +842,40 @@ export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
|
||||
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
/**
|
||||
* Whether Membership Screening is enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* Array of field objects serialized in a string
|
||||
*/
|
||||
form_fields?: string;
|
||||
form_fields?: string | undefined;
|
||||
/**
|
||||
* The server description to show in the screening form
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null;
|
||||
}>;
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
@@ -890,7 +885,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
@@ -898,8 +893,8 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
@@ -914,13 +909,12 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
*/
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
@@ -27,11 +27,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
@@ -47,24 +47,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
scheduled_end_time?: string | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
description?: string | undefined;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
entity_type?: GuildScheduledEventEntityType | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
|
||||
/**
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
}>;
|
||||
image?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
@@ -89,21 +89,20 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -58,11 +58,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
description: string;
|
||||
}>;
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput | undefined;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
@@ -171,7 +170,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -213,7 +212,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
||||
@@ -19,11 +18,11 @@ export interface RESTPostAPIStageInstanceJSONBody {
|
||||
*
|
||||
* @default GuildOnly
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
/**
|
||||
* Notify @everyone that a stage instance has started
|
||||
*/
|
||||
send_start_notification?: boolean;
|
||||
send_start_notification?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
*/
|
||||
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIStageInstanceJSONBody {
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic?: string;
|
||||
topic?: string | undefined;
|
||||
/**
|
||||
* The privacy level of the stage instance
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
}>;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { APISticker, APIStickerPack } from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker
|
||||
@@ -55,20 +54,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
*/
|
||||
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildStickerJSONBody {
|
||||
/**
|
||||
* Name of the sticker (2-30 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Description of the sticker (2-100 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
|
||||
*/
|
||||
tags?: string;
|
||||
}>;
|
||||
tags?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { APIGuild, APITemplate } from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
|
||||
@@ -9,7 +9,7 @@ export type RESTGetAPITemplateResult = APITemplate;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
*/
|
||||
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPITemplateCreateGuildJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
}>;
|
||||
icon?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
@@ -35,7 +35,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
*/
|
||||
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildTemplatesJSONBody {
|
||||
/**
|
||||
* Name of the template (1-100 characters)
|
||||
*/
|
||||
@@ -43,8 +43,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Description for the template (0-120 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
|
||||
@@ -7,7 +7,6 @@ import type {
|
||||
APIApplicationRoleConnection,
|
||||
GuildFeature,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
@@ -27,16 +26,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
@@ -61,6 +60,12 @@ export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
* @default 200
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Include approximate member and presence counts in response
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
@@ -70,6 +75,8 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
approximate_member_count?: number;
|
||||
approximate_presence_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,15 +121,15 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name?: string;
|
||||
platform_name?: string | undefined;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username?: string;
|
||||
platform_username?: string | undefined;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata?: Record<string, string | number>;
|
||||
metadata?: Record<string, string | number> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
@@ -23,8 +23,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
@@ -54,22 +54,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
}>;
|
||||
channel_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
@@ -99,35 +99,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
avatar_url?: string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -135,22 +135,22 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
flags?: MessageFlags | undefined;
|
||||
/**
|
||||
* Name of thread to create
|
||||
*
|
||||
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
|
||||
*/
|
||||
thread_name?: string;
|
||||
}>;
|
||||
thread_name?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
@@ -160,7 +160,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -237,21 +237,28 @@ export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params
|
||||
*/
|
||||
export interface RESTGetAPIWebhookWithTokenMessageQuery {
|
||||
thread_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
}
|
||||
>;
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
|
||||
> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
@@ -261,7 +268,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@ export type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Allows support for TS 4.5's `exactOptionalPropertyTypes` option by ensuring a property present and undefined is valid
|
||||
* (since JSON.stringify ignores undefined properties)
|
||||
*/
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined>
|
||||
? AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
|
||||
2002
package-lock.json
generated
2002
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.37.35",
|
||||
"version": "0.37.38",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
@@ -109,11 +109,11 @@
|
||||
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
|
||||
"lint": "prettier --write . && eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
|
||||
"postpublish": "run-s clean:node build:deno",
|
||||
"prepare": "is-ci || husky install",
|
||||
"prepare": "tsc -p ./.eslintplugin && (is-ci || husky install)",
|
||||
"prepublishOnly": "run-s clean test:lint build:node",
|
||||
"test:lint": "prettier --check . && eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
|
||||
"pretest:types": "tsc",
|
||||
"test:types": "node ./scripts/run-tsd.mjs",
|
||||
"test:types": "tsd -t ./v10.d.ts",
|
||||
"posttest:types": "npm run clean:node"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -140,6 +140,7 @@
|
||||
"@types/node": "^17.0.35",
|
||||
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
||||
"@typescript-eslint/parser": "^5.26.0",
|
||||
"@typescript-eslint/utils": "^5.53.0",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"conventional-recommended-bump": "^6.1.0",
|
||||
"eslint": "^8.16.0",
|
||||
@@ -148,6 +149,7 @@
|
||||
"eslint-import-resolver-typescript": "^2.7.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-local": "^1.0.0",
|
||||
"eslint-plugin-react": "^7.30.0",
|
||||
"eslint-plugin-react-hooks": "^4.5.0",
|
||||
"gen-esm-wrapper": "^1.1.3",
|
||||
@@ -158,8 +160,9 @@
|
||||
"prettier": "^2.6.2",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"tsd": "^0.20.0",
|
||||
"typescript": "^4.6.4"
|
||||
"tsd": "^0.25.0",
|
||||
"tsutils": "^3.21.0",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -115,7 +115,10 @@ export type APIApplicationCommandInteractionData =
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses';
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v10';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
|
||||
import type { APIGuildMember } from '../guild';
|
||||
import type { APIUser } from '../user';
|
||||
|
||||
@@ -81,6 +81,12 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
|
||||
/**
|
||||
* The id of the channel it was sent from
|
||||
*
|
||||
* @deprecated Use {@apilink APIBaseInteraction#channel} instead
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
|
||||
@@ -123,19 +123,27 @@ export interface APIApplicationInstallParams {
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedIAP = 1 << 3,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
* Indicates if an app uses the Auto Moderation API
|
||||
*/
|
||||
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
@@ -174,7 +182,7 @@ export enum ApplicationFlags {
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
|
||||
@@ -169,7 +169,8 @@ export interface APIAutoModerationAction {
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
* Blocks a member's message and prevents it from being posted.
|
||||
* A custom explanation can be specified and shown to members whenever their message is blocked
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
@@ -200,4 +201,10 @@ export interface APIAutoModerationActionMetadata {
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
/**
|
||||
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
|
||||
*
|
||||
* Associated action type {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
custom_message?: string;
|
||||
}
|
||||
|
||||
@@ -798,10 +798,18 @@ export enum MessageFlags {
|
||||
* This message failed to mention some roles and add their members to the thread
|
||||
*/
|
||||
FailedToMentionSomeRolesInThread = 1 << 8,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ShouldShowLinkNotDiscordWarning = 1 << 10,
|
||||
/**
|
||||
* This message will not trigger push and desktop notifications
|
||||
*/
|
||||
SuppressNotifications = 1 << 12,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -970,7 +978,24 @@ export interface APIThreadMember {
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
export enum ThreadMemberFlags {
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasInteracted = 1 << 0,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AllMessages = 1 << 1,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
OnlyMentions = 1 << 2,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
NoMessages = 1 << 3,
|
||||
}
|
||||
|
||||
export interface APIThreadList {
|
||||
/**
|
||||
@@ -1661,15 +1686,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GuildFeedRemoved = 1 << 0,
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ActiveChannelsRemoved = 1 << 2,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsSpam = 1 << 5,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsGuildResourceChannel = 1 << 7,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ClydeAI = 1 << 8,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsScheduledForDeletion = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -236,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of non-offline members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
@@ -675,6 +677,22 @@ export enum GuildMemberFlags {
|
||||
* Member has started onboarding
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,14 @@ export enum UserFlags {
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
MFASMS = 1 << 4,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
PremiumPromoDismissed = 1 << 5,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
@@ -121,6 +129,10 @@ export enum UserFlags {
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasUnreadUrgentMessages = 1 << 13,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
@@ -147,6 +159,10 @@ export enum UserFlags {
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
DisablePremium = 1 << 21,
|
||||
/**
|
||||
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
@@ -161,6 +177,22 @@ export enum UserFlags {
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Collaborator = 1125899906842624,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
RestrictedCollaborator = 2251799813685248,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,10 @@ export type APIApplicationCommandInteractionData =
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses';
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v9';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
|
||||
import type { APIGuildMember } from '../guild';
|
||||
import type { APIUser } from '../user';
|
||||
|
||||
@@ -81,6 +81,12 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
|
||||
/**
|
||||
* The id of the channel it was sent from
|
||||
*
|
||||
* @deprecated Use {@apilink APIBaseInteraction#channel} instead
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
|
||||
@@ -123,19 +123,27 @@ export interface APIApplicationInstallParams {
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedIAP = 1 << 3,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
* Indicates if an app uses the Auto Moderation API
|
||||
*/
|
||||
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
@@ -174,7 +182,7 @@ export enum ApplicationFlags {
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
|
||||
@@ -169,7 +169,8 @@ export interface APIAutoModerationAction {
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
* Blocks a member's message and prevents it from being posted.
|
||||
* A custom explanation can be specified and shown to members whenever their message is blocked
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
@@ -200,4 +201,10 @@ export interface APIAutoModerationActionMetadata {
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
/**
|
||||
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
|
||||
*
|
||||
* Associated action type {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
custom_message?: string;
|
||||
}
|
||||
|
||||
@@ -784,10 +784,18 @@ export enum MessageFlags {
|
||||
* This message failed to mention some roles and add their members to the thread
|
||||
*/
|
||||
FailedToMentionSomeRolesInThread = 1 << 8,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ShouldShowLinkNotDiscordWarning = 1 << 10,
|
||||
/**
|
||||
* This message will not trigger push and desktop notifications
|
||||
*/
|
||||
SuppressNotifications = 1 << 12,
|
||||
/**
|
||||
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -934,7 +942,24 @@ export interface APIThreadMember {
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
export enum ThreadMemberFlags {
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasInteracted = 1 << 0,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AllMessages = 1 << 1,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
OnlyMentions = 1 << 2,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
NoMessages = 1 << 3,
|
||||
}
|
||||
|
||||
export interface APIThreadList {
|
||||
/**
|
||||
@@ -1629,15 +1654,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GuildFeedRemoved = 1 << 0,
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ActiveChannelsRemoved = 1 << 2,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsSpam = 1 << 5,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsGuildResourceChannel = 1 << 7,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ClydeAI = 1 << 8,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsScheduledForDeletion = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -236,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
* Approximate number of non-offline members in this guild,
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
@@ -667,6 +669,22 @@ export enum GuildMemberFlags {
|
||||
* Member has started onboarding
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,6 +101,14 @@ export enum UserFlags {
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
MFASMS = 1 << 4,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
PremiumPromoDismissed = 1 << 5,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
@@ -121,6 +129,10 @@ export enum UserFlags {
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasUnreadUrgentMessages = 1 << 13,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
@@ -147,6 +159,10 @@ export enum UserFlags {
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
DisablePremium = 1 << 21,
|
||||
/**
|
||||
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
@@ -161,6 +177,22 @@ export enum UserFlags {
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Collaborator = 1125899906842624,
|
||||
/**
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
RestrictedCollaborator = 2251799813685248,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -232,6 +232,8 @@ export enum RESTJSONErrorCodes {
|
||||
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
|
||||
UploadedFileNotFound,
|
||||
|
||||
CannotDeleteGuildSubscriptionIntegration = 50163,
|
||||
|
||||
YouDoNotHavePermissionToSendThisSticker = 50600,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
||||
@@ -21,7 +20,7 @@ export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIAutoModerationRuleJSONBody {
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
@@ -39,7 +38,7 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
|
||||
*/
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata | undefined;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
@@ -49,16 +48,16 @@ export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefi
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles?: Snowflake[];
|
||||
exempt_roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels?: Snowflake[];
|
||||
}>;
|
||||
exempt_channels?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
|
||||
@@ -38,13 +38,13 @@ export type RESTGetAPIChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 1-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
@@ -52,25 +52,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText | undefined;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
position?: number | null;
|
||||
position?: number | null | undefined;
|
||||
/**
|
||||
* 0-1024 character channel topic (0-4096 characters for forum channels)
|
||||
*
|
||||
* Channel types: text, news, forum
|
||||
*/
|
||||
topic?: string | null;
|
||||
topic?: string | null | undefined;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, voice, news, forum
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
nsfw?: boolean | null | undefined;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
@@ -78,105 +78,105 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, newsThread, publicThread, privateThread, forum
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
bitrate?: number | null | undefined;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
user_limit?: number | null | undefined;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null;
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, voice, news
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
rtc_region?: string | null | undefined;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
video_quality_mode?: VideoQualityMode | null | undefined;
|
||||
/**
|
||||
* Whether the thread should be archived
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
archived?: boolean;
|
||||
archived?: boolean | undefined;
|
||||
/**
|
||||
* The amount of time in minutes to wait before automatically archiving the thread
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether the thread should be locked
|
||||
*
|
||||
* Channel types: newsThread, publicThread, privateThread
|
||||
*/
|
||||
locked?: boolean;
|
||||
locked?: boolean | undefined;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread
|
||||
*
|
||||
* Channel types: privateThread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
invitable?: boolean | undefined;
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel; limited to 20
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
available_tags?: APIGuildForumTag[];
|
||||
available_tags?: APIGuildForumTag[] | undefined;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number | null;
|
||||
default_thread_rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_sort_order?: SortOrderType | null;
|
||||
default_sort_order?: SortOrderType | null | undefined;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType;
|
||||
}>;
|
||||
default_forum_layout?: ForumLayoutType | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
@@ -226,71 +226,70 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
}>;
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
nonce?: number | string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* IDs of up to 3 stickers in the server to send in the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -300,7 +299,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -363,17 +362,17 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
content?: string | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[] | null;
|
||||
embeds?: APIEmbed[] | null | undefined;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
@@ -382,13 +381,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
allowed_mentions?: APIAllowedMentions | null | undefined;
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
@@ -396,14 +395,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
|
||||
}>;
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -413,7 +412,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -453,7 +452,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
allow?: Permissions | null;
|
||||
allow?: Permissions | null | undefined;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
@@ -461,7 +460,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
deny?: Permissions | null;
|
||||
deny?: Permissions | null | undefined;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
@@ -481,51 +480,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
max_age?: number | undefined;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
max_uses?: number | undefined;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
temporary?: boolean | undefined;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
unique?: boolean | undefined;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
target_type?: InviteTargetType | undefined;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
target_user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}>;
|
||||
target_application_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
@@ -575,7 +574,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
@@ -583,8 +582,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}>;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
@@ -599,7 +598,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* 1-100 character thread name
|
||||
*/
|
||||
@@ -613,8 +612,8 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600)
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}>;
|
||||
rate_limit_per_user?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
|
||||
@@ -627,7 +626,7 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -648,24 +647,23 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
*/
|
||||
export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
}>;
|
||||
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In a future API version this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
invitable?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIEmoji } from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
@@ -15,7 +14,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
@@ -29,8 +28,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}>;
|
||||
roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
@@ -40,16 +39,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}>;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
|
||||
@@ -26,7 +26,6 @@ import type {
|
||||
GuildWidgetStyle,
|
||||
} from '../../payloads/v10/index';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
DistributiveOmit,
|
||||
DistributivePick,
|
||||
Nullable,
|
||||
@@ -57,14 +56,14 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'default_forum_layout'
|
||||
| 'default_thread_rate_limit_per_user'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string | null;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
}>;
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
@@ -73,7 +72,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -83,31 +82,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string;
|
||||
region?: string | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
icon?: string | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
/**
|
||||
* New guild roles
|
||||
*
|
||||
@@ -120,7 +119,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[];
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -133,30 +132,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
afk_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null;
|
||||
system_channel_id?: number | Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
@@ -205,106 +204,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* New name for the guild (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string | null;
|
||||
region?: string | null | undefined;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel | null;
|
||||
verification_level?: GuildVerificationLevel | null | undefined;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
afk_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* User id to transfer guild ownership to (must be owner)
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
owner_id?: Snowflake | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
splash?: string | null;
|
||||
splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
|
||||
*/
|
||||
discovery_splash?: string | null;
|
||||
discovery_splash?: string | null | undefined;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
|
||||
*/
|
||||
banner?: string | null;
|
||||
banner?: string | null | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: Snowflake | null;
|
||||
system_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
system_channel_flags?: GuildSystemChannelFlags | undefined;
|
||||
/**
|
||||
* The id of the channel where Community guilds display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id?: Snowflake | null;
|
||||
rules_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id?: Snowflake | null;
|
||||
public_updates_channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US" (if the value is set to `null`)
|
||||
*/
|
||||
preferred_locale?: string | null;
|
||||
preferred_locale?: string | null | undefined;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
features?: GuildFeature[] | undefined;
|
||||
/**
|
||||
* The description for the guild
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}>;
|
||||
premium_progress_bar_enabled?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
@@ -334,26 +333,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean | undefined;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
@@ -414,7 +411,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
|
||||
*/
|
||||
@@ -424,68 +421,68 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
roles?: Snowflake[] | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean;
|
||||
mute?: boolean | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean;
|
||||
}>;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
/**
|
||||
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean | null;
|
||||
mute?: boolean | null | undefined;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean | null;
|
||||
deaf?: boolean | null | undefined;
|
||||
/**
|
||||
* ID of channel to move user to (if they are connected to voice)
|
||||
*
|
||||
* Requires `MOVE_MEMBERS` permission
|
||||
*/
|
||||
channel_id?: Snowflake | null;
|
||||
channel_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
}>;
|
||||
communication_disabled_until?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
@@ -497,26 +494,26 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
|
||||
*
|
||||
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-member
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}>;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
@@ -574,18 +571,18 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*
|
||||
* @deprecated use `delete_message_seconds` instead
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
delete_message_days?: number | undefined;
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number;
|
||||
}>;
|
||||
delete_message_seconds?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
@@ -605,46 +602,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* @default "new role"
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*
|
||||
* @default "default role permissions in guild"
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
@@ -654,18 +651,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number;
|
||||
}>
|
||||
>;
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
@@ -675,36 +670,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*/
|
||||
name?: string | null;
|
||||
name?: string | null | undefined;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
permissions?: Permissions | null | undefined;
|
||||
/**
|
||||
* RGB color value
|
||||
*/
|
||||
color?: number | null;
|
||||
color?: number | null | undefined;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
hoist?: boolean | null | undefined;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
icon?: string | null | undefined;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
unicode_emoji?: string | null | undefined;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}>;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
@@ -747,24 +742,24 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
days?: number | undefined;
|
||||
/**
|
||||
* Whether `pruned is returned, discouraged for large guilds
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
compute_prune_count?: boolean;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*/
|
||||
include_roles?: Snowflake[];
|
||||
}>;
|
||||
include_roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
@@ -841,40 +836,40 @@ export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
|
||||
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
/**
|
||||
* Whether Membership Screening is enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled?: boolean | undefined;
|
||||
/**
|
||||
* Array of field objects serialized in a string
|
||||
*/
|
||||
form_fields?: string;
|
||||
form_fields?: string | undefined;
|
||||
/**
|
||||
* The server description to show in the screening form
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null;
|
||||
}>;
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
@@ -884,7 +879,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
@@ -892,8 +887,8 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
@@ -908,13 +903,12 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
*/
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { StrictPartial } from '../../utils/internals';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
@@ -27,11 +27,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
@@ -47,24 +47,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
scheduled_end_time?: string | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
description?: string | undefined;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
entity_type?: GuildScheduledEventEntityType | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
|
||||
/**
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
}>;
|
||||
image?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
@@ -89,21 +89,20 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -58,11 +58,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
description: string;
|
||||
}>;
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput | undefined;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
@@ -171,7 +170,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -213,7 +212,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
||||
@@ -19,11 +18,11 @@ export interface RESTPostAPIStageInstanceJSONBody {
|
||||
*
|
||||
* @default GuildOnly
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
/**
|
||||
* Notify @everyone that a stage instance has started
|
||||
*/
|
||||
send_start_notification?: boolean;
|
||||
send_start_notification?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
*/
|
||||
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIStageInstanceJSONBody {
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic?: string;
|
||||
topic?: string | undefined;
|
||||
/**
|
||||
* The privacy level of the stage instance
|
||||
*/
|
||||
privacy_level?: StageInstancePrivacyLevel;
|
||||
}>;
|
||||
privacy_level?: StageInstancePrivacyLevel | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { APISticker, APIStickerPack } from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker
|
||||
@@ -55,20 +54,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
*/
|
||||
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildStickerJSONBody {
|
||||
/**
|
||||
* Name of the sticker (2-30 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Description of the sticker (2-100 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
description?: string | null | undefined;
|
||||
/**
|
||||
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
|
||||
*/
|
||||
tags?: string;
|
||||
}>;
|
||||
tags?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { APIGuild, APITemplate } from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { StrictPartial } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
|
||||
@@ -9,7 +9,7 @@ export type RESTGetAPITemplateResult = APITemplate;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
*/
|
||||
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPITemplateCreateGuildJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
}>;
|
||||
icon?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
||||
@@ -35,7 +35,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
*/
|
||||
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildTemplatesJSONBody {
|
||||
/**
|
||||
* Name of the template (1-100 characters)
|
||||
*/
|
||||
@@ -43,8 +43,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Description for the template (0-120 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
}>;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
||||
|
||||
@@ -7,7 +7,6 @@ import type {
|
||||
APIApplicationRoleConnection,
|
||||
GuildFeature,
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
@@ -27,16 +26,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
@@ -61,6 +60,12 @@ export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
* @default 200
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Include approximate member and presence counts in response
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
@@ -70,6 +75,8 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
approximate_member_count?: number;
|
||||
approximate_presence_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,15 +121,15 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name?: string;
|
||||
platform_name?: string | undefined;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username?: string;
|
||||
platform_username?: string | undefined;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata?: Record<string, string | number>;
|
||||
metadata?: Record<string, string | number> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
@@ -23,8 +23,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}>;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
@@ -54,22 +54,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
}>;
|
||||
channel_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
@@ -99,35 +99,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
username?: string | undefined;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
avatar_url?: string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -135,22 +135,22 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
flags?: MessageFlags | undefined;
|
||||
/**
|
||||
* Name of thread to create
|
||||
*
|
||||
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
|
||||
*/
|
||||
thread_name?: string;
|
||||
}>;
|
||||
thread_name?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
@@ -160,7 +160,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -237,21 +237,28 @@ export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params
|
||||
*/
|
||||
export interface RESTGetAPIWebhookWithTokenMessageQuery {
|
||||
thread_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
}
|
||||
>;
|
||||
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
|
||||
> & {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
@@ -261,7 +268,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@ export interface APIAllowedMentionsSend {
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
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 | undefined;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT | undefined;
|
||||
position?: number | null | undefined;
|
||||
topic?: string | null | undefined;
|
||||
nsfw?: boolean | null | undefined;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
user_limit?: number | null | undefined;
|
||||
permission_overwrites?: APIOverwrite[] | null | undefined;
|
||||
parent_id?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,12 +100,12 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
content?: string | undefined;
|
||||
nonce?: number | string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embed?: APIEmbed | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
message_reference?: APIMessageReference | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,19 +117,19 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
content?: string | undefined;
|
||||
nonce?: number | string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embed?: APIEmbed | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
message_reference?: APIMessageReference | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
@@ -141,10 +141,10 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
content?: string | null | undefined;
|
||||
embed?: APIEmbed | null | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null | undefined;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,12 +240,12 @@ export type RESTGetAPIChannelInvitesResult = APIInvite[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
max_age?: number | undefined;
|
||||
max_uses?: number | undefined;
|
||||
temporary?: boolean | undefined;
|
||||
unique?: boolean | undefined;
|
||||
target_user_id?: string | undefined;
|
||||
target_user_type?: InviteTargetUserType | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,7 +277,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
roles?: string[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,8 +35,8 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
name?: string | undefined;
|
||||
roles?: string[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
124
rest/v6/guild.ts
124
rest/v6/guild.ts
@@ -32,9 +32,9 @@ export type APIGuildCreatePartialChannel = Partial<
|
||||
Pick<APIChannel, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'>
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -50,16 +50,16 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIGuildCreateRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: number | string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: number | string;
|
||||
region?: string | undefined;
|
||||
icon?: string | undefined;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
afk_channel_id?: number | string | undefined;
|
||||
afk_timeout?: number | undefined;
|
||||
system_channel_id?: number | string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,24 +91,24 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
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 | undefined;
|
||||
region?: string | undefined;
|
||||
verification_level?: GuildVerificationLevel | undefined;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
|
||||
explicit_content_filter?: GuildExplicitContentFilter | undefined;
|
||||
afk_channel_id?: string | null | undefined;
|
||||
afk_timeout?: number | undefined;
|
||||
icon?: string | null | undefined;
|
||||
owner_id?: string | undefined;
|
||||
splash?: string | null | undefined;
|
||||
discovery_splash?: string | null | undefined;
|
||||
banner?: string | null | undefined;
|
||||
system_channel_id?: string | null | undefined;
|
||||
rules_channel_id?: string | null | undefined;
|
||||
public_updates_channel_id?: string | null | undefined;
|
||||
preferred_locale?: string | undefined;
|
||||
features?: GuildFeature[] | undefined;
|
||||
description?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,8 +152,8 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
lock_permissions?: boolean | undefined;
|
||||
parent_id?: string | null | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -200,10 +200,10 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
nick?: string | undefined;
|
||||
roles?: string[] | undefined;
|
||||
mute?: boolean | undefined;
|
||||
deaf?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,11 +216,11 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
roles?: string[] | null | undefined;
|
||||
mute?: boolean | null | undefined;
|
||||
deaf?: boolean | null | undefined;
|
||||
channel_id?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +233,7 @@ export type RESTPatchAPIGuildMemberResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
nick?: string | null;
|
||||
nick?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,8 +276,8 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
delete_message_days?: number | undefined;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,11 +302,11 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
name?: string | null | undefined;
|
||||
permissions?: number | string | null | undefined;
|
||||
color?: number | null | undefined;
|
||||
hoist?: boolean | null | undefined;
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,7 +320,7 @@ export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position?: number;
|
||||
position?: number | undefined;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -333,11 +333,11 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
name?: string | undefined;
|
||||
permissions?: number | string | undefined;
|
||||
color?: number | undefined;
|
||||
hoist?: boolean | undefined;
|
||||
mentionable?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,9 +378,9 @@ export interface RESTGetAPIGuildPruneCountResult {
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
days?: number | undefined;
|
||||
compute_prune_count?: boolean | undefined;
|
||||
include_roles?: string[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -434,9 +434,9 @@ export type RESTPostAPIGuildIntegrationResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildIntegrationJSONBody {
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
expire_behavior?: IntegrationExpireBehavior | null | undefined;
|
||||
expire_grace_period?: number | null | undefined;
|
||||
enable_emoticons?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ export type RESTGetAPIUserResult = APIUser;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
username?: string | undefined;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/index';
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
avatar?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,9 +44,9 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
name?: string | undefined;
|
||||
avatar?: string | null | undefined;
|
||||
channel_id?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,12 +81,12 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
content?: string | undefined;
|
||||
username?: string | undefined;
|
||||
avatar_url?: string | undefined;
|
||||
tts?: boolean | undefined;
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
allowed_mentions?: APIAllowedMentionsSend | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
|
||||
@@ -36,13 +36,13 @@ export type RESTGetAPIChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 1-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
@@ -50,25 +50,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText | undefined;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
position?: number | null;
|
||||
position?: number | null | undefined;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
topic?: string | null;
|
||||
topic?: string | null | undefined;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, news, store
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
nsfw?: boolean | null | undefined;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
@@ -76,44 +76,44 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
rate_limit_per_user?: number | null | undefined;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
bitrate?: number | null | undefined;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
user_limit?: number | null | undefined;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null;
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, news, store, voice
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
parent_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
rtc_region?: string | null | undefined;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
}>;
|
||||
video_quality_mode?: VideoQualityMode | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
@@ -169,79 +169,78 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
}>;
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
content?: string | undefined;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
nonce?: number | string | undefined;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
tts?: boolean | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
embeds?: APIEmbed[] | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed;
|
||||
embed?: APIEmbed | undefined;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
allowed_mentions?: APIAllowedMentions | undefined;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
|
||||
/**
|
||||
* IDs of up to 3 stickers in the server to send in the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
}>;
|
||||
flags?: MessageFlags | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -252,7 +251,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -325,24 +324,24 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
content?: string | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content (up to 6000 characters)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds?: APIEmbed[] | null;
|
||||
embeds?: APIEmbed[] | null | undefined;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
* @deprecated Use `embeds` instead
|
||||
*/
|
||||
embed?: APIEmbed | null;
|
||||
embed?: APIEmbed | null | undefined;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
@@ -351,13 +350,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
flags?: MessageFlags | null | undefined;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
allowed_mentions?: APIAllowedMentions | null | undefined;
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
@@ -365,14 +364,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
|
||||
}>;
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -383,7 +382,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
@@ -428,7 +427,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
allow?: Permissions | null;
|
||||
allow?: Permissions | null | undefined;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
@@ -436,7 +435,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
*
|
||||
* @default "0"
|
||||
*/
|
||||
deny?: Permissions | null;
|
||||
deny?: Permissions | null | undefined;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
@@ -459,51 +458,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
max_age?: number | undefined;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
max_uses?: number | undefined;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
temporary?: boolean | undefined;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
unique?: boolean | undefined;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
target_type?: InviteTargetType | undefined;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
target_user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}>;
|
||||
target_application_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
@@ -562,7 +561,7 @@ export type RESTDeleteAPIChannelPinResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
@@ -570,8 +569,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}>;
|
||||
nick?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIEmoji } from '../../payloads/v8/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
@@ -18,7 +17,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
@@ -32,8 +31,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}>;
|
||||
roles?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
@@ -45,16 +44,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}>;
|
||||
roles?: Snowflake[] | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user