Global precondition error

I checked it may be related to the new update from Piece.Context -> Piece.LoaderContext Any idea how to solve it ?
No description
No description
Solution:
use AllFlowsPrecondition.LoaderContext instead
Jump to solution
4 Replies
Solution
Favna
Favna13mo ago
use AllFlowsPrecondition.LoaderContext instead
Favna
Favna13mo ago
FYI if you use decorators from @sapphire/decorators you do not have this issue for you can rewrite your code to:
@ApplyOptions<AllFlowsPrecondition.Options>({
position: 20
})
export class UserPrecondition extends AllFlowsPrecondition {
public override chatInputRun(interaction: ChatInputCommandInteraction) {
return this.checkUserRole(interaction);
}
}
@ApplyOptions<AllFlowsPrecondition.Options>({
position: 20
})
export class UserPrecondition extends AllFlowsPrecondition {
public override chatInputRun(interaction: ChatInputCommandInteraction) {
return this.checkUserRole(interaction);
}
}
Mateleo
MateleoOP13mo ago
perfect ! Maybe I can write a PR to update the doc ?
Favna
Favna13mo ago
please do! dragonheart
Want results from more Discord servers?
Add your server