General fixes

This commit is contained in:
blankie 2022-08-24 21:42:40 +07:00
parent c0d035fcb4
commit e5962cfdc3
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 4 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
config.yaml
redditbot.session*
redditbot.json

View File

@ -172,10 +172,8 @@ async def main():
except asyncio.TimeoutError:
give_ups.add(unique_id)
logging.error('%s timed out', chat)
for i in bot_admins:
await client.send_message(i, f'{chat} timed out')
break
except BaseException:
return
except Exception:
give_ups.add(unique_id)
logging.exception(chat)
for i in bot_admins:
@ -186,7 +184,7 @@ async def main():
random_post, cpp = result
try:
await _actual_start_post(random_post, [chat], cpp, show_nsfw_warning, show_spoilers_warning)
except BaseException:
except Exception:
logging.exception(random_post.id)
for i in bot_admins:
await client.send_message(i, f'{random_post.id}\n{traceback.format_exc()}', parse_mode=None)