Skip to content

Commit

Permalink
webhook: default username
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlium committed Feb 14, 2016
1 parent cdeff1c commit 1ada005
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mattermost_bot/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def reply_webapi(self, text, *args, **kwargs):

def send_webapi(self, text, attachments=None, channel_id=None, **kwargs):
url = self._get_webhook_url_by_id(self._get_first_webhook())
kwargs['username'] = kwargs.get(
'username', self.get_username(self._client.user['id']))
self._client.api.in_webhook(
url, self.get_channel_name(channel_id), text,
attachments=attachments, **kwargs)
Expand Down

0 comments on commit 1ada005

Please sign in to comment.