adds custom name for the AI
This commit is contained in:
parent
4148d6d832
commit
68a71f5e0d
2 changed files with 14 additions and 3 deletions
|
|
@ -27,6 +27,12 @@ namespace SecondBotEvents.Config
|
|||
settings.Add("ChatHistoryTimeout");
|
||||
settings.Add("ShowDebug");
|
||||
settings.Add("Provider");
|
||||
settings.Add("CustomName");
|
||||
}
|
||||
|
||||
public string GetCustomName()
|
||||
{
|
||||
return ReadSettingAsString("CustomName", "<!FIRSTNAME!>");
|
||||
}
|
||||
|
||||
public bool GetShowDebug()
|
||||
|
|
|
|||
|
|
@ -288,19 +288,24 @@ namespace SecondBotEvents.Services
|
|||
}
|
||||
// trim history
|
||||
List<KeyValuePair<string, string>> history = chatHistoryAI[user];
|
||||
string yourname = GetClient().Self.FirstName;
|
||||
if(myConfig.GetCustomName() != "<!FIRSTNAME!>")
|
||||
{
|
||||
yourname = myConfig.GetCustomName();
|
||||
}
|
||||
if (history.Count() == 0)
|
||||
{
|
||||
if (avatarchat == true)
|
||||
{
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + GetClient().Self.FirstName + ", "+myConfig.GetChatPrompt()+", you are talking to " + name + "."));
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + yourname + ", "+myConfig.GetChatPrompt()+", you are talking to " + name + "."));
|
||||
}
|
||||
else if (groupchat == true)
|
||||
{
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + GetClient().Self.FirstName + ", "+myConfig.GetChatPrompt()+", you are talking to a group of people."));
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + yourname + ", "+myConfig.GetChatPrompt()+", you are talking to a group of people."));
|
||||
}
|
||||
else
|
||||
{
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + GetClient().Self.FirstName + ", "+myConfig.GetChatPrompt()+", you are talking to people in a public place."));
|
||||
history.Add(new KeyValuePair<string, string>("system", "You are " + yourname + ", "+myConfig.GetChatPrompt()+", you are talking to people in a public place."));
|
||||
}
|
||||
}
|
||||
history.Add(new KeyValuePair<string, string>("user", "" + name + " says " + message));
|
||||
|
|
|
|||
Loading…
Reference in a new issue