Example #1
0
async def show_mute_members_wrapper(message: Message, **kwargs):
    db = Database.get_current()
    await edit_message(
        message, await show_muted_members(db, message.api, message.peer_id))
Example #2
0
async def deactivate_delete_all_notify_wrapper(message: Message, **kwargs):
    db = Database.get_current()
    db.delete_all_notify = False
    db.save()
    await edit_message(message, "✅ Удаление уведомлений отключено")
Example #3
0
async def show_aliases_wrapper(message: Message, **kwargs):
    db = Database.get_current()
    logger.info(f"Просмотр алиасов\n")
    await edit_message(message, show_aliases(db))
Example #4
0
def add_muted_member(database: Database, member_id: int, peer_id: int) -> None:
    database.muted_members.append(
        MutedMembers(member_id=member_id, chat_id=peer_id))
    database.save()
Example #5
0
async def auto_exit_setting_on_exit_wrapper(message: Message, **kwargs):
    db = Database.get_current()
    await set_auto_exit(db, delete_chat=False)
    await edit_message(message, "✅ Настройка изменена")
Example #6
0
def remove_alias(database: Database, alias: Alias) -> None:
    database.aliases.remove(alias)
    database.save()
Example #7
0
def add_ignore_member(database: Database, member_id: int,
                      peer_id: int) -> None:
    database.ignored_members.append(
        IgnoredMembers(member_id=member_id, chat_id=peer_id))
    database.save()
Example #8
0
async def duty_signal_new_line(message: Message, alias: Alias, signal: str):
    db = Database.get_current()
    await send_signal(db, message, alias, '\n', signal)
Example #9
0
def service_prefix(value: str):
    db = Database.get_current()
    if value.lower() in db.service_prefixes:
        return value
Example #10
0
def repeater_word(value: str):
    db = Database.get_current()
    if value.startswith(db.repeater_word):
        return value.replace(db.repeater_word, '', 1)
Example #11
0
def duty_prefix(value: str):
    db = Database.get_current()
    if value.lower() in db.duty_prefixes:
        return value
Example #12
0
def role_play_command(value: str):
    db = Database.get_current()
    for rp_cmd in db.role_play_commands:
        if value.lower() == rp_cmd.name.lower():
            return rp_cmd
Example #13
0
def alias(value: str):
    db = Database.get_current()
    for alias_ in db.aliases:
        if value.lower() == alias_.command_from:
            return alias_
Example #14
0
 async def check(self, message: Message) -> bool:
     db = Database.get_current()
     for ignore_member in db.igrored_global_members:
         if ignore_member.member_id == message.from_id:
             return True
     return False
Example #15
0
async def auto_exit_setting_on_exit_wrapper(message: Message, **kwargs):
    db = Database.get_current()
    await set_auto_exit(db, black_list=True)
    await edit_message(message, "✅ Настройка изменена")
Example #16
0
 async def check(self, message: Message) -> bool:
     db = Database.get_current()
     for muted_member in db.muted_members:
         if muted_member.chat_id == message.peer_id and muted_member.member_id == message.from_id:
             return True
     return False
Example #17
0
async def duty_signal(message: Message, alias: Alias, signal: str = None):
    db = Database.get_current()
    await send_signal(db, message, alias, ' ', signal)