diff --git a/BetterSecondbot/DiscordSupervisor/ChannelControl.cs b/BetterSecondbot/DiscordSupervisor/ChannelControl.cs index e0d8972..00db1d9 100644 --- a/BetterSecondbot/DiscordSupervisor/ChannelControl.cs +++ b/BetterSecondbot/DiscordSupervisor/ChannelControl.cs @@ -14,13 +14,19 @@ namespace BetterSecondBot.DiscordSupervisor { if (AllowNewOutbound() == true) { - - channelname = channelname.ToLowerInvariant(); - channelname = String.Concat(channelname.Where(char.IsLetterOrDigit)); - ITextChannel Channel = await FindTextChannel(channelname, catmap[catmapid], sender_id, TopicType, false).ConfigureAwait(true); - if (Channel != null) - { - return await Channel.SendMessageAsync(message).ConfigureAwait(false); + try + { + channelname = channelname.ToLowerInvariant(); + channelname = String.Concat(channelname.Where(char.IsLetterOrDigit)); + ITextChannel Channel = await FindTextChannel(channelname, catmap[catmapid], sender_id, TopicType, false).ConfigureAwait(true); + if (Channel != null) + { + return await Channel.SendMessageAsync(message).ConfigureAwait(false); + } + } + catch + { + return null; } } return null;