Skip to content

fix: baninfo interaction response - #493

Merged
Akinator31 merged 2 commits into
mainfrom
fix/baninfo-interaction-response
Oct 14, 2026
Merged

Akinator31 merged 2 commits into
mainfrom
fix/baninfo-interaction-response

Conversation

@Akinator31

Copy link
Copy Markdown
Member

This pull request refactors how ban information responses are sent, unifying the logic for both text and slash commands by introducing a new BaninfoReplyTarget enum. 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 of send_baninfo_response have been updated to support this change and improve error handling.

Unified response handling for baninfo commands:

  • Introduced the BaninfoReplyTarget enum in baninfo.rs to 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))
  • Updated send_baninfo_response to accept a BaninfoReplyTarget instead of a channel ID, and to return a ModmailResult<()> 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))
  • Refactored both text and slash command handlers to use the new BaninfoReplyTarget when calling send_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:

  • Enhanced the MessageBuilder logic 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))

@Akinator31 Akinator31 self-assigned this Oct 14, 2026
@Akinator31
Akinator31 merged commit 2085462 into main Oct 14, 2026
2 checks passed
@Akinator31
Akinator31 deleted the fix/baninfo-interaction-response branch October 14, 2026 14:10
@Akinator31 Akinator31 linked an issue Oct 14, 2026 that may be closed by this pull request
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.

Baninfo command interaction issue

1 participant