wotanut / DiscordStuff

A collection of all my stuff for discord
7 stars 6 forks source link

Add youtube tracker remover #12

Closed Nam0 closed 1 month ago

Nam0 commented 6 months ago

Adding Regex "youtube": /(https:\/\/youtu.be\/\w+)\?.+/g to remove Youtube SI tracking information. Added this.defaultSettings.youtube = true; for the setting to be enabled by default

            //youtube

            //example of youtube link
            // https://youtu.be/sXtryATp7dU?si=-b3JJeQMHAMx4TBa
            if (this.settings.youtube) {
            if (msgcontent.includes("https://youtu.be")) {
                msgcontent = this.sanitizeUrls(msgcontent, REGEX.youtube);

                if (this.settings.showToasts && !isFromSomeoneEsle) {
                    Toasts.success("Successfully removed tracker from YouTube link!");
                }
            }
wotanut commented 1 month ago

I know this is old, sorry for the slow response, i'll check this pr shortly and merge it over the weekend

wotanut commented 1 month ago

Thanks for adding the regex and opening a PR, but this has been added as of #13