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

collect meta data from threads #989

Closed
wants to merge 2 commits into from

Conversation

ankitsmt211
Copy link
Member

@ankitsmt211 ankitsmt211 commented Dec 17, 2023

resolves #660

gonna close this, there's a better way to do this instead of wriitng seperate listener should be done in already existing one.

Comment on lines +105 to +112
private boolean wasThreadAlreadyHandled(long threadChannelId) {
// NOTE Discord/JDA fires this event twice per thread (bug?), we work around by remembering
// the threads we already handled
Instant now = Instant.now();
// NOTE It is necessary to do the "check if exists, otherwise insert" atomic
Instant createdAt = threadIdToCreatedAtCache.get(threadChannelId, any -> now);
return createdAt != now;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

copied method for checking already handled thread, should i instead just increase visibility of one inside HelpThreadCreatedListener?

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.

Collecting analytics for #active_questions
1 participant