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

Thread decision fixes #332

Merged
merged 5 commits into from
Dec 5, 2024
Merged

Thread decision fixes #332

merged 5 commits into from
Dec 5, 2024

Conversation

zuuring
Copy link
Member

@zuuring zuuring commented Dec 3, 2024

Notes

This resolves a few issues with the thread decisions:

  • Let's make sure when an interaction is pressed. the text output corresponds to that action (i.e status update)
  • We edit the original interaction to remove the buttons when clicked as well as marked with the action taken, and by who.

### Notes
This resolves a few issues with the thread decisions:
- Let's make sure when an interaction is pressed. the text output corresponds to that action (i.e status update)
- We edit the original interaction to remove the buttons when clicked as well as marked with the action taken, and by who.
@zuuring zuuring requested a review from Shadowfiend December 3, 2024 11:44
@zuuring zuuring marked this pull request as draft December 3, 2024 14:05
This adds the threads `autoArchiveDuration` to the messages triggered by the interactions as well as setting the nickname instead of tagging the user.
This changes the flow so that we remove the original button interaction when an action is taken then also send that in a message to the decision taker with a nickname from the person who made the interaction.
@zuuring zuuring marked this pull request as ready for review December 5, 2024 12:05
return user.username
}
const member = await guild.members.fetch(user.id)
return member.nickname || user.username
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return member.nickname || user.username
return member.nickname ?? user.username

@@ -63,7 +78,7 @@ function requestFollowUpAction(
.followUp({
content: `Thanks ${userMention(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's drop the user mention here, since you're just mentioning yourself?

@@ -63,7 +78,7 @@ function requestFollowUpAction(
.followUp({
content: `Thanks ${userMention(
requestingUserId,
)}, please ${requestedAction} this thread or it will be archived in 24 hours ❤️`,
)}, please ${requestedAction} this thread or it will be archived in <t:${followUpDeadline}:F> (<t:${followUpDeadline}:R> ❤️)`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
)}, please ${requestedAction} this thread or it will be archived in <t:${followUpDeadline}:F> (<t:${followUpDeadline}:R> ❤️)`,
)}, please ${requestedAction} this thread or it will be archived in <t:${followUpDeadline}:F> (<t:${followUpDeadline}:R>) ❤️`,


await interaction.message.edit({
content: `${interaction.message.content}\n\n☑️ **Archived** by ${nickname}`,
components: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Does sending this interaction unarchive the thread?

@@ -189,9 +211,11 @@ const threadActions: {
thread,
interaction,
interaction.member,
"capture the task(s) associated with",
"post a status associated with",
Copy link
Contributor

Choose a reason for hiding this comment

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

WHOMP

@@ -234,9 +257,11 @@ const threadActions: {
thread,
interaction,
interaction.member,
"capture the task(s) associated with",
"make a decision for",
Copy link
Contributor

Choose a reason for hiding this comment

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

Whomp again lolol.

userIdToTag,
)

await interaction.message.delete()
Copy link
Contributor

Choose a reason for hiding this comment

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

If we always delete the interaction message, should we do it in the caller?

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Fundamental improvements, left some additional comments but let's ship and iterate as usual.

@Shadowfiend Shadowfiend merged commit 9c9bf46 into main Dec 5, 2024
7 checks passed
@Shadowfiend Shadowfiend deleted the thread-decision-fixes-dec3 branch December 5, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants