-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
### 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.
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.
return user.username | ||
} | ||
const member = await guild.members.fetch(user.id) | ||
return member.nickname || user.username |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return member.nickname || user.username | |
return member.nickname ?? user.username |
@@ -63,7 +78,7 @@ function requestFollowUpAction( | |||
.followUp({ | |||
content: `Thanks ${userMention( |
There was a problem hiding this comment.
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> ❤️)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
)}, 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: [], |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
Notes
This resolves a few issues with the thread decisions: