createWebhook method

Future<Webhook> createWebhook(
  1. String channelId, {
  2. required String name,
  3. String? imageData,
})

Implementation

Future<Webhook> createWebhook(
  String channelId, {
  required String name,
  String? imageData,
}) {
  var endpoint = '/channels/$channelId/webhooks';
  return _http.request(
    endpoint,
    method: 'post',
    converter: Webhook.fromJson,
    body: {
      'name': name,
      'image_data': imageData,
    },
  );
}