I integrated chat GPT into my twitch chat and it responds to all messages.
I’ve excluded gpt to respond to some users (including myself) using the code below (top), but I want to exclude all messsages that start with “!” as well.
This is the very first time I’ve ever touched C# so I have no idea what to do.
I tried adding this (bottom) but it still responds to commands.
List<string> excludeGptReply = new List<string>();
excludeGptReply.Add(chatbotName);
excludeGptReply.Add(broadcaster);
excludeGptReply.Add("streamelements");
excludeGptReply.Add("nightbot");
excludeGptReply.Add("streamlabs");
excludeGptReply.Add("pokemoncommunitygame");
excludeGptReply.Add("kofistreambot");
excludeGptReply.Add("fourthwallhq");
excludeGptReply.Add("fossabot");
string message = args["message"].ToString();
if (excludeGptReply.Contains(message.Trim().ToLower()))
{
return true; // Skip processing
}
if (message.StartsWith("!"))
{
return true; // Skip processing
}