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,10 +119,17 @@ namespace BSB.bottypes
|
||||||
{
|
{
|
||||||
display_topic = "" + channeltopictype + ":" + sender_id + ": Actions -> !clear, !close";
|
display_topic = "" + channeltopictype + ":" + sender_id + ": Actions -> !clear, !close";
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
IGuildChannel channel = await DiscordServer.CreateTextChannelAsync(channelname, X => DiscordGetNewChannelProperies(X, channelname, display_topic, channeltopictype.ToLowerInvariant()));
|
IGuildChannel channel = await DiscordServer.CreateTextChannelAsync(channelname, X => DiscordGetNewChannelProperies(X, channelname, display_topic, channeltopictype.ToLowerInvariant()));
|
||||||
ITextChannel Txtchan = await DiscordServer.GetTextChannelAsync(channel.Id);
|
ITextChannel Txtchan = await DiscordServer.GetTextChannelAsync(channel.Id);
|
||||||
return Txtchan;
|
return Txtchan;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void DiscordGetNewChannelProperies(TextChannelProperties C, string channelname, string channeltopic, string catname)
|
protected void DiscordGetNewChannelProperies(TextChannelProperties C, string channelname, string channeltopic, string catname)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue