Files
hikkamods/данет.py
2022-09-23 11:52:59 +03:00

27 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)