mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27:54 +00:00
Create GetXXX utils wrapping try blocks
This commit is contained in:
parent
7fef8c1dde
commit
c87e67245d
8 changed files with 95 additions and 49 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue