This commit is contained in:
2025-02-22 14:57:51 +01:00
parent d82e455bd5
commit f17f6e0c16
10 changed files with 40 additions and 31 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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}")