TwitchLinkGuard - Block unwanted links

TwitchLinkGuard - Block unwanted links

TwitchLinkGuard is designed to help Twitch streamers and moderators maintain a safe and clean chat environment. TLG is a comprehensive tool for automated moderation, making it an essential solution for Twitch streamers looking to enhance and streamline their chat moderation.

Key Features:

  • :link:Detection and Filtering
    • URL pattern detection: Automatically identifies harmful messages and removes them.
    • Blacklist Support: URLs only the broadcaster and moderators are allowed to use.
    • Failure Safe: URLs not explicitly flagged by the script will be ignored, ensuring users who accidentally write URL-like messages are not penalized (e.g., ‘hi.how’, ‘oh...my’).
  • :ticket:Voucher Code Detection
    • Automatic Identification: Recognize harmful messages with voucher, gaming key codes, or promo codes of all sorts. If indicators match, TLG automatically take actions according to your settings.
  • :busts_in_silhouette:Mentioned unpresent Viewers
    • Detects automatically spam message patterns that include mentioned users not present in your stream and removes them according to your settings.
  • :memo:Exemptions
    • Whitelist Support: Exempt trusted domains from moderation.
    • Group-Based Rules: Allow specific and optional multiple groups (e.g. “TLG-TrustedUsers”) to bypass moderation.
    • Temporary Exemptions: Temporarily grant permissions to users within a specified time limit.
    • Role based Rules: VIPs and Subscribers can be generally exempt from moderation.
  • :gear:Customization Options
    • Custom Messages: Create personalized messages for different moderation actions.
    • Appearance: Choose the account and writing style for response messages.
    • Easily update settings via JSON files or external arguments.
  • :loudspeaker: Community Reports
    • Reports are unique for each reporter
    • Your community can now report users for misbehaving in chat!
    • You can define the outcome and the threshold for it
  • :link: Check Link Safety
    • Check urls against multiple APIs if it is known as malicious.

Example:

msedge_cohAnlljYX

TwitchLinkGuard probably not work correctly with the new alpha version of streamer.bot

Import Files

TLG 2.0: v1
TwitchLinkGuard-2.0.sb (38.3 KB)

TLG Light 2.0: v1
TwitchLinkGuard-2.0-light.sb (20.0 KB)

The old version is still available hidden at the bottom


Install TwitchLinkGuard 2.0

Step 1 - Import

In Streamer.bot click the Import button in the top menu. Drag the .sb file into the Import String field.

Step 2 - Enable commands

Enable the PermitUser command in the Commands tab.

Step 3 - Adjust Sub-Actions

You now have multiple actions you can use and edit as you want. You can also disable actions you don’t need, they run independently from each other

Step 4 - Editing JSONS

If you’re updating from an older version, you should backup your files because the new version config might differ from the old one, as well as the messages.json
config.json contains the whitelist and blacklist and work the same way as it did in the old version, you can white/blacklist full URLs, partial URLs or just words/names
messages.json now contains a new set of messages you might want to take a look at.
report-messages.json is solely for the Community Report feature and also has a set of specific messages that can be edited as you like.
public_suffix_list.dat is considered as no touchy! and does not need to be edited.


Check Link Safety

Sometimes you will receive links from users you would trust at first glance, but you’re unsure if this link is really “safe” to use. Now you can check those links!

Installation

All you need to do is, set up a free VirusTotal, URLHaus or urlscan.io account:
VirusTotal
https://auth.abuse.ch/
Login - urlscan.io
And paste your API-Key into the sub-action.

Usage

Enter !checklink <url> in chat and your provided url will be processed if it is safe or unsafe.


Community Report Users

Doing a Subbathon stream and your mods are already sleeping? Your VIPs and Subs can work together to report unwanted users in your chat! After sufficient reports, a user will be punished according to your settings

Installation

All you need to do is, editing the sub-actions to fit your needs

You can decide who is able to report, manage groups which are protected from being reported
and decide the punishment.

Usage

Use !report <targetUser> <reason> to report a user. The <reason> you add to the report, will be added to the final message when the reported target user get punished.
You can also report multiple users at once with !report <targetUser1,targetUser2,targetUser3,...> <reason>

Each report is unique, a user can’t report another user multiple times to punish someone rapidly. In default settings, 3 different users must report the same user for punishing.


Link Permit

This is probably the only action that was left untouched besides some code cleanup

Edit Sub-actions

Argument Value Description Info
useBot True The bot account manages messages, bans, and timeouts. SB default setting since 0.2.5
useBot False The broadcaster account manages messages, bans, and timeouts. SB default setting till 0.2.4
sendAction True Messages appear like this in chat Like twitch’s own ‘/me’ command
sendAction False Messages will appear as a normal text in chat
permitTime e.g. 30 Define the time a user is allowed to post links permitTime is always in seconds.

Add {user} to tag a user directly and {permitTime} for the specific permitted time.

Argument Value Description
grantMessage Informs users to be granted to send links
revokeMessage Informs users when the permitted time is over
existingPermissionMessage Informs if there is already a user permitted
Labels **eg: min, minutes, Minuten, etc. ** Edit the desired time label after each ‘=’

Usage

You can permit a user to post links for your defined time period with !permit <targetUser>


Main Script

The Core TLG Script now follows a completely different approach by just deleting messages instead of directly ban/timeout a user. Since twitch startet to do some sort of “Sanity-Check” in the background against broadcasters to “rate” them for being advertiser friendly or not. Prolly everything is counted in, banning new users in chat, or doing other stuff that seems weird for twitch. In worst case, shoot your channel in the void with a shadowban for a month and completely ignore your channel from being forwarded, promoted or anything else. Happened to me after starting creating TLG :smiley:

The biggest change to the old TLG is, that you don’t have to maintain separate lists anymore and it uses external lists to check if a link is malicious or not. All links will be deleted in general if not whitelisted or the user is exempt for any reason but a ban/timout now only happens if the detected URL is an exact match of a known malicious source. Also obfuscated URLs are for now not detected since i received some messages that users got punished falsely and i noticed such behavior in my own chat.

Also handling of spam messages now have changed, instead of scanning messages for certain keywords, we now check if a tagged user exist or if a voucher-code is in the message. For now, this is the main behavior of typical spam bots, which is easy to detect and easy to maintain.
Yes, messages like “your chat is empty…” are not detected anymore by itself but you can block certain phrased in your blacklist.

The Twitch Warn has now actual meaning, after a defined threshold of warns a user get either banned/timed out



Light Version

The light version focuses solely of blocking real links and does basically nothing else. Good for users that have already sery_bot in place but want a more restrictive solution handling links.



Disclaimer:

TwitchLinkGuard was collaboratively developed with community contributions and assisted by AI (ChatGPT & Gemini). It is provided “as-is” but i will try to help as good as i can.


Interested in the old TwithLinkGuard?

Import Files

Full Stable: v6
TwitchLinkGuadv6.sb (27.8 KB)

Light Stable: v2
TwitchLinkGuad-Lightv2.sb (22.7 KB)


Install TwitchLinkGuard

Step 1 - Import

In Streamer.bot click the Import button in the top menu. Drag the .sb file into the Import String field.

Step 2 - Enable commands

Enable the TwitchLinkGuard - PermitUser command in the Commands tab.

Step 3 - set %configFolder% path

Define your desired path for the config.json and messages.json.

configFolder path

In the messages.json you can edit all messages that are used from the script for actions.
The config.json is a new easier way to handle various lists and options that normaly are set once and forget. It contains: RequiredKeywordCount, TimeoutDuration, Whitelist, Blacklist, SuspiciousKeywords, SuspiciousEndings.


Adjust TwitchLinkGuard Settings

Step 1 - Adjust arguments

Adjust the arguments in the TLG - Options to fit your needs.

Step 2 - Edit config.json

Editing your whitelist is important to keep your viewers safe from getting penalized by the script.

  • RequiredKeywordCount - Minimum required amount of keywords to trigger further actions.
  • TimeoutDuration - Timeout duration in seconds.
  • Whitelist - URLs that are exempt from moderation. Wildcards ‘*’ are supported.
  • Blacklist - URLs that are explicitly forbidden in chat. (Only Broadcaster & Moderators can post them)
  • SuspiciousKeywords - Indicators that lead to a ban/timeout.
  • SuspiciousEndings - Indicators that lead to a ban/timeout.
default config.json
{
  "_TLG_INFORMATION": "Configuration file for TLG. Edit with caution!",
  "_RequiredKeywordCount_INFORMATION": "Minimum required amount of keywords to trigger further actions.",
  "RequiredKeywordCount": 2,
  "_TimeoutDuration_INFORMATION": "Timeout duration in seconds.",
  "TimeoutDuration": 60,
  "_groupName_INFORMATION": "Exempt groups from moderation. (Group must exist in Streamer.bot)",
  "groupName": [
    "Example_TLG-TrustedUsers"
  ],
  "_Whitelist_INFORMATION": "URLs that are exempt from moderation. Wildcards '*' are supported, examples below.",
  "Whitelist": [
    "twitch.tv/*",
    "discord.gg/*",
    "*/YourName"
  ],
  "_Blacklist_INFORMATION": "URLs that are explicitly forbidden in chat. (Only Broadcaster & Moderators can post them)",
  "Blacklist": [
    "badsite.com",
    "*.example",
    "phishing.net"
  ],
  "_SuspiciousKeywords_INFORMATION": "Indicators that lead to a ban/timeout.",
  "SuspiciousKeywords": [
    "10 Zuschauer",
    "404",
    "Aloha",
    "abo",
    "abonnement",
    "abonnieren",
    "amazing",
    "become",
    "best",
    "Big",
    "bits",
    "boost",
    "buy",
    "cheap",
    "cheapest",
    "cheer",
    "cheers",
    "code",
    "discount",
    "discounted",
    "dogehype",
    "effortlessly boost",
    "earn",
    "fame",
    "famous",
    "follow",
    "follower",
    "followers",
    "free",
    "getvie",
    "gift",
    "gift card",
    "gift-card",
    "giftcard",
    "giveaway",
    "grow",
    "Gutschein",
    "Gutschein-Code",
    "Gutscheincode",
    "instant",
    "level",
    "money",
    "nezhna",
    "offer",
    "PayPal",
    "Prime",
    "prime",
    "Primes",
    "prize",
    "promo",
    "promo-code",
    "promotion",
    "promotion-code",
    "remove the space",
    "service",
    "services",
    "stream",
    "StreamBoo",
    "streaming",
    "streamrise",
    "sub",
    "subscriber",
    "subscribers",
    "subscription",
    "subs",
    "take your stream",
    "TwitchLaunch",
    "Twitch rankings",
    "twitch rankings",
    "twitchventures",
    "to/ezez",
    "upgrade",
    "verification",
    "view",
    "viewer",
    "viewers",
    "visit",
    "V-Bucks",
    "win"
  ],
  "_SuspiciousEndings_INFORMATION": "Suspicious URL endings or TLDs.",
  "SuspiciousEndings": [
    "ai",
    "be",
    "biz",
    "buzz",
    "cam",
    "cc",
    "cf",
    "click",
    "club",
    "com",
    "date",
    "de",
    "download",
    "ga",
    "gd",
    "gg",
    "gq",
    "icu",
    "info",
    "io",
    "loan",
    "ly",
    "men",
    "ml",
    "mov",
    "online",
    "page",
    "pro",
    "pw",
    "ru",
    "sc",
    "sh",
    "shop",
    "site",
    "space",
    "store",
    "su",
    "tech",
    "tk",
    "top",
    "trade",
    "tt",
    "tv",
    "vc",
    "website",
    "work",
    "ws",
    "xyz",
    "zip"
  ],
}

Step 3 - Edit messages.json

You can edit any message that is used in chat by TLG. If you don’t want to have no messages at all, you can set the argument DisableAllMessages to False. Additionally, you can also delete individual sentences, you just have to delete the text within the quotation marks but lease the rest untouched. If you remove the whole line, the script will reset the messages.json with the default settings.

default messages.json
  "_TLG_INFORMATION": "Message templates for moderation actions.",
  "_TLG_INFORMATION_2": "Use '{user}' for the user and '{duration}' for the timeout duration.",
  "_MsgUrlDelete_INFORMATION": "Message displayed when a link is removed.",
  "MsgUrlDelete": "Hey @{user}, your link has been removed, please ask for permission first.",
  "_MsgIsBlocked_INFORMATION": "Message displayed when a link is already blocked by twitch.",
  "MsgIsBlocked": "Hey @{user}, your link has blocked by twitch, please ask for permission first.",
  "_MsgUrlBan_INFORMATION": "Message when a prohibited link is detected.",
  "MsgUrlBan": "@{user} was banned for posting promotional content.",
  "_MsgIsBlockedBan_INFORMATION": "Message when a prohibited link is detected and is blocked by twitch.",
  "MsgIsBlockedBan": "@{user} was banned for posting blocked promotional content.",
  "_MsgVoucherBan_INFORMATION": "Message when a voucher code is detected.",
  "MsgVoucherBan": "@{user} was banned for posting promotional content containing a voucher-code.",
  "_MsgObfuscated_INFORMATION": "Message when an obfuscated link is detected.",
  "MsgObfuscated": "Hey {user}, your link looks suspicious and has been removed, please ask for permission first.",
  "_MsgObfuscatedBan_INFORMATION": "Message when an obfuscated link is detected and a ban/timeout is executed.",
  "MsgObfuscatedBan": "@{user} was banned for posting obfuscated promotional content.",
  "_MsgTwitchWarn_INFORMATION": "Warning message sent to the user.",
  "MsgTwitchWarn": "Posting links in chat violates our Community Guidelines. This is an official warning. Continued violations may result in further action, including timeouts or suspensions.",
  "_MsgTimeOut_INFORMATION": "Message when a timeout is issued.",
  "MsgTimeOut": "@{user} was timed out for {duration} seconds for rule violations.",
  "_MsgMentionTimeOut_INFORMATION": "Message when a timeout is issued for unauthorized mentions.",
  "MsgMentionTimeOut": "@{user} made unauthorized mentions and was timed out for {duration} seconds.",
  "_MsgUrlBlacklist_INFORMATION": "Message displayed when a blacklisted URL is posted.",
  "MsgUrlBlacklist": "Hey @{user}, the link you posted is not accepted in this chat.",
}

Adjust TwitchLinkGuard - Permit

Step 1 - Adjust arguments

Argument Value Description Info
useBot True The bot account manages messages, bans, and timeouts. SB default setting since 0.2.5
useBot False The broadcaster account manages messages, bans, and timeouts. SB default setting till 0.2.4
sendAction True Messages appear like this in chat Like twitch’s own ‘/me’ command
sendAction False Messages will appear as a normal text in chat
permitTime e.g. 30 Define the time a user is allowed to post links permitTime is always in seconds.

Step 2

Add {user} to tag a user directly and {permitTime} for the specific permitted time.

Argument Value Description
grantMessage Informs users to be granted to send links
revokeMessage Informs users when the permitted time is over
existingPermissionMessage Informs if there is already a user permitted
Labels **eg: min, minutes, Minuten, etc. ** Edit the desired time label after each ‘=’

Usable Commands

Command Example Description
!permit !permit ExampleUser A specific user now has ‘x’ seconds to post a link

Contributors


Disclaimer: This script was collaboratively developed with community contributions and assisted by AI (ChatGPT & Gemini). It is provided “as-is” but i will try to help as good as i can.


Changelog:

v6
TwitchLinkGuard

  • The entire script has been revised to make it easier to integrate new functions in the future.
  • Some new logging options added and the log level adjusted to get a better insight when something goes wrong.
  • Added an argument to get even more log insight if needed. (Which should also result in less spammed logs if disabled)
  • Sub-actions fundamentally revised and new functions added.
  • JSONS added so that all important settings are no longer overwritten unnecessarily in future updates.
  • new Blacklist for URLs that aren’t allowed under any circumstances, regardless of the role or exceptions a user fulfills. Only the broadcaster and moderators can post these links.
  • new - Auto Term Detection - The script now detects repeatedly deleted messages that contain links and scans them for new words to add to the “SuspiciousKeywords” list so TLG can identify such messages faster as spam in the future and respond according to your settings. (WIP)
  • new Now also detects spam messages which ping non-present viewers containing mostly just ragebait.

v2
TwitchLinkGuard - Light

  • The light version has also been updated to reflect fundamental changes done to TLG.
  • The light version only contains the basic functions of TLG. (Detecting links, obfuscated links, mentioned non-present users, whitelist)
Older Changelogs

v5.1

  • Updated %suspiciousKeywords% and %suspiciousEndings%
    • No matter how often a keyword appears in a message, it is only counted once. E.g.: “This time, this is the place” < “this” would only be counted as a single keyword
  • With %disableAllMessages% you can now optionally disable all messages that appears after a action is done.
    • For now, it’s not possible to disable single arguments, cause this would break the script
  • Fixed some typos
  • Added a fallback method if the bot-account is not available to cover future SB updates

v5

  • Added a detection for messages containing randomly mentioned(tagged) users that not exist in your stream.
  • Updated %suspiciousKeywords% list.
  • Sorted content of Chat Messages group: Deleted Messages > Users banned > Timeout > TwitchWarn

v4.1

  • Logs got a little cleared up.
  • Better checks to prevent Helix issues.
  • Updated denyAutoHeldMessage logic to skip if there is no message waiting for approval.

v4

  • Changed the behavior of TLG
    • TLG now only ban if a certain amount of matching keywords is reached. You can set the amount of keywords needed.
    • You can choose if TLG should ban or only timeout users
    • Timeout duration is also a matter of your choice.
  • Reintroduced the twitch AutoMod Logic that automatically denies messages held back by twitch
  • Removed ‘allowesSpecialCharacters’ logic. i was a little on the wrong track with this system and the goal i tried to reach with it
  • The Script got more comments to understand whats going on in case someone wants to tinker with it.
  • Log messages got a little unified to find them faster

v3.9
Stable Version

  • Added inbuild detection for Vip and Subscribers to be optionally exempt from moderation.
  • Vip and Subscribers can be exempt from moderation individually. If a user has both roles, either one of the exemptions will match on 'True'.
  • Twitch bot account is now exempt by default, regardless of it’s role.
  • Globally, URL detection does now look for indicators in messages, rather then banning straight forward for just finding a blacklisted word.
  • Since the script normalize any input, you can exempt certain characters from detection e.g.: ß, ĂĄ, Ă , Ă­, ĂŹ, Ăź, #, |, ', +, in the TLG-Options.

v3.9
Stable Version

  • Added inbuild detection for Vip and Subscribers to be optionally exempt from moderation.
  • Vip and Subscribers can be exempt from moderation individually. If a user has both roles, either one of the exemptions will match on 'True'.
  • Twitch bot account is now exempt by default, regardless of it’s role.
  • Globally, URL detection does now look for indicators in messages, rather then banning straight forward for just finding a blacklisted word.
  • Since the script normalize any input, you can exempt certain characters from detection e.g.: ß, ĂĄ, Ă , Ă­, ĂŹ, Ăź, #, |, ', +, in the TLG-Options.

v3.8
I decided to make 2 versions of the script. A Light version that only blocks/bans urls/obfuscated urls and the stable version.

Stable Version

  • Reworked the Code for better detection and differentiation between the systems
  • Revised the appearance of the script structure and made it more understandable
  • All chat messages and Logs have been revised and unified to be more informative
  • Removed the filter for specialCharacters since it was pretty unpredictable.
  • Voucher Code detection is fully integrated.

Light Version

  • Added a “light version” that only delete/bans normal urls or obfuscated urls while ignoring urls concealed with “***” or anything else.
  • Offers the same customization options as the stable version.
  • This Version is “as is”, since it’s pretty forward and as long twitch or SB don’t do groundbreaking changes to APIs, there is nothing to do here.

v3.7

  • Again refined the detection for special characters to avoid issues.
  • Added more editable messages according to new features.
  • Added Killswitches for new features to bypass them if there are any issues
  • The special characters and voucher code pattern detection, both now can differentiate between spam messages and normal messages and only ban typical spam messages
  • At the moment, you need to go into the code to edit the exclude lists for special characters if you’re using a language using other chars then predefined
    grafik
    grafik
  • Added previous versions in the Changelog area so older versions are available if needed
  • Message args in the Permit User action are also now mandatory to be active and set
    TwitchLinkGuard-3.7.sb (24.9 KB)

v3.6

  • Refined the detection for special characters to leave out some common characters to avoid issues in some languages.
  • All Chat Messages are now directly handled by the corresponding arguments that were disabled by default and optional till now.
  • All Mod-Action log messages are now editable.
  • In the TLG-Options the args %whitelist%, %suspiciousKeywords% and %suspiciousEndings% needs to be active.
  • isVip is reintroduced as if/else statement since not everyone trusts their own VIPs.
  • TLG now detects messages containing “voucher code” like structures like: GVP-1KJN-VM12-2QNG and ban users without roles/trusted group/not permitted.
  • Performance of the Permit User script was optimized.
    TwitchLinkGuard-3.6.sb (23.4 KB)

v3.5

  • The script was once again completely overhauled to have a better reaction performance in some cases.
  • Removed the useless if/else logic since an optional group system was introduced long time ago. The script skips any moderation for VIPs and moderators since those roles are supposed to be trusted users.
  • Whitelist is now even more flexible and doesn’t require asterisks anymore.
  • Obfuscated messages with special characters are now fully filtered. Messages like “GĂŤt cheap Subs͢cÍĄr͜ibers example. com” is now handled correctly.
  • All default chat messages have been revised.
  • Protocols and ban reasons have been adjusted to provide as much information as possible about why actions occurred.
    TwitchLinkGuard-3.5.sb (22.8 KB)

v3.4

  • Fix: Somehow old code sneaked into the permit system that didn’t belong there and messages weren’t editable
  • Added more default detected keywords using special characters. i tried to add a automated detection for unicode patterns but i wasn’t satisfied with it’s performance, so you can instead manually add special character words to the %SuspiciousKeywords% list (e.g. BĚžuĚžyĚž, 𝑉𝑖𝑒𝑤𝑠, 𝓒𝓵𝓲𝓬𝓴, G͓̽r͓̽o͓̽w)
  • Removed some useless code actions
  • Ban reasons and respectively log messages now give even more details about why a user message was banned/warned/deleted.
    E.g. Posted an obfuscated URL along with a prohibited keyword: Keyword: 'nezhna', SuspiciousEnding: 'com'.
  • Code got some kind of a “structure”.
    TwitchLinkGuard-3.4.sb (24.5 KB)

v3.3

  • No touching the script to edit the whitelist anymore!
    • Whitelist now use the same system as suspiciousEndings/keywords but without a predfined default list, so if the argument is disabled/missing, no links are whitelisted.
  • Removed many TLDs (Top-Level-Domains) since they aren’t frequently used anyways (like .at) and focused more on commonly used TLDs appearing in spam messages
  • Fixed some typos again.
  • The isBlockedByTwitch System now bans users posting links with suspicious keywords instead of just deleting any message regardless.
  • isBlockedByTwitch is now removed from the KillSwitch System since there is basically no way of malfunctioning.
  • Removed “light” edition since main script is now stable enough.
  • Updated the Instructions.
    TwitchLinkGuard-3.3.sb (23.0 KB)

v3.2

  • Made myself more clear where to go with the script and ditched the idea of a “Spam Protection” that give the possibility of a delayed penality since twitch only deletes the last message with TwitchWarn and it just would clutter the mod-action list for no reason
  • Optionally, you can set useTwitchWarn to True if you want to give out a ‘warn’ additionally to users posting links in the TLG-Options Group
  • Refined the whitelist logic to be more dynamically and accept wildcard placeholder asterisks at any position in the link (e.g. *twich.tv, www.discord.*) so URLs don’t have to be strict.
  • Adjusted the regular expression used in the IsObfuscatedMessage function to be more flexible
  • Fixed many typos
  • Removed deprecated lines
  • Removed IsObfuscatedMessage function from Killswitch since there is basically no way of malfunctioning
  • TLG-Permit User now has editable chat messages

v3.1

  • Spam Protection is temporarily removed from release version since i was not satisfied with its performance and state at the moment.
  • The permit system got some enhancements and has now more configurations.
  • Added three “Killswitch” arguments if something goes wrong (which should not actually but who knows) for a certain period.
  • Once again some rearangements and added colors to make it more appealing
  • Updated the Instructions

v3.0

  • Sub-actions are now more clearly arranged and grouped.
  • All messages output by the script are now customizable in the “Chat messages” group.
    %suspiciousKeywords% and %suspiciousEndings% can now both be directly edited in the “Options” group, allowing the script to be more easily adapted to individual needs. Both options are disabled by default, with the previously known list serving as the default until the arguments are activated.
  • Spam protection is now fully optional, with all related functions grouped together (and probably took me more time and nerves than it was probably worth :D).
  • Spam protection can now be modular, specifying how many links can be spammed before an official “Warn” is triggered by Twitch. (Messages are still deleted and the user is warned.)
    • Also optional: %usePenality% allows you to decide whether a timeout or ban should occur if a user continues to post links after a Twitch warning.
    • The duration of the timeout or the alternative ban can also be set.
  • The script has been slightly adjusted and now shows where the “Touchy Zone” begins upon opening.

v2.8

  • removed the broadcaster if/else logic since it doesn’t make really sense
  • added more explanations in the new rearranged sub-actions and in the code
  • added more Logs to steps i thought they’re necessary
  • TLG now features an optional Spam Protection:
    • If a user spam more then 5 links (with non-suspicious text) twitch sends out an official “warn”, broadcaster and moderators can see in the users history
    • If the same user proceed to spam links, a timeout or ban occur based on your settings.
    • The argument %useTimeout% handles if a timeout or ban happens for Spam Protection.
    • If you set the value of %timeoutDuration% to 0 it will ban users.
    • Regardless of your above setting, a user will receive a official “warn” from twitch after posting 5 links that is tracked in the users history. So it’s easy to inspect warns/timeouts/bans for Broadcaster and moderators by clicking on the name of the user

v2.7

“Stable”/Light verion

  • Made the %groupName% argument optional and added SB’s own if/else logic again, to skip broadcaster, moderators and VIPs since it’s easier to implement. Anyway, you can enable %groupName% and add trusted users to this list for exemption.
  • Removed the %groupName% logic from the !permit Action since they are exempt anyways if activated
    TwitchLinkGuard 2.7.sb (12.5 KB)

v2.6

  • Added new subaction folder called “Options” with some QoL arguments to both actions
    • %groupName% now uses the predefined group TLG-TrustedUsers to detect if users are trusted to post links. You can edit the argument to user another group aswell.
    • %useBot% now let you decide if you want to use your bot(true) or broadcaster account(false) for messages and bans
    • %sendAction% now let you decide if you want to use SendAction(true) or SendMessage(false)

v2.5

  • Added a check using CPH.UserInGroup to determine if a user belongs to the TLG-TrustedUsers group.
  • Add a argument to use another group then the predefined TLG-TrustedUsers group.
  • If the user is in the trusted group, the script skips the !permit command and sends an informational message indicating the user is already allowed to post links.

v2.4

  • fixed an issue were the script would delete messages tagging users only with emotes
  • refined the obfuscation detection
  • script is now completely commented
  • permit messages are now completely in english
  • Still watch out for messages held back by twitch

v2.3

  • The script now detects messages flagged by Twitch’s built-in AutoMod feature using the TwitchDenyAutoHeldMessage flag. It denies these messages, bans the user and provide an explanation in the ban reason. No further messages are posted in the chat, as only the broadcaster and moderators can view these flagged messages. (Needs some testing since it’s not easy to test this alone, prepare for failures )
  • The script now exempts common bots from being punished for posting links (e.g. sery_bot) , provided they do not hold moderator or VIP roles. This exemption can be customized by modifying a list in the code.
  • Messages now have , true); at the end, so you can better decide if bot or broadcaster account should be used by using true for bot and false for broadcaster account.

v2.2

  • Detects now URLs that get replaced with *** by Twitch’s own link block system and warns the user to do not post links
  • Ban reasons are even more detailed now: explains why the ban happened and what keyword was used: banned by BOTNAME, reason: Posted an obfuscated URL with prohibited keyword: example

v2.1

  • Completely reworked the script
  • Way more robust script structure handling different Links in messages
  • Warnings/Bans are now explained afterwards and there should be no failures anymore
  • For everything else: please read the overhauled Opener for all Key Features
  • For people disliking sendAction i now added a “b”-Version using sendMessage

Seeing as the extension itself is more of in a “Testing” state at least looking at the Discord post and the amount of recent Changelogs, it might be best to first create a post in the “Testing” forums Testing - Streamer.bot Extensions, which should definitely be used before submissions if you know it’s not fully tested yet. That way you can also share the link from the testing forum with people outside, as the “Submission” forum is only visible for the people that created a topic and the staff :slight_smile:

1 Like

changed it to testing

1 Like