Catch reddit redirect errors
This commit is contained in:
parent
6f837d9ad3
commit
339c103fce
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ import asyncio
|
|||
import logging
|
||||
|
||||
from asyncpraw import Reddit
|
||||
from asyncprawcore.exceptions import Forbidden, NotFound
|
||||
from asyncprawcore.exceptions import Forbidden, NotFound, Redirect
|
||||
from dis_snek import InteractionContext, Permissions, Scale, Snake
|
||||
from dis_snek.client.utils.misc_utils import get
|
||||
from dis_snek.models.discord.channel import ChannelTypes, GuildText
|
||||
|
@ -64,7 +64,7 @@ class RedditCog(Scale):
|
|||
try:
|
||||
subreddit = await self.api.subreddit(name)
|
||||
await subreddit.load()
|
||||
except (NotFound, Forbidden) as e:
|
||||
except (NotFound, Forbidden, Redirect) as e:
|
||||
self.logger.debug(f"Subreddit {name} raised {e.__class__.__name__} on add")
|
||||
await ctx.send("Subreddit may be private, quarantined, or nonexistent.", ephemeral=True)
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue