mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): only allow proxying in known-supported channel types
This is so that new channel types added by Discord (that may or may not support the features we need for proxying to work) don't throw piles of error codes at users when they try to proxy.
This commit is contained in:
parent
a0fa03599b
commit
6b14c50f09
4 changed files with 44 additions and 10 deletions
|
|
@ -105,7 +105,14 @@ public class WebhookCacheService
|
|||
{
|
||||
try
|
||||
{
|
||||
return await _rest.GetChannelWebhooks(channelId);
|
||||
var webhooks = await _rest.GetChannelWebhooks(channelId);
|
||||
if (webhooks != null)
|
||||
return webhooks;
|
||||
|
||||
// Getting a 404 / null response from the above generally means the channel type does
|
||||
// not support webhooks - this is detected elsewhere for proxying purposes, let's just
|
||||
// return an empty array here
|
||||
return new Webhook[0];
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue