Browse Source

increased the counter to 20 to avoid it filling the cache and failing to find a post. Also added a new way to detect a sub not existing because reddit changed the json outputs for the redesign.

tags/v1.7.0
Roxie Gibson 6 years ago
parent
commit
9641f9341c
2 changed files with 14 additions and 5 deletions
  1. +12
    -3
      README.md
  2. +2
    -2
      Roxbot/cogs/reddit.py

+ 12
- 3
README.md View File

@@ -15,6 +15,16 @@ _Coming Soon_

## Changelog

#### v1.7.0
###### New Features
- NSFW commands now have the same system of preventing dupe outputs
###### Minor Changes
- Moved NSFW commands to use aiohttp instead of requests which hopefully will wield quicker response times.
- Minor refactoring in places, which involves some directory movement.
###### Bug Fixes
- Doubled the amount of times subreddit commands will cycle through possible requests to fix JSON decode error.
- Fixed error in reddit cog due to changing JSON outputs thanks to new reddit redesign.

#### v1.6.1
###### Small changes
- `nowplaying` is now more handy and should display more info.
@@ -114,7 +124,6 @@ _Coming Soon_
###### Bug Fixes
- Removing all warnings of a user now removes them from the dictionary. Making them not display in the list even though they don't have any warnings.


#### v1.3.3
###### Hottest of Bug Fixes
- Warn list now actually works for all warnings.
@@ -168,7 +177,7 @@ _Coming Soon_

#### v1.0.0
###### Rewrite
The whole bot has been completly rewritten. Its jam packed with new commands, cogs, and functionality. Because of this, I wont be including a full change log. I will fill out the changelog for further versions. But this version should be more stable, have more features, and just be better than before.
The whole bot has been completely rewritten. Its jam packed with new commands, cogs, and functionality. Because of this, I wont be including a full change log. I will fill out the changelog for further versions. But this version should be more stable, have more features, and just be better than before.

#### v0.4.0
###### New Features
@@ -176,7 +185,7 @@ The whole bot has been completly rewritten. Its jam packed with new commands, co
- New Utils cog, new commands like avatar, and info

###### Bugs and Fixes
- Admin cog renamed to Settins cog.
- Admin cog renamed to Settings cog.
- ChangeAvatar updated again to be inline with who avatar deals with avatar images.
- Fixed twitch cog bug that made roxbot crash a lot


+ 2
- 2
Roxbot/cogs/reddit.py View File

@@ -105,14 +105,14 @@ class Reddit():
title = ""
choice = {}

if not links or not links.get("after"): # The second part is if we are given a search page that has links in it.
if not links or not links.get("after") or links["children"][0]["kind"] == "t5": # The second part is if we are given a search page that has links in it.
return await ctx.send("Error ;-; That subreddit probably doesn't exist. Please check your spelling")

url = ""
x = 0
# While loop here to make sure that we check if there is any image posts in the links we have. If so, just take the first one.
# Choosing a while loop here because, for some reason, the for loop would never exit till the end. Leading to slow times.
while not url or x > 10:
while not url or not x > 20:
choice = random.choice(links["children"])["data"]
url = parse_url(choice["url"])
if url:

Loading…
Cancel
Save