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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user