reworked the commandHandler

added Slash Commands
This commit is contained in:
Sarah Faey 2022-11-15 19:00:56 +01:00
parent 17dceda408
commit b8feed971c
15 changed files with 599 additions and 214 deletions

View file

@ -125,5 +125,21 @@ namespace DiscordBot.Services
return new Tuple<bool, string>(true, string.Empty);
}
public async Task<ApiRaid> GetRaid(int raidId)
{
var httpClient = _httpClientFactory.CreateClient(Constants.HTTP_CLIENT_NAME);
var httpResponseMessage = await httpClient.GetAsync($"DiscordBot/GetRaid/{raidId}");
if (httpResponseMessage.IsSuccessStatusCode)
{
using var contentStream =
await httpResponseMessage.Content.ReadAsStreamAsync();
return await JsonSerializer.DeserializeAsync<ApiRaid>(contentStream, _serializerOptions);
}
return new ApiRaid();
}
}
}