Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the WEBHOOKS_UPDATED event #2384

Merged
merged 4 commits into from
Aug 1, 2022
Merged

Support the WEBHOOKS_UPDATED event #2384

merged 4 commits into from
Aug 1, 2022

Conversation

CottageDwellingCat
Copy link
Contributor

@CottageDwellingCat CottageDwellingCat commented Jul 11, 2022

The WEBHOOKS_UPDATE event is ignored by socket clients, and a comment claims it is user only, however it is documented and other libraries appear to support it. The event is useful in webhook caching solutions that need to know if a webhook was moved.
The ignored event is found at:

case "WEBHOOKS_UPDATE":
await _gatewayLogger.DebugAsync("Ignored Dispatch (WEBHOOKS_UPDATE)").ConfigureAwait(false);
break;
#endregion

Example using the event:

client.WebhooksUpdated += (guild, channel) =>
{
    Console.ForegroundColor = ConsoleColor.Magenta;
    Console.WriteLine($"A webhook was updated in or moved to {guild}#{channel}");
    Console.ResetColor();
    return Task.CompletedTask;
};

@csmir csmir merged commit 010e8e8 into discord-net:dev Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants