modifyWebhookWithToken method

Future<Webhook> modifyWebhookWithToken(
  1. String webhookId, {
  2. required String webhookToken,
  3. String? name,
  4. String? avatar = '',
})

Implementation

Future<Webhook> modifyWebhookWithToken(
  String webhookId, {
  required String webhookToken,
  String? name,
  String? avatar = '',
}) {
  var endpoint = '/webhooks/$webhookId/$webhookToken';
  return _http.request(
    endpoint,
    converter: Webhook.fromJson,
    method: 'patch',
    body: {
      ...insertNotNull('name', name),
      ...insertNotDefault('avatar', avatar, ''),
    },
  );
}