所以我已经使用这个机器人几个星期了,代码不属于我。 git的支持不是最好的,所以我在这里尝试。
这是我收到的错误消息。该漫游器运行一个DLL,该DLL调用许多CS文件和json配置以执行所需的操作。我对这一切一无所知,但我确实将问题隔离在这一堂课上。它称为比较器,它比较图像的HashID以确定不和谐中显示的图像是X还是Y。然后返回带有与该HashID关联的名称,然后输入不和谐通道。
据我所知,该机器人没有从任何网站上获取任何东西。它仅在本地运行HTTP客户端。但是我对这种东西太傻了
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at System.Net.Http.HttpClient.FinishGetStreamAsync(Task`1 getTask)
at PokecordCatcherBot.Services.CatcherService.OnMessage(SocketMessage msg) in E:\stuff\PokecordCatcher\PokecordCatcher\PokecordCatcher\Services\CatcherService.cs:line 53
at PokecordCatcherBot.Services.CatcherService.<>c__DisplayClass2_0.<<-ctor>b__2>d.MoveNext() in E:\stuff\PokecordCatcher\PokecordCatcher\PokecordCatcher\Services\CatcherService.cs:line 27
public class CatcherService : Service
{
private readonly PokemonComparer comparer;
private readonly HttpClient http;
public CatcherService(PokecordCatcher bot, string hashPath) : base(bot)
{
var pokemon = LoadPokemon(hashPath);
comparer = new PokemonComparer(pokemon);
Console.WriteLine("Loaded " + pokemon.Select(x => x.Value.Count).Sum() + " pokemon");
http = new HttpClient();
Client.MessageReceived += async x => Task.Run(async () => await OnMessage(x))
.ContinueWith(t => Console.WriteLine(t.Exception.Flatten().InnerException), TaskContinuationOptions.OnlyOnFaulted);
}
``