Fix crash when message sent to discord

This commit is contained in:
Basique Evangelist 2021-04-21 21:05:26 +03:00
parent 2b0cd07997
commit 3e16199c1f
2 changed files with 5 additions and 1 deletions

View File

@ -92,7 +92,10 @@ namespace JetHerald
foreach (var chatSent in await Db.GetExpiredTopics(token))
{
var formatted = $"!{chatSent.Description}!:\nTimeout expired at {chatSent.ExpiryTime}";
if (chatSent.Service == "Telegram")
await TelegramBot.SendTextMessageAsync(chatSent.ChatId, formatted, cancellationToken: token);
else if (chatSent.Service == "Discord")
await SendMessageToDiscordChannel(chatSent.ChatId, formatted);
}
await Db.MarkExpiredTopics(token);

1
perfusion Submodule

@ -0,0 +1 @@
Subproject commit 5913a7e44f7e9ac63a5bfd04c837a9968cf1fe88