forked from gooberinc/goober
added handling for empty breaking news
This commit is contained in:
parent
9215602ecc
commit
185ec16131
2 changed files with 7 additions and 1 deletions
|
@ -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")
|
||||
|
|
BIN
assets/images/cache/breaking_news.png
vendored
BIN
assets/images/cache/breaking_news.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.3 MiB |
Loading…
Add table
Add a link
Reference in a new issue