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))
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, "✅ Удаление уведомлений отключено")
async def show_aliases_wrapper(message: Message, **kwargs): db = Database.get_current() logger.info(f"Просмотр алиасов\n") await edit_message(message, show_aliases(db))
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()
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, "✅ Настройка изменена")
def remove_alias(database: Database, alias: Alias) -> None: database.aliases.remove(alias) database.save()
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()
async def duty_signal_new_line(message: Message, alias: Alias, signal: str): db = Database.get_current() await send_signal(db, message, alias, '\n', signal)
def service_prefix(value: str): db = Database.get_current() if value.lower() in db.service_prefixes: return value
def repeater_word(value: str): db = Database.get_current() if value.startswith(db.repeater_word): return value.replace(db.repeater_word, '', 1)
def duty_prefix(value: str): db = Database.get_current() if value.lower() in db.duty_prefixes: return value
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
def alias(value: str): db = Database.get_current() for alias_ in db.aliases: if value.lower() == alias_.command_from: return alias_
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
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, "✅ Настройка изменена")
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
async def duty_signal(message: Message, alias: Alias, signal: str = None): db = Database.get_current() await send_signal(db, message, alias, ' ', signal)