Update config names
This commit is contained in:
@@ -128,9 +128,9 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, WeatherBot, MultiBo
|
||||
if message.buttons_info.presser_user.is_admin is False:
|
||||
return
|
||||
|
||||
config = message.buttons_info.pressed_text.split()[1]
|
||||
message.chat.config[config] = not message.chat.config[config]
|
||||
message.buttons_info.pressed_button.text = f"{'✔' if message.chat.config[config] else '❌'} {config}"
|
||||
config_name = message.buttons_info.pressed_text.split()[1]
|
||||
message.chat.config[config_name] = not message.chat.config[config_name]
|
||||
message.buttons_info.pressed_button.text = f"{'✔' if message.chat.config[config_name] else '❌'} {config_name}"
|
||||
|
||||
await self.edit(message.buttons_info.buttons, message)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class WeatherBot(MultiBot, ABC):
|
||||
if message.is_inline:
|
||||
show_progress_state = False
|
||||
elif message.chat.is_group and not self.is_bot_mentioned(message):
|
||||
if message.chat.config['weather_chart']:
|
||||
if message.chat.config['auto_weather_chart']:
|
||||
if BotAction.find_one({'action': Action.AUTO_WEATHER_CHART.value, 'chat': message.chat.object_id, 'date': {'$gt': datetime.datetime.now(datetime.timezone.utc) - constants.AUTO_WEATHER_EVERY}}):
|
||||
return
|
||||
show_progress_state = False
|
||||
@@ -56,7 +56,7 @@ class WeatherBot(MultiBot, ABC):
|
||||
place_words = (
|
||||
OrderedSet(original_text_words)
|
||||
- flanautils.cartesian_product_string_matching(original_text_words, multibot_constants.KEYWORDS['show'], min_score=0.85).keys()
|
||||
- flanautils.cartesian_product_string_matching(original_text_words, constants.KEYWORDS['weather_chart'], min_score=0.85).keys()
|
||||
- flanautils.cartesian_product_string_matching(original_text_words, constants.KEYWORDS['weather'], min_score=0.85).keys()
|
||||
- flanautils.cartesian_product_string_matching(original_text_words, multibot_constants.KEYWORDS['date'], min_score=0.85).keys()
|
||||
- flanautils.cartesian_product_string_matching(original_text_words, multibot_constants.KEYWORDS['thanks'], min_score=0.85).keys()
|
||||
- flanautils.CommonWords.get()
|
||||
|
||||
@@ -7,12 +7,14 @@ from multibot.models import Chat as MultiBotChat
|
||||
|
||||
@dataclass(eq=False)
|
||||
class Chat(MultiBotChat):
|
||||
DEFAULT_CONFIG = {'check_flood': False,
|
||||
'delete_original': True,
|
||||
'insult': True,
|
||||
'punish': False,
|
||||
'scraping': True,
|
||||
'weather_chart': False}
|
||||
DEFAULT_CONFIG = {
|
||||
'auto_insult': True,
|
||||
'auto_scraping': True,
|
||||
'auto_weather_chart': False,
|
||||
'check_flood': False,
|
||||
'delete_original': True,
|
||||
'punish': False
|
||||
}
|
||||
|
||||
config: dict[str, bool] = field(default_factory=dict)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user