Restore basic link handling and add !pendinglinks command#23
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5849931c03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
User description
Motivation
on_messagelistener to detect and enqueue non-media URLs for review.!pendinglinkscommand was added to allow review of pending links.Description
@commands.Cog.listener()on_messagehandler that ignores bots, processes commands, extracts URLs viaURL_REGEX, filters withis_valid_urlandis_media_url, and forwards accepted links to a handler._handle_linkwhich builds a pending entry, callslink_previewandmake_verdict_embed, persists the entry viastorage.add_pending_link, sends an interactiveLinkActionView, and stores the bot message id withstorage.update_pending_with_bot_msg_idwhile trackingguild_pending_counts.pending_links_commandexposed as!pendinglinksthat retrieves pending links for the invoking user viastorage.get_pending_links_for_userand displays them.link_preview,make_verdict_embed,LinkActionView,is_valid_url,is_media_url, andstorageAPIs) so the change restores end-to-end link drop → review behavior.Testing
Codex Task
PR Type
Enhancement, Bug fix
Description
Added
on_messagelistener to detect and process non-media URLs from messagesImplemented
_handle_linkmethod to create verdict embeds and store pending linksAdded
!pendinglinkscommand to display user's queued links for reviewEnhanced
download_byteswith scheme validation and Content-Length checksFixed TinyURL API endpoint to use HTTPS instead of HTTP
Diagram Walkthrough
File Walkthrough
main.py
Link detection, pending command, and download safety improvementsmain.py
on_messagelistener to detect and enqueue non-media URLs frommessages
_handle_linkmethod that creates verdict embeds, storesentries, and sends interactive views
pending_links_command(!pendinglinks) to retrieve and displayuser's pending links
download_byteswith URL scheme validation and Content-Lengthheader checks before downloading