Пример #1
0
 def channels_webhooks_create(self, channel, name=None, avatar=None):
     r = self.http(Routes.CHANNELS_WEBHOOKS_CREATE,
                   dict(channel=channel),
                   json=optional(
                       name=name,
                       avatar=avatar,
                   ))
     return Webhook.create(self.client, r.json())
Пример #2
0
 def webhooks_token_modify(self, webhook, token, name=None, avatar=None):
     r = self.http(Routes.WEBHOOKS_TOKEN_MODIFY,
                   dict(webhook=webhook, token=token),
                   json=optional(
                       name=name,
                       avatar=avatar,
                   ))
     return Webhook.create(self.client, r.json())
Пример #3
0
 def webhooks_modify(self, webhook, name=None, avatar=None, reason=None):
     r = self.http(Routes.WEBHOOKS_MODIFY,
                   dict(webhook=webhook),
                   json=optional(
                       name=name,
                       avatar=avatar,
                   ),
                   headers=_reason_header(reason))
     return Webhook.create(self.client, r.json())
Пример #4
0
 def webhooks_token_get(self, webhook, token):
     r = self.http(Routes.WEBHOOKS_TOKEN_GET, dict(webhook=webhook, token=token))
     return Webhook.create(self.client, r.json())
Пример #5
0
 def webhooks_get(self, webhook):
     r = self.http(Routes.WEBHOOKS_GET, dict(webhook=webhook))
     return Webhook.create(self.client, r.json())