Precondition position

I think that precondition positions are not working
Solution:
as you can see in the link I sent we dont actually check for duplicate positions, it's just going to be pushed or sliced into the array regardless
Jump to solution
15 Replies
Favna
Favna3mo ago
huh what do you mean
čamdžić
čamdžićOP3mo ago
one sec imma explain
@ApplyOptions<Precondition.Options>({
position: 10
})
export class BotPrecondition extends Precondition {
}
@ApplyOptions<Precondition.Options>({
position: 10
})
export class BotPrecondition extends Precondition {
}
This is my precondition on position 10, and as far as I know Enabled precondition is on position 10 too
Favna
Favna3mo ago
that is correct
čamdžić
čamdžićOP3mo ago
@ApplyOptions<Command.Options>({
enabled: false
})
export class BotCommand extends Command {
}
@ApplyOptions<Command.Options>({
enabled: false
})
export class BotCommand extends Command {
}
When I disable command, it is disabled and maybe it shouldn't be because of 2 preconditions on same position
Favna
Favna3mo ago
if you're going to say it is or isn't run before or after enabled that's just a you issue, just assign it something lower or higher than 10... no that's not how it works. You cannot overwrite it by setting the same position
čamdžić
čamdžićOP3mo ago
so it is working like it should? im just asking and reporting a potential bug
čamdžić
čamdžićOP3mo ago
what if 2 preconditions are on same position
Favna
Favna3mo ago
read the code :meguFace: I'm sorry but this seems a really weird post
čamdžić
čamdžićOP3mo ago
.
Favna
Favna3mo ago
if you want it to be enabled, set enabled true if you want it to be disabled, set enabled false I have no idea what you're even trying to achieve
Spinel
Spinel3mo ago
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stack traces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards. - For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. - For an excellent video that shows how not to ask technical questions, watch this YouTube video by LiveOverflow. - Asking technical questions (Clarkson) - How to ask questions the smart way (Raymond)
čamdžić
čamdžićOP3mo ago
nothing, it always worked like this and i just realized that my precondition is on same position like enabled so maybe its a issue idk but it isnt i understand it now thank you lol
Solution
Favna
Favna3mo ago
as you can see in the link I sent we dont actually check for duplicate positions, it's just going to be pushed or sliced into the array regardless
čamdžić
čamdžićOP3mo ago
yep

Did you find this page helpful?