Repository navigation
fix: baninfo interaction response - #493
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how ban information responses are sent, unifying the logic for both text and slash commands by introducing a new
BaninfoReplyTargetenum. This makes the response handling more flexible and maintainable, allowing responses to be sent either to a channel or as a follow-up to an interaction. Additionally, the signature and return type ofsend_baninfo_responsehave been updated to support this change and improve error handling.Unified response handling for baninfo commands:
BaninfoReplyTargetenum inbaninfo.rsto abstract over reply targets, supporting both channel messages and interaction follow-ups. ([crates/rustmail/src/commands/baninfo/text_command/baninfo.rsR119-R139](https://github.com/Rustmail/rustmail/pull/493/files#diff-5d8c70530a6da235ce2b84e60fb01fefebc0e56625e146bfbdc0cbc23e095743R119-R139))send_baninfo_responseto accept aBaninfoReplyTargetinstead of a channel ID, and to return aModmailResult<()>for better error propagation. ([[1]](https://github.com/Rustmail/rustmail/pull/493/files#diff-5d8c70530a6da235ce2b84e60fb01fefebc0e56625e146bfbdc0cbc23e095743R119-R139),[[2]](https://github.com/Rustmail/rustmail/pull/493/files#diff-5d8c70530a6da235ce2b84e60fb01fefebc0e56625e146bfbdc0cbc23e095743L143-R165))BaninfoReplyTargetwhen callingsend_baninfo_response. ([[1]](https://github.com/Rustmail/rustmail/pull/493/files#diff-3614c746b4cdd6b30d4f30dd3b4c213d26c4da0922203f8ba3c7f729014ad19bL1-R3),[[2]](https://github.com/Rustmail/rustmail/pull/493/files#diff-3614c746b4cdd6b30d4f30dd3b4c213d26c4da0922203f8ba3c7f729014ad19bL99-R108),[[3]](https://github.com/Rustmail/rustmail/pull/493/files#diff-5d8c70530a6da235ce2b84e60fb01fefebc0e56625e146bfbdc0cbc23e095743L41-R50))Improvements to message building:
MessageBuilderlogic to prioritize a custom embed if present when building interaction follow-ups, improving flexibility in message formatting. ([crates/rustmail/src/utils/message/message_builder.rsL565-R567](https://github.com/Rustmail/rustmail/pull/493/files#diff-a13904fa9ae13cee8b5d65f68e64409a79431f10d8da3fb6f4aaf2dde1ab26b1L565-R567))