-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d0e3c15
to
0262bba
Compare
22d8952
to
9496e07
Compare
9496e07
to
5a7b56b
Compare
vladfrangu
requested changes
Jul 18, 2021
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
5a7b56b
to
1f629dd
Compare
favna
requested changes
Jul 20, 2021
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.
1f629dd
to
443587f
Compare
favna
approved these changes
Jul 21, 2021
vladfrangu
approved these changes
Jul 21, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pending for sapphiredev/utilities#135 to land fordiscord.js@dev
CommandPreConditions.GuildNewsThreadOnly
.CommandPreConditions.GuildPrivateThreadOnly
.CommandPreConditions.GuildPublicThreadOnly
.CommandPreConditions.GuildThreadOnly
.Identifiers.PreconditionGuildNewsThreadOnly
.Identifiers.PreconditionGuildPrivateThreadOnly
.Identifiers.PreconditionGuildPublicThreadOnly
.Identifiers.PreconditionThreadOnly
.Preconditions.GuildNewsThreadOnly
.Preconditions.GuildPrivateThreadOnly
.Preconditions.GuildPublicThreadOnly
.Preconditions.GuildThreadOnly
.guildNewsThreadChannel
argument type.guildPrivateThreadChannel
argument type.guildPublicThreadChannel
argument type.guildStageVoiceChannel
argument type.guildThreadChannel
argument type.GuildNewsOnly
precondition to allowGUILD_NEWS_THREAD
.GuildTextOnly
precondition to allowGUILD_PUBLIC_THREAD
andGUILD_PRIVATE_THREAD
.CoreMessage
event not filtering webhooks in v13.CoreMessageParser
event not checking for DM channel correctly in v13.Cooldown
precondition to use@sapphire/[email protected]
.Permissions
precondition to supportUSE_APPLICATION_COMMANDS
.Permissions
precondition to supportUSE_PRIVATE_THREADS
.Permissions
precondition to supportUSE_PUBLIC_THREADS
.guildChannel
argument to returnGuildChannel | ThreadChannel
.SapphireClient.id
's type toSnowflake | null
.SapphireClientOptions.id
's type toSnowflake | null
.Events.GuildMemberSpeaking
.StoreRegistry
, it is now re-exported from@sapphire/pieces
.ArgType.categoryChannel
toguildCategoryChannel
.ArgType.newsChannel
toguildNewsChannel
.ArgType.textChannel
toguildTextChannel
.ArgType.voiceChannel
toguildVoiceChannel
.CommandPreConditions.NewsOnly
toGuildNewsOnly
.CommandPreConditions.TextOnly
toGuildTextOnly
.Identifiers.PreconditionNewsOnly
toPreconditionGuildNewsOnly
.Identifiers.PreconditionTextOnly
toPreconditionGuildTextOnly
.Preconditions.NewsOnly
toGuildNewsOnly
.Preconditions.TextOnly
toGuildTextOnly
.CommandOptionsRunType
.CooldownContext.delay
to not be optional.discord.js
requirement to v13.TODO
@sapphire/discord.js-utilities