adds a try catch around the create text channel call so if it fails it does not take out the bot.
- Reported by Darl
This commit is contained in:
parent
ab6b7d7a69
commit
acfc3da27c
1 changed files with 10 additions and 3 deletions
|
|
@ -119,9 +119,16 @@ namespace BSB.bottypes
|
|||
{
|
||||
display_topic = "" + channeltopictype + ":" + sender_id + ": Actions -> !clear, !close";
|
||||
}
|
||||
IGuildChannel channel = await DiscordServer.CreateTextChannelAsync(channelname, X => DiscordGetNewChannelProperies(X, channelname, display_topic, channeltopictype.ToLowerInvariant()));
|
||||
ITextChannel Txtchan = await DiscordServer.GetTextChannelAsync(channel.Id);
|
||||
return Txtchan;
|
||||
try
|
||||
{
|
||||
IGuildChannel channel = await DiscordServer.CreateTextChannelAsync(channelname, X => DiscordGetNewChannelProperies(X, channelname, display_topic, channeltopictype.ToLowerInvariant()));
|
||||
ITextChannel Txtchan = await DiscordServer.GetTextChannelAsync(channel.Id);
|
||||
return Txtchan;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void DiscordGetNewChannelProperies(TextChannelProperties C, string channelname, string channeltopic, string catname)
|
||||
|
|
|
|||
Loading…
Reference in a new issue