RoyRiv3r / SocialMediaLinkConverter.plugin.js

SocialMediaLinkConverter is a BetterDiscord plugin that enhances the embedding of links from various social media platforms. When you share links from these platforms on Discord, SocialMediaLinkConverter automatically fixes them to properly embed.
GNU General Public License v3.0
6 stars 1 forks source link

Reddit Link Convertor Not Converting #17

Closed Primus1243 closed 3 months ago

Primus1243 commented 3 months ago

When I try to paste and send Reddit links, it used to work before where it would automatically convert to whatever is listed. Either the rxddit link or the redditez links. Now it stays as regular Reddit links. I have to manually change it on my own. Is anyone else having this issue? Screenshot 2024-08-02 003110 As seen here with this HazbinHotel post. The first was me doing a regular post. The next is me manually editing it.

RoyRiv3r commented 3 months ago

That's my bad, reddit has so many ways to share link you have to handle all of them, I forgot to add the subreddit link such as https://www.reddit.com/r/subreddit/s/shortID And the code doesn't take it into account. It should be:

{
    id: 'Reddit',
    regex: /https?:\/\/(?:www\.|old\.|new\.|sh\.)?reddit\.com\/(?:r\/\w+\/comments\/\w+\/[^\/\s]+(?:\/\w+)?|r\/\w+\/s\/\w+)/g,
    replacement: 'https://redditez.com/',
},

Also, rxddit recognizes the subreddit link, redditez doesn't seem to recognize it. You can modify the regex or wait for the next update.