Update flanautils function names

This commit is contained in:
AlberLC
2022-12-03 06:21:39 +01:00
parent 90c15950fb
commit db8e020977
2 changed files with 3 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, WeatherBot, MultiBo
if message.chat.is_group and not self.is_bot_mentioned(message):
return
n_messages = flanautils.sum_numbers_in_text(message.text)
n_messages = flanautils.text_to_number(message.text)
if not n_messages:
n_messages = 1
@@ -170,7 +170,7 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, WeatherBot, MultiBo
await self.delete_message(message)
elif message.chat.is_group and self.is_bot_mentioned(message):
await self.send_negative(message)
elif message.chat.is_group and self.is_bot_mentioned(message) and (n_messages := flanautils.sum_numbers_in_text(message.text)):
elif message.chat.is_group and self.is_bot_mentioned(message) and (n_messages := flanautils.text_to_number(message.text)):
if not message.author.is_admin:
await self.send_negative(message)
return

View File

@@ -147,7 +147,7 @@ class PollBot(MultiBot, ABC):
if message.chat.is_group and not self.is_bot_mentioned(message):
return
if top_number := flanautils.sum_numbers_in_text(message.text):
if top_number := flanautils.text_to_number(message.text):
await self.send(random.randint(1, math.floor(top_number)), message)
else:
await self.send(random.choice(('¿De cuántas caras?', '¿Y el número?', '?', '🤔')), message)