mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-23 12:00:09 +00:00
Compare commits
1 Commits
@discordjs
...
@discordjs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d63bcbb9d4 |
2
.github/labels.yml
vendored
2
.github/labels.yml
vendored
@@ -8,8 +8,6 @@
|
||||
color: fbca04
|
||||
- name: backlog
|
||||
color: 7ef7ef
|
||||
- name: backport
|
||||
color: 88aabb
|
||||
- name: blocked
|
||||
color: fc1423
|
||||
- name: bug
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [@discordjs/core@0.3.0](https://github.com/discordjs/discord.js/compare/@discordjs/core@0.2.0...@discordjs/core@0.3.0) - (2022-12-16)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **core:** Instantiate/export role connections ([166f742](https://github.com/discordjs/discord.js/commit/166f742d02d475a5044f935ee638ae1e25075b9c))
|
||||
|
||||
# [@discordjs/core@0.2.0](https://github.com/discordjs/discord.js/tree/@discordjs/core@0.2.0) - (2022-12-16)
|
||||
|
||||
## Bug Fixes
|
||||
@@ -21,3 +15,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Add links to each routes documentation (#8898) ([73300c7](https://github.com/discordjs/discord.js/commit/73300c75fae7df9af293f7c03b179236679fb753))
|
||||
- **interactions:** Add `messageId` parameter to `deleteReply()` (#8896) ([3f555d5](https://github.com/discordjs/discord.js/commit/3f555d5ddf53b778fc0e69e1ff77ec93d876dcdb))
|
||||
- Add `@discordjs/core` (#8736) ([2127b32](https://github.com/discordjs/discord.js/commit/2127b32d26dedeb44ec43d16ec2e2046919f9bb0))
|
||||
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@discordjs/core",
|
||||
"version": "0.3.0",
|
||||
"version": "0.2.0",
|
||||
"description": "A thinly abstracted wrapper around the rest API, and gateway.",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ChannelsAPI } from './channel.js';
|
||||
import { GuildsAPI } from './guild.js';
|
||||
import { InteractionsAPI } from './interactions.js';
|
||||
import { InvitesAPI } from './invite.js';
|
||||
import { RoleConnectionsAPI } from './roleConnections.js';
|
||||
import { StickersAPI } from './sticker.js';
|
||||
import { ThreadsAPI } from './thread.js';
|
||||
import { UsersAPI } from './user.js';
|
||||
@@ -16,7 +15,6 @@ export * from './channel.js';
|
||||
export * from './guild.js';
|
||||
export * from './interactions.js';
|
||||
export * from './invite.js';
|
||||
export * from './roleConnections.js';
|
||||
export * from './sticker.js';
|
||||
export * from './thread.js';
|
||||
export * from './user.js';
|
||||
@@ -34,8 +32,6 @@ export class API {
|
||||
|
||||
public readonly invites: InvitesAPI;
|
||||
|
||||
public readonly roleConnections: RoleConnectionsAPI;
|
||||
|
||||
public readonly stickers: StickersAPI;
|
||||
|
||||
public readonly threads: ThreadsAPI;
|
||||
@@ -51,7 +47,6 @@ export class API {
|
||||
this.channels = new ChannelsAPI(rest);
|
||||
this.guilds = new GuildsAPI(rest);
|
||||
this.invites = new InvitesAPI(rest);
|
||||
this.roleConnections = new RoleConnectionsAPI(rest);
|
||||
this.stickers = new StickersAPI(rest);
|
||||
this.threads = new ThreadsAPI(rest);
|
||||
this.users = new UsersAPI(rest);
|
||||
|
||||
@@ -51,12 +51,11 @@
|
||||
"dependencies": {
|
||||
"@discordjs/builders": "workspace:^",
|
||||
"@discordjs/collection": "workspace:^",
|
||||
"@discordjs/formatters": "workspace:^",
|
||||
"@discordjs/rest": "workspace:^",
|
||||
"@discordjs/util": "workspace:^",
|
||||
"@sapphire/snowflake": "^3.2.2",
|
||||
"@types/ws": "^8.5.3",
|
||||
"discord-api-types": "^0.37.23",
|
||||
"discord-api-types": "^0.37.20",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"tslib": "^2.4.1",
|
||||
|
||||
@@ -56,7 +56,6 @@ class CategoryChannelChildManager extends DataManager {
|
||||
* @property {ThreadAutoArchiveDuration} [defaultAutoArchiveDuration]
|
||||
* The default auto archive duration for all new threads in this channel
|
||||
* @property {SortOrderType} [defaultSortOrder] The default sort order mode used to order posts (forum only).
|
||||
* @property {ForumLayoutType} [defaultForumLayout] The default layout used to display posts (forum only).
|
||||
* @property {string} [reason] Reason for creating the new channel
|
||||
*/
|
||||
|
||||
|
||||
@@ -161,7 +161,6 @@ class GuildChannelManager extends CachedManager {
|
||||
defaultReactionEmoji,
|
||||
defaultAutoArchiveDuration,
|
||||
defaultSortOrder,
|
||||
defaultForumLayout,
|
||||
reason,
|
||||
}) {
|
||||
parent &&= this.client.channels.resolveId(parent);
|
||||
@@ -185,7 +184,6 @@ class GuildChannelManager extends CachedManager {
|
||||
default_reaction_emoji: defaultReactionEmoji && transformGuildDefaultReaction(defaultReactionEmoji),
|
||||
default_auto_archive_duration: defaultAutoArchiveDuration,
|
||||
default_sort_order: defaultSortOrder,
|
||||
default_forum_layout: defaultForumLayout,
|
||||
},
|
||||
reason,
|
||||
});
|
||||
@@ -254,7 +252,6 @@ class GuildChannelManager extends CachedManager {
|
||||
* @property {number} [defaultThreadRateLimitPerUser] The rate limit per user (slowmode) to set on forum posts
|
||||
* @property {ChannelFlagsResolvable} [flags] The flags to set on the channel
|
||||
* @property {?SortOrderType} [defaultSortOrder] The default sort order mode to set on the channel
|
||||
* @property {ForumLayoutType} [defaultForumLayout] The default forum layout to set on the channel
|
||||
* @property {string} [reason] Reason for editing this channel
|
||||
*/
|
||||
|
||||
@@ -317,7 +314,6 @@ class GuildChannelManager extends CachedManager {
|
||||
default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
|
||||
flags: 'flags' in options ? ChannelFlagsBitField.resolve(options.flags) : undefined,
|
||||
default_sort_order: options.defaultSortOrder,
|
||||
default_forum_layout: options.defaultForumLayout,
|
||||
},
|
||||
reason: options.reason,
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ class GuildForumThreadManager extends ThreadManager {
|
||||
|
||||
/**
|
||||
* @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
|
||||
* @property {StickerResolvable} [stickers] The stickers to send with the message
|
||||
* @property {stickers} [stickers] The stickers to send with the message
|
||||
* @property {BitFieldResolvable} [flags] The flags to send with the message
|
||||
*/
|
||||
|
||||
|
||||
@@ -134,12 +134,6 @@ class ForumChannel extends GuildChannel {
|
||||
} else {
|
||||
this.defaultSortOrder ??= null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default layout type used to display posts
|
||||
* @type {ForumLayoutType}
|
||||
*/
|
||||
this.defaultForumLayout = data.default_forum_layout;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,16 +225,6 @@ class ForumChannel extends GuildChannel {
|
||||
return this.edit({ defaultSortOrder, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default forum layout type used to display posts
|
||||
* @param {ForumLayoutType} defaultForumLayout The default forum layout type to set on this channel
|
||||
* @param {string} [reason] Reason for changing the default forum layout
|
||||
* @returns {Promise<ForumChannel>}
|
||||
*/
|
||||
setDefaultForumLayout(defaultForumLayout, reason) {
|
||||
return this.edit({ defaultForumLayout, reason });
|
||||
}
|
||||
|
||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||
/* eslint-disable no-empty-function */
|
||||
createWebhook() {}
|
||||
|
||||
@@ -218,11 +218,6 @@
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ComponentType}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external ForumLayoutType
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ForumLayoutType}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external GatewayCloseCodes
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GatewayCloseCodes}
|
||||
|
||||
@@ -477,14 +477,13 @@ function resolveColor(color) {
|
||||
if (typeof color === 'string') {
|
||||
if (color === 'Random') return Math.floor(Math.random() * (0xffffff + 1));
|
||||
if (color === 'Default') return 0;
|
||||
if (/^#?[\da-f]{6}$/i.test(color)) return parseInt(color.replace('#', ''), 16);
|
||||
color = Colors[color];
|
||||
color = Colors[color] ?? parseInt(color.replace('#', ''), 16);
|
||||
} else if (Array.isArray(color)) {
|
||||
color = (color[0] << 16) + (color[1] << 8) + color[2];
|
||||
}
|
||||
|
||||
if (color < 0 || color > 0xffffff) throw new DiscordjsRangeError(ErrorCodes.ColorRange);
|
||||
if (typeof color !== 'number' || Number.isNaN(color)) throw new DiscordjsTypeError(ErrorCodes.ColorConvert);
|
||||
else if (Number.isNaN(color)) throw new DiscordjsTypeError(ErrorCodes.ColorConvert);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
5
packages/discord.js/typings/index.d.ts
vendored
5
packages/discord.js/typings/index.d.ts
vendored
@@ -149,7 +149,6 @@ import {
|
||||
AuditLogRuleTriggerType,
|
||||
GatewayAutoModerationActionExecutionDispatchData,
|
||||
APIAutoModerationRule,
|
||||
ForumLayoutType,
|
||||
} from 'discord-api-types/v10';
|
||||
import { ChildProcess } from 'node:child_process';
|
||||
import { EventEmitter } from 'node:events';
|
||||
@@ -2254,7 +2253,6 @@ export class ForumChannel extends TextBasedChannelMixin(GuildChannel, true, [
|
||||
public nsfw: boolean;
|
||||
public topic: string | null;
|
||||
public defaultSortOrder: SortOrderType | null;
|
||||
public defaultForumLayout: ForumLayoutType;
|
||||
|
||||
public setAvailableTags(tags: GuildForumTagData[], reason?: string): Promise<this>;
|
||||
public setDefaultReactionEmoji(emojiId: DefaultReactionEmoji | null, reason?: string): Promise<this>;
|
||||
@@ -2267,7 +2265,6 @@ export class ForumChannel extends TextBasedChannelMixin(GuildChannel, true, [
|
||||
): Promise<this>;
|
||||
public setTopic(topic: string | null, reason?: string): Promise<this>;
|
||||
public setDefaultSortOrder(defaultSortOrder: SortOrderType | null, reason?: string): Promise<this>;
|
||||
public setDefaultForumLayout(defaultForumLayout: ForumLayoutType, reason?: string): Promise<this>;
|
||||
}
|
||||
|
||||
export class PermissionOverwrites extends Base {
|
||||
@@ -4587,7 +4584,6 @@ export interface CategoryCreateChannelOptions {
|
||||
defaultReactionEmoji?: DefaultReactionEmoji;
|
||||
defaultAutoArchiveDuration?: ThreadAutoArchiveDuration;
|
||||
defaultSortOrder?: SortOrderType;
|
||||
defaultForumLayout?: ForumLayoutType;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
@@ -5338,7 +5334,6 @@ export interface GuildChannelEditOptions {
|
||||
defaultThreadRateLimitPerUser?: number;
|
||||
flags?: ChannelFlagsResolvable;
|
||||
defaultSortOrder?: SortOrderType | null;
|
||||
defaultForumLayout?: ForumLayoutType;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [@discordjs/formatters@0.1.0](https://github.com/discordjs/discord.js/tree/@discordjs/formatters@0.1.0) - (2022-12-16)
|
||||
|
||||
## Features
|
||||
|
||||
- Add `@discordjs/formatters` (#8889) ([3fca638](https://github.com/discordjs/discord.js/commit/3fca638a8470dcea2f79ddb9f18526dbc0017c88))
|
||||
|
||||
12
yarn.lock
12
yarn.lock
@@ -8457,7 +8457,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"discord-api-types@npm:^0.37.20, discord-api-types@npm:^0.37.23":
|
||||
"discord-api-types@npm:^0.37.20":
|
||||
version: 0.37.20
|
||||
resolution: "discord-api-types@npm:0.37.20"
|
||||
checksum: 88ebed85aada3483e83ac46a1b4574c0d59948060ac72f451d658fa646b20d62bd6f21792043621dcc5a9e9353d95c25de70646b8d2a93f0022154345800b26c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"discord-api-types@npm:^0.37.23":
|
||||
version: 0.37.23
|
||||
resolution: "discord-api-types@npm:0.37.23"
|
||||
checksum: 68c385366ccec523c35db4048f2c0d1fcd979fefb620ba57707dc648d0e647b817047a03682d9cac2e9e9a1642f2129ad343ac66a7a9b1e0d6bf53bc5eb11f37
|
||||
@@ -8471,14 +8478,13 @@ __metadata:
|
||||
"@discordjs/builders": "workspace:^"
|
||||
"@discordjs/collection": "workspace:^"
|
||||
"@discordjs/docgen": "workspace:^"
|
||||
"@discordjs/formatters": "workspace:^"
|
||||
"@discordjs/rest": "workspace:^"
|
||||
"@discordjs/util": "workspace:^"
|
||||
"@favware/cliff-jumper": ^1.9.0
|
||||
"@sapphire/snowflake": ^3.2.2
|
||||
"@types/node": 16.18.4
|
||||
"@types/ws": ^8.5.3
|
||||
discord-api-types: ^0.37.23
|
||||
discord-api-types: ^0.37.20
|
||||
dtslint: ^4.2.1
|
||||
eslint: ^8.28.0
|
||||
eslint-formatter-pretty: ^4.1.0
|
||||
|
||||
Reference in New Issue
Block a user