We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b8a74b commit b451939Copy full SHA for b451939
1 file changed
plugins/reddit.py
@@ -58,14 +58,9 @@ def reddit_url(match, bot):
58
headers = {'User-Agent': bot.user_agent}
59
r = requests.get(url, headers=headers)
60
r.raise_for_status()
61
- if r.status_code != 200:
62
- return
+
63
data = r.json()
64
- if isinstance(data, list):
65
- item = data[0]["data"]["children"][0]["data"]
66
- elif isinstance(data, dict):
67
- # item = data["data"]["children"][random.randint(0,9)]["data"]
68
+ item = data[0]["data"]["children"][0]["data"]
69
70
return format_output(item)
71
0 commit comments