From 8af352fbbeb3f01b4de118099b229898af1a2049 Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Wed, 20 Oct 2021 18:30:28 +0300 Subject: [PATCH] Added yesNo rus module --- данет.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 данет.py diff --git a/данет.py b/данет.py new file mode 100644 index 0000000..a9c0ce5 --- /dev/null +++ b/данет.py @@ -0,0 +1,26 @@ +from .. import loader, utils +import random + + +@loader.tds +class YesNoMod(loader.Module): + """Делает выбор за тебя в самых важных ситуациях""" + strings = {"name": "ДаНет", + "yes_words_cfg_doc": "Слова Да", + "no_words_cfg_doc": "Слова Нет"} + + def __init__(self): + self.config = loader.ModuleConfig( + "YES_WORDS", ["Да", "Ага", "Абсолютно", "Угу"], lambda m: self.strings("yes_words_cfg_doc", m), + "NO_WORDS", ["Нет", "Не-а", "Отрицательно", "Нееее"], lambda m: self.strings("no_words_cfg_doc", m)) + + @loader.unrestricted + async def данетcmd(self, message): + """Выбирает жизнь""" + yes = self.config["YES_WORDS"] + no = self.config["NO_WORDS"] + if random.getrandbits(1): + response = random.choice(yes) + else: + response = random.choice(no) + await utils.answer(message, response)