diff --git a/scratchattach/site/user.py b/scratchattach/site/user.py index a826b21e..a0d2b17e 100644 --- a/scratchattach/site/user.py +++ b/scratchattach/site/user.py @@ -4,6 +4,7 @@ import json import random import string +from datetime import datetime from ..eventhandlers import message_events from . import project @@ -555,6 +556,12 @@ def post_comment(self, content, *, parent_id="", commentee_id=""): if '{"error": "isFlood"}' in text: raise(exceptions.CommentPostFailure( "You are being rate-limited for running this operation too often. Implement a cooldown of about 10 seconds.")) + elif '')[0] + error_data = json.loads(raw_error_data) + expires = error_data['mute_status']['muteExpiresAt'] + expires = datetime.utcfromtimestamp(expires) + raise(exceptions.CommentPostFailure(f"You have been muted. Mute expires on {expires}")) else: raise(exceptions.FetchError(f"Couldn't parse API response: {r.text!r}"))