3

So, I'm hosting a discord.py bot on Heroku, and I'm trying to use PRAW to take a random submission from the hot section of the subreddit.

if message.content.startswith("~reddit"):
    subreddit = reddit.subreddit("VaporwaveAesthetics")
    await message.channel.send(subreddit.title)
    s = []
    for submission in subreddit.hot(limit=75):
        s.append(submission)
    x = randint(0,74)
    s = s[x]
    e = discord.Embed(title=s.title,
                      url=s.url,
                      description=s)
    await message.channel.send(embed=e)

When it gets to the reddit.subreddit("VaporwaveAesthetics") part, I guess the problem is there because when I try to send the title of the subreddit it throws the error. By the way, for the Heroku hosting I'm using the lastest version of PRAW (6.0.0.dev0), and the discord.py rewrite (1.0.0a).

Here's the error that I'm getting: Error.

1 Answers1

0

That isin't really your fault nor Heroku fault (I Think), 500 Error Code means Internal Server Error. I Suggest you keep trying your code OR use Try - Except, if you got a 404 code response, that means you inputed a subreddit that dosen't exist. List of HTTP Response and what does they mean

Raphiel
  • 398
  • 2
  • 17