Create GetXXX utils wrapping try blocks

This commit is contained in:
Ske
2020-07-02 18:29:04 +02:00
parent 7fef8c1dde
commit c87e67245d
8 changed files with 95 additions and 49 deletions

View File

@@ -33,7 +33,7 @@ namespace PluralKit.Bot
public async Task<DiscordWebhook> GetWebhook(DiscordClient client, ulong channelId)
{
var channel = await client.GetChannelAsync(channelId);
var channel = await client.GetChannel(channelId);
if (channel == null) return null;
if (channel.Type == ChannelType.Text) return null;
return await GetWebhook(channel);