mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Merge branch 'main' into refactor/use-proper-variable-names
This commit is contained in:
7
.github/CONTRIBUTING.md
vendored
7
.github/CONTRIBUTING.md
vendored
@@ -43,5 +43,8 @@ If you'd like to create another package under the `@discordjs` organization run
|
||||
pnpm run create-package <package-name> [package-description]
|
||||
```
|
||||
|
||||
This will create new package directory under `packages/` with the required configuration files. You can
|
||||
begin to make changes within the `src/` directory. It may also be required to update the CODEOWNERS file.
|
||||
This will create new package directory under `packages/` with the required configuration files. You may begin
|
||||
to make changes within the `src/` directory. You may also need to:
|
||||
|
||||
- Update workflows that utilize packages
|
||||
- Update the CODEOWNERS file
|
||||
|
||||
50
.github/workflows/deprecate-version.yml
vendored
Normal file
50
.github/workflows/deprecate-version.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Deprecate version
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
package:
|
||||
description: Package
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- '@discordjs/brokers'
|
||||
- '@discordjs/builders'
|
||||
- '@discordjs/collection'
|
||||
- '@discordjs/core'
|
||||
- create-discord-bot
|
||||
- '@discordjs/formatters'
|
||||
- discord.js
|
||||
- '@discordjs/next'
|
||||
- '@discordjs/proxy'
|
||||
- '@discordjs/rest'
|
||||
- '@discordjs/util'
|
||||
- '@discordjs/voice'
|
||||
- '@discordjs/ws'
|
||||
version:
|
||||
description: Version(s)
|
||||
required: true
|
||||
type: string
|
||||
message:
|
||||
description: Deprecation message
|
||||
required: false
|
||||
type: string
|
||||
jobs:
|
||||
deprecate:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js v18
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./packages/actions/src/pnpmCache
|
||||
|
||||
- name: Deprecate
|
||||
run: pnpm exec npm-deprecate --name "${{inputs.version}}" --message "${{inputs.message || 'This version is deprecated. Please use a newer version.'}}" --package ${{inputs.package}}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
26
.github/workflows/npm-auto-deprecate.yml
vendored
26
.github/workflows/npm-auto-deprecate.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: npm auto deprecate
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * *'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
npm-auto-deprecate:
|
||||
name: npm auto deprecate
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install node.js v18
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./packages/actions/src/pnpmCache
|
||||
|
||||
- name: Deprecate versions
|
||||
run: 'pnpm exec npm-deprecate --name "*dev*" --package @discordjs/brokers @discordjs/builders @discordjs/collection @discordjs/core @discordjs/formatters discord.js @discordjs/next @discordjs/proxy @discordjs/rest @discordjs/util @discordjs/voice @discordjs/ws'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
5
.github/workflows/publish-dev.yml
vendored
5
.github/workflows/publish-dev.yml
vendored
@@ -63,3 +63,8 @@ jobs:
|
||||
pnpm --filter=${{ matrix.package }} publish --no-git-checks --tag dev || true
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
- name: Deprecate prior development releases
|
||||
run: pnpm exec npm-deprecate --name "*dev*" --message "This version is deprecated. Please use a newer version." --package ${{ matrix.package }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
2
.github/workflows/publish-release.yml
vendored
2
.github/workflows/publish-release.yml
vendored
@@ -36,4 +36,4 @@ jobs:
|
||||
run: |
|
||||
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish
|
||||
env:
|
||||
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
@@ -50,6 +50,8 @@ class CategoryChannelChildManager extends DataManager {
|
||||
* @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds
|
||||
* @property {string} [rtcRegion] The specific region of the new channel.
|
||||
* @property {VideoQualityMode} [videoQualityMode] The camera video quality mode of the voice channel
|
||||
* @property {number} [defaultThreadRateLimitPerUser] The initial rate limit per user (slowmode)
|
||||
* to set on newly created threads in a channel.
|
||||
* @property {GuildForumTagData[]} [availableTags] The tags that can be used in this channel (forum only).
|
||||
* @property {DefaultReactionEmoji} [defaultReactionEmoji]
|
||||
* The emoji to show in the add reaction button on a thread in a guild forum channel.
|
||||
|
||||
@@ -157,6 +157,7 @@ class GuildChannelManager extends CachedManager {
|
||||
rateLimitPerUser,
|
||||
rtcRegion,
|
||||
videoQualityMode,
|
||||
defaultThreadRateLimitPerUser,
|
||||
availableTags,
|
||||
defaultReactionEmoji,
|
||||
defaultAutoArchiveDuration,
|
||||
@@ -181,6 +182,7 @@ class GuildChannelManager extends CachedManager {
|
||||
rate_limit_per_user: rateLimitPerUser,
|
||||
rtc_region: rtcRegion,
|
||||
video_quality_mode: videoQualityMode,
|
||||
default_thread_rate_limit_per_user: defaultThreadRateLimitPerUser,
|
||||
available_tags: availableTags?.map(availableTag => transformGuildForumTag(availableTag)),
|
||||
default_reaction_emoji: defaultReactionEmoji && transformGuildDefaultReaction(defaultReactionEmoji),
|
||||
default_auto_archive_duration: defaultAutoArchiveDuration,
|
||||
|
||||
@@ -74,6 +74,16 @@ class BaseGuildTextChannel extends GuildChannel {
|
||||
this.defaultAutoArchiveDuration = data.default_auto_archive_duration;
|
||||
}
|
||||
|
||||
if ('default_thread_rate_limit_per_user' in data) {
|
||||
/**
|
||||
* The initial rate limit per user (slowmode) to set on newly created threads in a channel.
|
||||
* @type {?number}
|
||||
*/
|
||||
this.defaultThreadRateLimitPerUser = data.default_thread_rate_limit_per_user;
|
||||
} else {
|
||||
this.defaultThreadRateLimitPerUser ??= null;
|
||||
}
|
||||
|
||||
if ('messages' in data) {
|
||||
for (const message of data.messages) this.messages._add(message);
|
||||
}
|
||||
|
||||
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
@@ -636,6 +636,7 @@ export class BaseGuildEmoji extends Emoji {
|
||||
export class BaseGuildTextChannel extends TextBasedChannelMixin(GuildChannel, true) {
|
||||
protected constructor(guild: Guild, data?: RawGuildChannelData, client?: Client<true>, immediatePatch?: boolean);
|
||||
public defaultAutoArchiveDuration?: ThreadAutoArchiveDuration;
|
||||
public defaultThreadRateLimitPerUser: number | null;
|
||||
public rateLimitPerUser: number | null;
|
||||
public nsfw: boolean;
|
||||
public threads: GuildTextThreadManager<AllowedThreadTypeForTextChannel | AllowedThreadTypeForNewsChannel>;
|
||||
@@ -4823,6 +4824,7 @@ export interface CategoryCreateChannelOptions {
|
||||
position?: number;
|
||||
rtcRegion?: string;
|
||||
videoQualityMode?: VideoQualityMode;
|
||||
defaultThreadRateLimitPerUser?: number;
|
||||
availableTags?: GuildForumTagData[];
|
||||
defaultReactionEmoji?: DefaultReactionEmoji;
|
||||
defaultAutoArchiveDuration?: ThreadAutoArchiveDuration;
|
||||
|
||||
Reference in New Issue
Block a user