question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempting to respond to Reddit administrator messages throws 403

See original GitHub issue

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.

screen shot 2018-05-15 at 4 20 48 pm
  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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
jarhill0commented, Jan 5, 2020

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-except block to catch and ignore it.

1reaction
justcool393commented, Jan 5, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

first time using praw, "received 403 HTTP response" - Reddit
A 403 error typically means that you don't have permission to access something, and in the case of reddit it usually means that...
Read more >
Who else is getting the 403-Blocked response on every request?
Even a normal fetch to subreddit.json is returning 403. But it does provides response sometimes. It feels like it is trying to block...
Read more >
"403 Forbidden error" when trying to reply to a comment - Reddit
So I've been trying to reply to a comment by using reddit.submission(id=comment_id).reply("zzz"), but I've been getting 403 Forbidden errors.
Read more >
403 forbidden... why is it saying this when I try to comment on ...
I've been trying to comment on a thread and each time I try, it won't let me and says "An error occurred.. Reddit:...
Read more >
Can't reply to messages from inbox - "an error occurred (status
Whenever I try and reply to a message from my inbox, the message won't send and I instead see "an error occurred (status:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found