praw: Attempting to respond to Reddit administrator messages throws 403
Issue Description
Certain Reddit messages cannot be responded to, and are often sent in bulk without regard for who the recipient is. A bot I am working on got sent one of these messages, and attempted to respond to it. However, a 403 error was received, terminating the process. On the website, there is not a Reply button to these messages. Is there any meaningful way of distinguishing these messages from other messages so that I don’t have to hardcode all the administrators and prevent my bot from replying to them?
The specific message is an invitation for /r/community_chat. That message has no reply button on it, but it originates from a Reddit admin.
File "/usr/local/lib/python3.5/dist-packages/prawcore/sessions.py", line 182, in request
params=params, url=url)
File "/usr/local/lib/python3.5/dist-packages/prawcore/sessions.py", line 127, in _request_with_retries
raise self.STATUS_EXCEPTIONS[response.status_code](response)
prawcore.exceptions.Forbidden: received 403 HTTP response
System Information
- PRAW Version: 5.4.0
- Python Version: 3.5.2
- Operating System: Ubuntu 16.04.4 LTS
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (14 by maintainers)
PRAW should not let any actions silently fail because then its users will think that the requested action went through when it in fact didn’t.
Throwing exceptions or not shouldn’t be an option that’s up to the caller. If the caller wishes to ignore a particular exception, they should use a
try-exceptblock to catch and ignore it.in addition, that just isn’t expected behavior. there are non-distinguished non-admin messages that are unreplyable too and it’s just something that can’t be determined as stated by others in the thread.
@SheaBelsky see the second part of @kwwxis’s reply: