Skip to content

Commit

Permalink
bugfix: client.send call fix (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
pirogoeth authored Aug 17, 2020
1 parent 1e91401 commit cc64796
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion machine/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__description__ = "A sexy, simple, yet powerful and extendable Slack bot"
__uri__ = "https://github.com/DandyDev/slack-machine"

__version_info__ = (0, 20, 3)
__version_info__ = (0, 20, 4)
__version__ = ".".join(map(str, __version_info__))

__author__ = "Daan Debie"
Expand Down
10 changes: 7 additions & 3 deletions machine/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def at(self, user: dict):
return self._client.fmt_mention(user["id"])

async def say(
self, channel, text, attachments=None, thread_ts=None, ephemeral_user=None
self, channel, text, *, attachments=None, thread_ts=None, ephemeral_user=None
):
"""Send a message to a channel using the WebAPI
Expand All @@ -115,7 +115,11 @@ async def say(
.. _chat.postEphemeral: https://api.slack.com/methods/chat.postEphemeral
"""
return await self._client.send(
channel, text, attachments, thread_ts, ephemeral_user
channel,
text,
attachments=attachments,
thread_ts=thread_ts,
ephemeral_user=ephemeral_user,
)

def say_scheduled(self, when, channel, text, attachments, ephemeral_user):
Expand Down Expand Up @@ -166,7 +170,7 @@ async def send_dm(self, user, text, attachments=None):
.. _chat.postMessage: https://api.slack.com/methods/chat.postMessage
"""
return self._client.send_dm(user, text, attachments)
return await self._client.send_dm(user, text, attachments)

def send_dm_scheduled(self, when, user, text, attachments=None):
"""Schedule a Direct Message and send it using the WebAPI
Expand Down

0 comments on commit cc64796

Please sign in to comment.