Skip to content

Commit

Permalink
send a message if the chain wasnt able to generate stuff in pol echo
Browse files Browse the repository at this point in the history
  • Loading branch information
bemxio committed Dec 9, 2024
1 parent b64b75e commit 1b56178
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cogs/impersonation.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@ async def echo(self, ctx: commands.Context, *, text: str):
dataset = await self.messages.containing(text)

if not dataset or len(dataset) < self.messages.min_limit:
return await ctx.message.reply("I couldn't find any messages containing that text.", mention_author=False)
return await ctx.message.reply("I couldn't find enough messages containing that text.", mention_author=False)

while True:
message = await self.messages.generate(dataset)

if not message:
return await ctx.message.reply("I couldn't generate a message based on that word.", mention_author=False)

if text in message:
break

Expand Down

0 comments on commit 1b56178

Please sign in to comment.