handle empty tags

This commit is contained in:
2025-08-09 18:07:27 +03:00
parent 2c2088d993
commit a9518259fb

View File

@@ -229,7 +229,10 @@ async def add_tag(msg: Message):
return
for tag in args.split():
posts = await e621.get_posts(tag)
await redis.sadd(REDIS_SENT_KEY, *[post.id for post in posts])
if posts:
await redis.sadd(REDIS_SENT_KEY, *[post.id for post in posts])
else:
logging.warning(f'No posts found for tag {tag}')
await redis.sadd(REDIS_SUBS_KEY, tag)
await msg.reply(f'Tags {args} added')