-
-
Notifications
You must be signed in to change notification settings - Fork 98
handling error when member left guild #986
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
handling error when member left guild #986
Conversation
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
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.
that duplication here isnt good:
also, ur technically also attempting to archive when archiving itself failed, which isnt good.
the "try this, but always archive" shouldnt span across archiving itself.
instead, try to write it like:
...
.flatMap(member -> ...)
.onError(handleFailure)
.flatMap(any -> threadChannel.getManager().setArchived(true))
.queue();
@Zabuzard im blank here, it requires me to return a |
might misremember the name. onFailure(...) perhaps. |
seems much better, at least chain is pretty readable now. |
|
@Taz03 It's good to go when you can. |
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
* replacing Function type with Supplier for sendEmbedWithoutMention * changing variable for more clarity on fetched members
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java
Outdated
Show resolved
Hide resolved
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.
Thanks. ❤️
During auto-archive routine for help threads, bot sends an embed educating OP why the thread was archived, it also pings OP in the process. This whole archiving routine depends on whether member was retrieved, thus it fails consecutively until discords built in archive feature kicks in.