Executing Webhooks Via the Bot Client

If you do not have a bot client set up, see using webhooks via the factory.

Otherwise you can simply call the various webhook methods on the client and pass the webhook ID and token to them:

var message = new LocalWebhookMessage()
    .WithContent("Hello from a webhook!");

await Bot.ExecuteWebhookAsync(YOUR_WEBHOOK_ID, "YOUR_WEBHOOK_TOKEN", message);

This method might feel a bit cumbersome, especially when executing a specific webhook many times. When that's the case you should consider utilizing the factory instead.

Next up: Via Factory.