Skip to content

Notify proper post deletion #1270

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

billpapat
Copy link

@billpapat billpapat commented Jul 1, 2025

Upon the deletion of a message within a help post, a system notification will be displayed, providing guidance on the proper procedure for deleting the post.

image

Upon the deletion of a message within a help post, a system notification will be displayed, providing guidance on the proper procedure for deleting the post.
@billpapat billpapat requested a review from a team as a code owner July 1, 2025 00:12
Copy link
Member

Choose a reason for hiding this comment

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

better to create a new listener here, this one seems to handle creation stuff

Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is definitely the wrong class to handle this

Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is definitely the wrong class to handle this

Comment on lines +94 to +99
.sendMessage(
"""
It looks like a message was deleted in this help post.\s
To properly close this post, please __right-click__ on the **Created Post** __followed by__ **Delete Post**\s
instead of deleting messages. This ensures proper record-keeping and\s
helps other users find solutions.""")
Copy link
Member

@Zabuzard Zabuzard Jul 1, 2025

Choose a reason for hiding this comment

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

people in our server cant delete threads. u need to educate them about using /help-thread close and not in a text-way but as slash command. do a text search of mentionSlashCommand, ull find a helper for it.

Comment on lines +101 to +103
failure -> LOGGER.error(
"Could not retrieve thread owner for thread ID {}: {}",
threadChannel.getId(), failure.getMessage(), failure));
Copy link
Member

Choose a reason for hiding this comment

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

failure.getMessage() is unecessary, ur already attaching the exception itself at the end which contains all info :)

@@ -71,6 +77,34 @@ public void onMessageReceived(MessageReceivedEvent event) {
}
}

@Override
public void onMessageDelete(MessageDeleteEvent event) {
// Check if the deleted message was from a thread
Copy link
Member

Choose a reason for hiding this comment

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

i think u misunderstood the task. its not about deleting any message in a help thread. its about deleting the original (first) message only. and ideally also only if it was deleted by OP. otherwise it also triggers when someone else deletes it (for example a mod).

Copy link
Author

Choose a reason for hiding this comment

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

I am not familiar with the role system in the server.

Normal user's can also created posts or is it for OP's and above?

Copy link
Member

Choose a reason for hiding this comment

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

any user can create a question thread and any user can send messages in the thread.

the github-issue is about OP deleting the first message in the thread, not "any".

Copy link
Member

Choose a reason for hiding this comment

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

Normal user's can also created posts or is it for OP's and above?

Btw for clarification: OP stands for "Original Poster", so it means the person creating the question in our case

threadChannel.getGuild()
.retrieveMemberById(ownerId)
.queue(member -> threadChannel
.sendMessage(
Copy link
Member

Choose a reason for hiding this comment

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

id prefer sending a DM instead of a public message. public message only as fallback if DMs are closed. see /transfer which has a similar flow

Copy link
Member

Choose a reason for hiding this comment

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

I think that the hint should be in the thread directly, because thats also the context of their actions. Just like how the notification for automatic closing works.

Copy link
Member

Choose a reason for hiding this comment

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

fair. we can keep it then, i guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notify user about properly closing thread if they delete original post
4 participants