mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added an option to match by colors in Auto Respond bot.
This commit is contained in:
parent
b5cf315ca1
commit
0d58887b6a
5 changed files with 30 additions and 24 deletions
|
|
@ -12,6 +12,7 @@ namespace MinecraftClient.ChatBots
|
|||
class AutoRespond : ChatBot
|
||||
{
|
||||
private string matchesFile;
|
||||
private bool matchColors;
|
||||
private List<RespondRule> respondRules;
|
||||
private enum MessageType { Public, Private, Other };
|
||||
|
||||
|
|
@ -19,9 +20,10 @@ namespace MinecraftClient.ChatBots
|
|||
/// Create a new AutoRespond bot
|
||||
/// </summary>
|
||||
/// <param name="matchesFile">INI File to load matches from</param>
|
||||
public AutoRespond(string matchesFile)
|
||||
public AutoRespond(string matchesFile, bool matchColors)
|
||||
{
|
||||
this.matchesFile = matchesFile;
|
||||
this.matchColors = matchColors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -262,7 +264,8 @@ namespace MinecraftClient.ChatBots
|
|||
public override void GetText(string text)
|
||||
{
|
||||
//Remove colour codes
|
||||
text = GetVerbatim(text);
|
||||
if (!this.matchColors)
|
||||
text = GetVerbatim(text);
|
||||
|
||||
//Get Message type
|
||||
string sender = "", message = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue