things
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ class Bot:
|
||||
self.data: dict = {}
|
||||
|
||||
async def initialize(self):
|
||||
self.sr = await self.r.subreddit("bytedicetesting")#boykisser")
|
||||
self.sr = await self.r.subreddit("bytedicetesting")
|
||||
|
||||
async def set_args(self, args: dict):
|
||||
self.args = args
|
||||
|
||||
+4
-1
@@ -1,4 +1,3 @@
|
||||
import asyncpraw as praw
|
||||
import asyncpraw.models as models
|
||||
|
||||
from macros import *
|
||||
@@ -40,6 +39,10 @@ async def respond_to_mention(bot: botPy.Bot) -> bool:
|
||||
|
||||
|
||||
async def bk_week_add(mention: models.Comment, bot: botPy.Bot):
|
||||
if not mention.subreddit.display_name not in bot.sr:
|
||||
await mention.mark_read()
|
||||
return
|
||||
|
||||
await mention.submission.load()
|
||||
|
||||
author = mention.author
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ async def from_url(bot: botPy.Bot, url: str) -> tuple[bool, models.Submission]:
|
||||
try:
|
||||
post: models.Submission = await bot.r.submission(url=url)
|
||||
return True, post
|
||||
except (prawcore.NotFound, prawcore.BadRequest, exc.InvalidURL):
|
||||
except (prawcore.NotFound, prawcore.BadRequest, exc.InvalidURL, prawcore.Forbidden):
|
||||
return False, None
|
||||
except Exception as e:
|
||||
py_error(f"Unexpected error at posts.py -> from_url():\n{e}")
|
||||
|
||||
Reference in New Issue
Block a user