added handling for empty breaking news

This commit is contained in:
ctih1 2025-07-26 20:08:48 +03:00
parent 9215602ecc
commit 185ec16131
2 changed files with 7 additions and 1 deletions

View file

@ -59,7 +59,13 @@ class BreakingNews(commands.Cog):
logger.debug(texts)
try:
path = self.__insert_text(texts[1])
text = texts[1].strip()
if not self.model:
await message.reply("No news specified and model not found!")
return False
text = text or self.model.make_sentence(max_chars=50, tries=50)
path = self.__insert_text(text)
except IndexError:
if self.model is None:
await message.reply("No model loaded and no breaking news specified")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Before After
Before After