Skip to content

Update link_fixer.py - #138

Open
ingenium21 wants to merge 3 commits into
CommunityToolBox:mainfrom
ingenium21:rjr-twitterWebViewrURL
Open

Update link_fixer.py#138
ingenium21 wants to merge 3 commits into
CommunityToolBox:mainfrom
ingenium21:rjr-twitterWebViewrURL

Conversation

@ingenium21

Copy link
Copy Markdown
Collaborator
image

adding a second twitter web viewer link so that people can use that instead of going straight to x.

@ingenium21
ingenium21 requested review from AndyReifman and ash663 and a lite review from Copilot August 26, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Discord bot’s link rewriting cog to add an additional “Twitter Web Viewer” link for rewritten Twitter/X URLs, offering an alternative viewer option alongside the existing FxTwitter rewrite.

Changes:

  • Added a helper (twitter_web_viewer_url) to extract a tweet ID from a rewritten Twitter/X URL and build a twitterwebviewer.com link.
  • Updated on_message handling to optionally post the Twitter Web Viewer link when the rewritten URL is an FxTwitter link.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread arsene_wenger/cogs/link_fixer.py Outdated
Comment thread arsene_wenger/cogs/link_fixer.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

arsene_wenger/cogs/link_fixer.py:72

  • The else branch reply call has inconsistent indentation inside the parentheses, which hurts readability and can trigger formatter/linter failures.
                else:
                    await message.reply(
                    f"Fx'ed that for you! {new_url}", mention_author=False
                    )

Comment thread arsene_wenger/cogs/link_fixer.py
@AndyReifman

Copy link
Copy Markdown
Collaborator

Do me a favor and run a
uvx ruff check arsene_wenger/cogs/link_fixer.py
as well as
uvx ruff format --check arsene_wenger/cogs/link_fixer.py

If there are any flags related to your new/changed code, please fix them.

@ingenium21

Copy link
Copy Markdown
Collaborator Author

Do me a favor and run a uvx ruff check arsene_wenger/cogs/link_fixer.py as well as uvx ruff format --check arsene_wenger/cogs/link_fixer.py

If there are any flags related to your new/changed code, please fix them.

PS C:\Users\renat\Documents\GitHub\ArseneWenger> uvx ruff check arsene_wenger/cogs/link_fixer.py
Installed 1 package in 550ms
All checks passed!
(.venv) PS C:\Users\renat\Documents\GitHub\ArseneWenger> uvx ruff format --check arsene_wenger/cogs/link_fixer.py
unformatted: File would be reformatted
--> arsene_wenger\cogs\link_fixer.py:32:9
|
31 | """Extra url for twitter and x links that takes the original URL's number and converts it to

  •         a twitter web viewer url. 
    
  •         example: if new_url is "https://www.fxtwitter.com/samimokbel_bbc/status/2092649709462564884?s=46"
    
  •         the function should return "https://twitterwebviewer.com/?tweet=2092649709462564884"
    

32 + a twitter web viewer url.
33 + example: if new_url is "https://www.fxtwitter.com/samimokbel_bbc/status/2092649709462564884?s=46"
34 + the function should return "https://twitterwebviewer.com/?tweet=2092649709462564884"
35 | """

62 | await message.reply(

  •                         f"Fx'ed that for you! {new_url}\nTwitter Web Viewer version: <{twitter_web_viewer}>", mention_author=False
    

63 + f"Fx'ed that for you! {new_url}\nTwitter Web Viewer version: <{twitter_web_viewer}>",
64 + mention_author=False,
65 | )

71 | await message.reply(

  •                 f"Fx'ed that for you! {new_url}", mention_author=False
    

72 + f"Fx'ed that for you! {new_url}", mention_author=False
73 | )
|

1 file would be reformatted
(.venv) PS C:\Users\renat\Documents\GitHub\ArseneWenger>

also fixed facts.py and did some formatting improvements.
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.

3 participants