Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: switch to sapphire/*@v2 and discord.js@dev #227

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Jul 17, 2021

⚠️ Pending for sapphiredev/utilities#135 to land for discord.js@dev
  • Added CommandPreConditions.GuildNewsThreadOnly.
  • Added CommandPreConditions.GuildPrivateThreadOnly.
  • Added CommandPreConditions.GuildPublicThreadOnly.
  • Added CommandPreConditions.GuildThreadOnly.
  • Added Identifiers.PreconditionGuildNewsThreadOnly.
  • Added Identifiers.PreconditionGuildPrivateThreadOnly.
  • Added Identifiers.PreconditionGuildPublicThreadOnly.
  • Added Identifiers.PreconditionThreadOnly.
  • Added Preconditions.GuildNewsThreadOnly.
  • Added Preconditions.GuildPrivateThreadOnly.
  • Added Preconditions.GuildPublicThreadOnly.
  • Added Preconditions.GuildThreadOnly.
  • Added the guildNewsThreadChannel argument type.
  • Added the guildPrivateThreadChannel argument type.
  • Added the guildPublicThreadChannel argument type.
  • Added the guildStageVoiceChannel argument type.
  • Added the guildThreadChannel argument type.
  • Changed GuildNewsOnly precondition to allow GUILD_NEWS_THREAD.
  • Changed GuildTextOnly precondition to allow GUILD_PUBLIC_THREAD and GUILD_PRIVATE_THREAD.
  • Fixed CoreMessage event not filtering webhooks in v13.
  • Fixed CoreMessageParser event not checking for DM channel correctly in v13.
  • Updated Cooldown precondition to use @sapphire/[email protected].
  • Updated Permissions precondition to support USE_APPLICATION_COMMANDS.
  • Updated Permissions precondition to support USE_PRIVATE_THREADS.
  • Updated Permissions precondition to support USE_PUBLIC_THREADS.
  • ⚠️ BREAKING CHANGE: Changed guildChannel argument to return GuildChannel | ThreadChannel.
  • ⚠️ BREAKING CHANGE: Changed SapphireClient.id's type to Snowflake | null.
  • ⚠️ BREAKING CHANGE: Changed SapphireClientOptions.id's type to Snowflake | null.
  • ⚠️ BREAKING CHANGE: Removed Events.GuildMemberSpeaking.
  • ⚠️ BREAKING CHANGE: Removed StoreRegistry, it is now re-exported from @sapphire/pieces.
  • ⚠️ BREAKING CHANGE: Renamed ArgType.categoryChannel to guildCategoryChannel.
  • ⚠️ BREAKING CHANGE: Renamed ArgType.newsChannel to guildNewsChannel.
  • ⚠️ BREAKING CHANGE: Renamed ArgType.textChannel to guildTextChannel.
  • ⚠️ BREAKING CHANGE: Renamed ArgType.voiceChannel to guildVoiceChannel.
  • ⚠️ BREAKING CHANGE: Renamed CommandPreConditions.NewsOnly to GuildNewsOnly.
  • ⚠️ BREAKING CHANGE: Renamed CommandPreConditions.TextOnly to GuildTextOnly.
  • ⚠️ BREAKING CHANGE: Renamed Identifiers.PreconditionNewsOnly to PreconditionGuildNewsOnly.
  • ⚠️ BREAKING CHANGE: Renamed Identifiers.PreconditionTextOnly to PreconditionGuildTextOnly.
  • ⚠️ BREAKING CHANGE: Renamed Preconditions.NewsOnly to GuildNewsOnly.
  • ⚠️ BREAKING CHANGE: Renamed Preconditions.TextOnly to GuildTextOnly.
  • ⚠️ BREAKING CHANGE: Renamed the possible values for CommandOptionsRunType.
  • ⚠️ BREAKING CHANGE: Updated CooldownContext.delay to not be optional.
  • ⚠️ BREAKING CHANGE: Updated discord.js requirement to v13.

TODO

  • Write changelog
  • Update news and text preconditions to resolve threads
  • Update @sapphire/discord.js-utilities

@kyranet kyranet requested review from favna and vladfrangu July 17, 2021 10:35
@kyranet kyranet force-pushed the refactor/update-for-v2-and-v13 branch from d0e3c15 to 0262bba Compare July 17, 2021 10:53
@kyranet kyranet force-pushed the refactor/update-for-v2-and-v13 branch 3 times, most recently from 22d8952 to 9496e07 Compare July 18, 2021 21:29
@kyranet kyranet marked this pull request as ready for review July 18, 2021 21:29
@kyranet kyranet force-pushed the refactor/update-for-v2-and-v13 branch from 9496e07 to 5a7b56b Compare July 18, 2021 21:31
@@ -131,7 +131,7 @@ export abstract class Command<T = Args> extends AliasPiece {
*/
protected parseConstructorPreConditionsRunIn(options: CommandOptions) {
const runIn = this.resolveConstructorPreConditionsRunType(options.runIn);
if (runIn !== null) this.preconditions.append(runIn);
if (runIn !== null) this.preconditions.append(runIn as any);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this cast now needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because preconditions.append has two separate overloads, and runIn returns both simultaneously.

@kyranet kyranet force-pushed the refactor/update-for-v2-and-v13 branch from 5a7b56b to 1f629dd Compare July 18, 2021 21:42
Added `CommandPreConditions.GuildNewsThreadOnly`.
Added `CommandPreConditions.GuildPrivateThreadOnly`.
Added `CommandPreConditions.GuildPublicThreadOnly`.
Added `CommandPreConditions.GuildThreadOnly`.
Added `Identifiers.PreconditionGuildNewsThreadOnly`.
Added `Identifiers.PreconditionGuildPrivateThreadOnly`.
Added `Identifiers.PreconditionGuildPublicThreadOnly`.
Added `Identifiers.PreconditionThreadOnly`.
Added `Preconditions.GuildNewsThreadOnly`.
Added `Preconditions.GuildPrivateThreadOnly`.
Added `Preconditions.GuildPublicThreadOnly`.
Added `Preconditions.GuildThreadOnly`.
Added the `guildNewsThreadChannel` argument type.
Added the `guildPrivateThreadChannel` argument type.
Added the `guildPublicThreadChannel` argument type.
Added the `guildStageVoiceChannel` argument type.
Added the `guildThreadChannel` argument type.
Changed `GuildNewsOnly` precondition to allow `GUILD_NEWS_THREAD`.
Changed `GuildTextOnly` precondition to allow `GUILD_PUBLIC_THREAD` and `GUILD_PRIVATE_THREAD`.
Fixed `CoreMessage` event not filtering webhooks in v13.
Fixed `CoreMessageParser` event not checking for DM channel correctly in v13.
Updated `Cooldown` precondition to use `@sapphire/[email protected]`.
Updated `Permissions` precondition to support `USE_APPLICATION_COMMANDS`.
Updated `Permissions` precondition to support `USE_PRIVATE_THREADS`.
Updated `Permissions` precondition to support `USE_PUBLIC_THREADS`.

BREAKING CHANGE: Changed `guildChannel` argument to return `GuildChannel | ThreadChannel`.
BREAKING CHANGE: Changed `SapphireClient.id`'s type to `Snowflake | null`.
BREAKING CHANGE: Changed `SapphireClientOptions.id`'s type to `Snowflake | null`.
BREAKING CHANGE: Removed `Events.GuildMemberSpeaking`.
BREAKING CHANGE: Removed `StoreRegistry`, it is now re-exported from `@sapphire/pieces`.
BREAKING CHANGE: Renamed `ArgType.categoryChannel` to `guildCategoryChannel`.
BREAKING CHANGE: Renamed `ArgType.newsChannel` to `guildNewsChannel`.
BREAKING CHANGE: Renamed `ArgType.textChannel` to `guildTextChannel`.
BREAKING CHANGE: Renamed `ArgType.voiceChannel` to `guildVoiceChannel`.
BREAKING CHANGE: Renamed `CommandPreConditions.NewsOnly` to `GuildNewsOnly`.
BREAKING CHANGE: Renamed `CommandPreConditions.TextOnly` to `GuildTextOnly`.
BREAKING CHANGE: Renamed `Identifiers.PreconditionNewsOnly` to `PreconditionGuildNewsOnly`.
BREAKING CHANGE: Renamed `Identifiers.PreconditionTextOnly` to `PreconditionGuildTextOnly`.
BREAKING CHANGE: Renamed `Preconditions.NewsOnly` to `GuildNewsOnly`.
BREAKING CHANGE: Renamed `Preconditions.TextOnly` to `GuildTextOnly`.
BREAKING CHANGE: Renamed the possible values for `CommandOptionsRunType`.
BREAKING CHANGE: Updated `CooldownContext.delay` to not be optional.
BREAKING CHANGE: Updated `discord.js` requirement to v13.
@kyranet kyranet force-pushed the refactor/update-for-v2-and-v13 branch from 1f629dd to 443587f Compare July 21, 2021 07:24
@kyranet kyranet requested a review from vladfrangu July 21, 2021 12:13
@kyranet kyranet merged commit cbf5d4e into main Jul 21, 2021
@kyranet kyranet deleted the refactor/update-for-v2-and-v13 branch July 21, 2021 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants