Skip to content
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

feat: chain log #276

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

feat: chain log #276

wants to merge 9 commits into from

Conversation

nyapat
Copy link
Contributor

@nyapat nyapat commented Mar 16, 2023

  • Chain log the key pop
  • Chain log completions
  • Chain log quota for the leader
  • Test vcless
  • Test actual /who screenshot
  • Amount popped -> quota can be logged with that amount. Completions can be handed out that many times aswell

How to chain log:

  • Start a raid
  • Put it in AFK check mode
  • Click "chain log" when you complete your chain (get a screenshot of /who!)
  • (If a key reacted, they will be suggested and the key name field can be left blank)
  • Fill in the key name field and amount popped field
  • Upload a /who or click the Users in VC button (or skip if ur a scrub)
  • chain logged!

Closes #188

@nyapat nyapat added it-enhancement Issue Type: Enhancement (new feature or request) c-raid Category: Raid-related (AFK checks, headcounts) labels Mar 16, 2023
@nyapat nyapat requested a review from ewang2002 March 16, 2023 17:30
Copy link
Member

@ewang2002 ewang2002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A few things.

  • Clarify what the question is.

    image

    Perhaps have the question be "In-Game Name of Key Popper." I was kind of confused when I initially saw it.

  • In the control panel, it might be a good idea to update the instructions (and corresponding button text) to include the Chain log button.

    image

  • I've been getting some of these randomly:

    DiscordAPIError: Interaction has already been acknowledged.
     at RequestHandler.execute (ToogaBooga\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
     at async RequestHandler.push (ToogaBooga\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
     at async ModalSubmitInteraction.reply (ToogaBooga\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:103:5)
    

    See if it's related to your addition of the prompts, but otherwise don't worry too much about it.

  • See review comments in code.

);

if (!resObj) {
(originalMessage as unknown as Message<true>).delete().catch(e => LOGGER.error(`${this._instanceInfo} ${e}`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave a comment as to why you're doing all of this casting?


const BUTTONS = new MessageActionRow();
if (!this._vcless) {
const VC_USERS_BUTTON = new MessageButton()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camelcase here, or define a constant and import the constant. For what it's worth, AdvancedCollector has a helper function cloneButton that you might find helpful. Use the function to clone the button and then, if needed, assign a new custom ID.

@@ -1517,6 +1527,234 @@ export class RaidInstance {
}, 5 * 60 * 1000);
}

private async provideChainLogModal(i: ButtonInteraction<"cached">): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document what this method does

const VC_USERS_BUTTON = new MessageButton()
.setCustomId("chain_log_use_vc")
.setLabel("Users in VC")
.setEmoji("🎙️")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe define the emoji constant in the EmojiConstants.ts file and then import the constant.


BUTTONS.addComponents(VC_USERS_BUTTON);
}
const SKIP_BUTTON = new MessageButton()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camelcase here, or define a constant and import the constant. For what it's worth, AdvancedCollector has a helper function cloneButton that you might find helpful. Use the function to clone the button and then, if needed, assign a new custom ID.

@@ -159,6 +164,11 @@ export class RaidInstance {
.setEmoji(EmojiConstants.UNLOCK_EMOJI)
.setCustomId(RaidInstance.UNLOCK_RAID_ID)
.setStyle("PRIMARY"),
new MessageButton()
.setLabel("Chain log")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep things consistent, change this to Chain Log (capitalize L).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-raid Category: Raid-related (AFK checks, headcounts) it-enhancement Issue Type: Enhancement (new feature or request)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easier chain logging
2 participants