Fix DiscordUtil#getOrCreateWebhook using webhooks without tokens

This commit is contained in:
Josh Roy 2021-11-25 12:24:35 -05:00
parent 668c9634ca
commit 3f857e3183

View file

@ -79,7 +79,7 @@ public final class DiscordUtil {
final CompletableFuture<Webhook> future = new CompletableFuture<>();
channel.retrieveWebhooks().queue(webhooks -> {
for (final Webhook webhook : webhooks) {
if (webhook.getName().equals(webhookName)) {
if (webhook.getName().equals(webhookName) && webhook.getToken() != null) {
ACTIVE_WEBHOOKS.addIfAbsent(webhook.getId());
future.complete(webhook);
return;