# Link/URL Protection - Check URL Execute Code not working

**URL:** <https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268>\
**Category:** Extension Support\
**Tags:** twitch\
**Created:** [September 9, 2023, 3:56am UTC](https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268 "2023-09-09T03:56:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lupusdraconis](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/lupusdraconis/32/589_2.png) [@lupusdraconis](https://extensions.streamer.bot/u/lupusdraconis)\
**Post date:** [September 9, 2023, 3:56am UTC](https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268/1 "2023-09-09T03:56:44Z")

</div>

I recently imported this extension:

> [@Link/URL Protection](https://extensions.streamer.bot/t/link-url-protection/113):
>
> Description With this extension you can block links in your chat, you can also add a small list of approved sites for such things as Discord Links, Clips and other Social Media. Import Code U0JBRR+LCAAAAAAABADdWllz47pyfk9V/gPj1xw6XCXxvkm0JVHbWBu1xKdSIABSHIHLJan11PnvaZCSrHXOXN+pxImrVJawNBpfNxr9NfnHv/6LIDytaZL6Ufj0N0H9LW/wgzhKMvu6OfBDP1gFH+1P0rPyrD4demmGoO0P/gN+hiigfEjHD5f/MR50hLckyijO+MzfDmPQKltECR9Fgyj06PrU86HSk/ysnJoJTXHix9mh61xQNFiFVXzoCVeM8a4/C9UIulAN5cNSaPnPokU4duXdPuGyS06FSEghYrlUdkSNaFR…

The code for Check URL appears to not be working. I have tested the other elements and all appear to function correctly, however the Check URL code does not seem to activate. I have attempted to insert simple "Hello World"s at certain points within the code to find a specific fail point (before `string permitUser`, after `string permitUser`, and after the `if!allowed` timeout chain. I consulted a friend who is more familiar with C# code than I am, and neither of us was able to figure out what was wrong. He believes it may be a syntax error.

I also tried replacing the Check URL code with this piece of code:

```using
using System.Text.RegularExpressions;
using System.Collections.Generic;

public class CPHInline
{
  public bool Execute()
  {
    CPH.SendMessage("Hello world!");
    return true;
  }
}

```

and it functioned properly, so the issue appears to be with the current Check URL code and not the Execute Code function itself. Thanks!

EDIT:  
The solution has been found.

In line 41 of the Check URL script, `CPH.TimeoutUser(args["user"].ToString(), 15);` needs to be `CPH.TwitchTimeoutUser(args["user"].ToString(), 15);`

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [September 9, 2023, 6:55am UTC](https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268/2 "2023-09-09T06:55:15Z")

</div>

Yeah, there’s going to be some stuff that needs to be altered and updated. If this still works as intended one of us may try to update the import code but most of the stuff is on the creator to update and if they don’t we’ll be starting to deprecate stuff. But glad you got it working and I’ll make a note for this.

---

<div class="post-metadata">

**Author:** ![lupusdraconis](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/lupusdraconis/32/589_2.png) [@lupusdraconis](https://extensions.streamer.bot/u/lupusdraconis)\
**Post date:** [September 9, 2023, 3:23pm UTC](https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268/3 "2023-09-09T15:23:17Z")

</div>

With that one issue fixed, everything about this works as intended!

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [September 21, 2023, 11:02pm UTC](https://extensions.streamer.bot/t/link-url-protection-check-url-execute-code-not-working/268/4 "2023-09-21T23:02:06Z")

</div>


