我有一些C#代码我,成就了AI替换下载字符串的第二行?
else if (msg.Body.Contains("ai"))
{
string ai = msg.Body.Replace("!ai ", string.Empty).Replace(" ", "+");
WebClient _client = new WebClient();
msg.Chat.SendMessage("Getting AI... ");
_client.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36";
//Define what the client is heading to.
string a = _client.DownloadString("!Api here!" + ai).Replace("string", "\n");
//Display Message
msg.Chat.SendMessage(Nick + "AI says: " + a);
}
但是API还给2行,我只需要前行,因为那是用唯一的线给我,请帮助!
你能告诉我们这个字符串看起来像你从api中得到的吗? –
好 “嗨,甜心:)字符串(12)‘嗨,甜心:)’ –
我想后删除一切‘ –