From 9a1215e13bf3eb5e2d8dca797dc563a1f722c02e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 27 Feb 2017 23:03:46 -0500 Subject: Add support for message acking. --- discord/guild.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'discord/guild.py') 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) -- cgit v1.2.3