adds try catch around delete message async for discord

This commit is contained in:
Madpeterz 2021-01-03 23:28:08 +00:00
parent 53343c7507
commit a0620be4e8

View file

@ -14,6 +14,7 @@ namespace BSB.bottypes
{ {
if (AllowNewOutbound() == true) if (AllowNewOutbound() == true)
{ {
channelname = channelname.ToLowerInvariant(); channelname = channelname.ToLowerInvariant();
channelname = String.Concat(channelname.Where(char.IsLetterOrDigit)); channelname = String.Concat(channelname.Where(char.IsLetterOrDigit));
ITextChannel Channel = await FindTextChannel(channelname, catmap[catmapid], sender_id, TopicType).ConfigureAwait(false); ITextChannel Channel = await FindTextChannel(channelname, catmap[catmapid], sender_id, TopicType).ConfigureAwait(false);
@ -125,6 +126,8 @@ namespace BSB.bottypes
} }
} }
if ((deleteMessages.Count > 0) || (slowDeleteMessages.Count > 0)) if ((deleteMessages.Count > 0) || (slowDeleteMessages.Count > 0))
{
try
{ {
if (deleteMessages.Count > 0) if (deleteMessages.Count > 0)
{ {
@ -137,6 +140,11 @@ namespace BSB.bottypes
await chan.DeleteMessageAsync(slowdelmessage).ConfigureAwait(true); await chan.DeleteMessageAsync(slowdelmessage).ConfigureAwait(true);
} }
} }
}
catch
{
}
empty = false; empty = false;
} }
} }