Add ability to sacrifice multiple cards at once #354

Merged
Vylpes merged 4 commits from feature/337-sacrifice-multiple into develop 2024-09-15 16:57:25 +01:00
Owner
  • The /sacrifice command now accepts an optional parameter to be able to specify the quantity
  • The Sacrifice button event now accepts a parameter to specify the quantity, this one is required but the command will default it to 1 if not supplied

#337

- The `/sacrifice` command now accepts an optional parameter to be able to specify the quantity - The `Sacrifice` button event now accepts a parameter to specify the quantity, this one is required but the command will default it to 1 if not supplied #337
Vylpes added 3 commits 2024-09-06 18:11:27 +01:00
Vylpes requested review from VylpesTester 2024-09-06 18:11:31 +01:00
Vylpes added the
type
change
label 2024-09-06 18:11:33 +01:00
VylpesTester was assigned by Vylpes 2024-09-06 18:11:37 +01:00
VylpesTester requested changes 2024-09-07 16:54:31 +01:00
Dismissed
@ -23,6 +23,7 @@ export default class Sacrifice extends ButtonEvent {
private async confirm(interaction: ButtonInteraction) {
const userId = interaction.customId.split(" ")[2];
const cardNumber = interaction.customId.split(" ")[3];
const quantity = Number(interaction.customId.split(" ")[4]) ?? 1;
Member

I don't actually think this works, try using || instead of ??

I don't actually think this works, try using `||` instead of `??`
Vylpes marked this conversation as resolved
@ -98,6 +105,7 @@ export default class Sacrifice extends ButtonEvent {
private async cancel(interaction: ButtonInteraction) {
const userId = interaction.customId.split(" ")[2];
const cardNumber = interaction.customId.split(" ")[3];
const quantity = Number(interaction.customId.split(" ")[4]) ?? 1;
Member

Same here

Same here
Vylpes marked this conversation as resolved
@ -21,3 +25,4 @@
public override async execute(interaction: CommandInteraction<CacheType>): Promise<void> {
const cardnumber = interaction.options.get("cardnumber", true);
const quantity = interaction.options.get("quantity")?.value as number ?? 1;
Member

Same here

Same here
Vylpes marked this conversation as resolved
Vylpes added 2 commits 2024-09-15 15:11:29 +01:00
Vylpes requested review from VylpesTester 2024-09-15 15:11:44 +01:00
Vylpes force-pushed feature/337-sacrifice-multiple from 98bfd79a00 to 4359cbba1e 2024-09-15 16:56:17 +01:00 Compare
VylpesTester approved these changes 2024-09-15 16:57:11 +01:00
Vylpes merged commit c0e9378813 into develop 2024-09-15 16:57:25 +01:00
Vylpes deleted branch feature/337-sacrifice-multiple 2024-09-15 16:57:25 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: External/card-drop#354
No description provided.