Add Messageable.ack

This commit is contained in:
Rapptz
2017-02-28 00:47:37 -05:00
parent f7524c9919
commit 8daf411c72
2 changed files with 28 additions and 0 deletions

View File

@@ -776,3 +776,25 @@ class Messageable(metaclass=abc.ABCMeta):
counter += 1
"""
return HistoryIterator(self, limit=limit, before=before, after=after, around=around, reverse=reverse)
@asyncio.coroutine
def ack(self):
"""|coro|
Marks this channel as read.
The user must not be a bot user.
Raises
-------
HTTPException
Acking failed.
ClientException
You must not be a bot user.
"""
state = self._state
if state.is_bot:
raise ClientException('Must not be a bot account to ack messages.')
channel = yield from self._get_channel()
yield from state.http.ack_channel(channel.id)