Please or Register to create posts and topics.

Block Bots Filter C# Code For Streamer.bot

using System;

public class CPHInline
{
    public bool Execute()
    {
        string targetUser = “”;

        if (args.ContainsKey(“targetUser”) && args[“targetUser”] != null)
        {
            targetUser = args[“targetUser”].ToString().Trim().ToLower();
        }

        // Remove @ if present
        if (targetUser.StartsWith(“@”))
        {
            targetUser = targetUser.Substring(1);
        }

        if (string.IsNullOrWhiteSpace(targetUser))
        {
            CPH.LogWarn(“targetUser is empty.”);
            CPH.SetArgument(“UserIsBot”, false);
            return true;
        }

        // BOT LIST
        string botData = @”pokemoncommunitygame
streamelements
wizebot
streamlabs
streamstickers
botrixoficial
frostytoolsdotcom
sery_bot
frostytools
overlayexpert
tangiabot
soundalerts
botrix
moobot
nightbot
own3d
own3dtv_
phantombot
streamelementshq
streamer.bot
streamerbot
streamlab
supibot
timeoutwithbits
twitchapexstats_com
twitchprediction
wzbot
xanbot
ouvertbot
overkongen
nightbot
streamelements
streamlabs
moobot
fossabot
wizebot
tangiabot
sery_bot
supibot
phantombot
streamerbot
mixitup
lumia_stream
deepbot
coebot
botisimo
own3d
own3dtv_
soundalerts
streamstickers
streamroutine_bot
twitchprediction
twitchapexstats_com
timeoutwithbits
overlayexpert
pokemoncommunitygame
xanbot
overkongen
botrix
botrixoficial
frostytools
frostytoolsdotcom
ouvertbot
wzbot
streamroutine_bot”;

        bool isBot = false;

        string[] lines = botData.Split(new[] { ‘\r’, ‘\n’ }, StringSplitOptions.RemoveEmptyEntries);

        foreach (string line in lines)
        {
            string botName = line.Trim().ToLower();

            if (botName == targetUser)
            {
                isBot = true;
                break;
            }
        }

        CPH.LogInfo(“Checking user: ” + targetUser);
        CPH.LogInfo(“UserIsBot = ” + isBot);

        CPH.SetArgument(“UserIsBot”, isBot);

        return true;
    }
}