mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 22:17:51 +01:00
Add !tgs to address all tgstation-server chat bots
This commit is contained in:
@@ -105,6 +105,19 @@ namespace TGS.Server.ChatProviders
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
var splits = formattedMessage.Split(' ');
|
||||
found = splits[0].ToLower() == "!tgs";
|
||||
if (found)
|
||||
{
|
||||
var asList = new List<string>();
|
||||
asList.AddRange(splits);
|
||||
asList.RemoveAt(0);
|
||||
formattedMessage = String.Join(" ", asList);
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && !pm)
|
||||
return;
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ namespace TGS.Server.ChatProviders
|
||||
var splits = new List<string>(formattedMessage.Split(' '));
|
||||
var test = splits[0];
|
||||
if (test.Length > 1 && (test[test.Length - 1] == ':' || test[test.Length - 1] == ','))
|
||||
test = test.Substring(0, test.Length - 1);
|
||||
if (test.ToLower() != irc.Nickname.ToLower())
|
||||
test = test.Substring(0, test.Length - 1).ToLower();
|
||||
if (test != irc.Nickname.ToLower() && test != "!tgs")
|
||||
return;
|
||||
|
||||
splits.RemoveAt(0);
|
||||
|
||||
Reference in New Issue
Block a user