Suppress embeds from original message after successful video download#140
Suppress embeds from original message after successful video download#140
Conversation
- Add _can_manage_messages() helper to check for manage_messages permission - Suppress embeds from original message after successful video reply (both direct upload and catbox.moe) - Only suppress if bot has manage_messages permission - Gracefully handle errors if embed suppression fails Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/c5512bc1-6dd7-4d1b-8cca-5bc4f3e9aa04 Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
| if self._can_manage_messages(message.channel): | ||
| try: | ||
| await message.edit(suppress=True) | ||
| except discord.HTTPException: | ||
| # Ignore errors (e.g., message already has no embeds) | ||
| pass |
There was a problem hiding this comment.
@copilot extract this into a "remove_embed" function to avoid repetition.
There was a problem hiding this comment.
Extracted into _remove_embed(message) in 59bbd92. Both the direct upload and catbox fallback paths now call this single helper instead of duplicating the permission check + message.edit(suppress=True) logic.
Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/726a7eed-4701-4fa7-ba97-314be53e01fd Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
|
@copilot fix tests - also make it a requirement for every PR going forward, all tests and status checks must pass. |
Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/05fed6f9-64e5-432b-bc68-5ac609a0fca3 Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
Fixed in 0c900ad. The |
When the bot successfully downloads and replies with a video, the original message's auto-generated embed (from Discord's URL preview) remains visible, creating redundant content. This PR adds automatic embed suppression to clean up the channel after successful downloads.
Changes
_can_manage_messages()helper to verify bot hasmanage_messagespermissionmessage.edit(suppress=True)after successful video replies (both direct upload and catbox.moe fallback)Implementation
Requires the bot to have
manage_messagespermission in the channel. Suppression is only attempted after a successful download reply, and failures are silently ignored to avoid disrupting the primary download functionality.