diff options
| author | Rapptz <[email protected]> | 2017-02-27 23:03:46 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-02-27 23:29:52 -0500 |
| commit | 9a1215e13bf3eb5e2d8dca797dc563a1f722c02e (patch) | |
| tree | c79774823fc061f942f9292d0994576a88e62622 /discord/guild.py | |
| parent | Remove nonce when sending messages. (diff) | |
| download | discord.py-9a1215e13bf3eb5e2d8dca797dc563a1f722c02e.tar.xz discord.py-9a1215e13bf3eb5e2d8dca797dc563a1f722c02e.zip | |
Add support for message acking.
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/discord/guild.py b/discord/guild.py index 878ceb03..760632bc 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -36,7 +36,7 @@ from .emoji import Emoji from .game import Game from .permissions import PermissionOverwrite from .colour import Colour -from .errors import InvalidArgument +from .errors import InvalidArgument, ClientException from .channel import * from .enums import GuildRegion, Status, ChannelType, try_enum, VerificationLevel from .mixins import Hashable @@ -979,3 +979,23 @@ class Guild(Hashable): Unbanning failed. """ yield from self._state.http.unban(user.id, self.id) + + def ack(self): + """|coro| + + Marks every message in this guild 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.') + return state.http.ack_guild(self.id) |