Create use effect command #419
No reviewers
Labels
No labels
blocked
duplicate
needs criteria
needs estimate
needs tests
question
requires documentation
type
admin
type
alert
type
bug
type
change
type
defect
type
dependencies
type
epic
type
spike
type
story
type
subtask
won't fix
No milestone
No project
No assignees
3 participants
Notifications
Total time spent: 36 minutes 34 seconds
Due date
Vylpes
36 minutes 34 seconds
No due date set.
Dependencies
No dependencies set.
Reference: External/card-drop#419
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/380-use-effect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
#380
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.
Checklist
@ -33,0 +56,4 @@
const effectDetail = EffectDetails.get(id);
if (!effectDetail) {
await interaction.reply("Unable to find effect!");
The error message 'Unable to find effect!' is unclear. It should be 'Effect not found in the system!'.
@ -33,0 +114,4 @@
const effectDetail = EffectDetails.get(id);
if (!effectDetail) {
await interaction.reply("Unable to find effect!");
The error message 'Unable to find effect!' is unclear. It should be 'Effect not found in the system!'.
WIP: Create use effect commandto Create use effect commandCopilot reviewed 6 out of 16 changed files in this pull request and generated 2 comments.
Files not reviewed (10)
Comments suppressed due to low confidence (8)
tests/buttonEvents/Effects.test.ts:42
tests/buttonEvents/Effects.test.ts:83
tests/buttonEvents/Effects.test.ts:90
tests/buttonEvents/Effects.test.ts:117
tests/buttonEvents/Effects.test.ts:81
interaction.reply
is called only once in the error scenario where the effect detail is not found.tests/buttonEvents/Effects.test.ts:88
interaction.reply
is called only once in the error scenario where the effect detail is not found.src/helpers/TimeLengthInput.ts:122
src/helpers/TimeLengthInput.ts:132
@ -61,0 +99,4 @@
const randomCardIndex = Math.floor(Math.random() * allCards.length);
const card = allCards[randomCardIndex];
The variable 'card' can be undefined if 'allCards' is empty. Add a check to ensure 'allCards' is not empty before accessing an element by index.
@ -1,6 +1,9 @@
import {ButtonInteraction} from "discord.js";
import {ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, EmbedBuilder} from "discord.js";
Fix spacing
@ -14,3 +20,3 @@
}
private async List(interaction: ButtonInteraction) {
public async List(interaction: ButtonInteraction) {
I don't like that
@ -31,2 +37,4 @@
});
}
public async Use(interaction: ButtonInteraction) {
I don't like that its public
@ -33,0 +50,4 @@
}
}
public async UseConfirm(interaction: ButtonInteraction) {
I don't like that thats public
@ -33,0 +108,4 @@
await interaction.reply("Unable to use effect! Please make sure you have it in your inventory and is not on cooldown");
}
public async UseCancel(interaction: ButtonInteraction) {
I don't like that thats public
@ -1,6 +1,9 @@
import {CommandInteraction, SlashCommandBuilder} from "discord.js";
import {ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, SlashCommandBuilder} from "discord.js";
Spacing
@ -45,0 +65,4 @@
const effectDetail = EffectDetails.get(id);
if (!effectDetail) {
await interaction.reply("Unable to find effect!");
I think we should log a warning in this case, since it shouldn't be possible
@ -9,1 +9,4 @@
public static readonly MultidropQuantity = 11;
// Effects
public static readonly UnusedChanceUpChance = 1;
Incorrect value
@ -58,6 +59,66 @@ export default class CardDropHelperMetadata {
};
}
public static async GetRandomCardUnclaimed(userId: string): Promise<DropResult | undefined> {
I think we should split this file up now
@ -1,6 +1,7 @@
import {ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder} from "discord.js";
import UserEffect from "../database/entities/app/UserEffect";
import EmbedColours from "../constants/EmbedColours";
import {EffectDetails} from "../constants/EffectDetails";
Spacing
@ -119,2 +119,4 @@
return desNumber;
}
public static ConvertFromMilliseconds(ms: number): TimeLengthInput {
I want tests generated for this
@ -1,127 +1,135 @@
import {ButtonInteraction} from "discord.js";
Recreate the tests
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.