From 3e3e4ef73320b75df09fdca9d71515cd1ca4dafe Mon Sep 17 00:00:00 2001
From: Abhi <85984486+AbhiTheModder@users.noreply.github.com>
Date: Sat, 6 Jan 2024 22:22:16 +0000
Subject: [PATCH] Move switch to extra repo
---
modules/switch.py | 51 -----------------------------------------------
1 file changed, 51 deletions(-)
delete mode 100644 modules/switch.py
diff --git a/modules/switch.py b/modules/switch.py
deleted file mode 100644
index 06a176f..0000000
--- a/modules/switch.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Moon-Userbot - telegram userbot
-# Copyright (C) 2020-present Moon Userbot Organization
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-from pyrogram import Client, filters, enums
-from pyrogram.types import Message
-
-from utils.misc import modules_help, prefix
-
-ru_keys = (
- """ёйцукенгшщзхъфывапролджэячсмитьбю.Ё"№;%:?ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,"""
-)
-en_keys = (
- """`qwertyuiop[]asdfghjkl;'zxcvbnm,./~@#$%^&QWERTYUIOP{}ASDFGHJKL:"|ZXCVBNM<>?"""
-)
-table = str.maketrans(ru_keys + en_keys, en_keys + ru_keys)
-
-
-@Client.on_message(filters.command(["switch", "sw"], prefix) & filters.me)
-async def switch(client: Client, message: Message):
- if len(message.command) == 1:
- if message.reply_to_message:
- text = message.reply_to_message.text
- else:
- history = await client.get_history(message.chat.id, limit=2)
- if history and history[1].from_user.is_self and history[1].text:
- text = history[1].text
- else:
- await message.edit("Text to switch not found", parse_mode=enums.ParseMode.HTML)
- return
- else:
- text = message.text.split(maxsplit=1)[1]
-
- await message.edit(str.translate(text, table), parse_mode=enums.ParseMode.HTML)
-
-
-modules_help["switch"] = {
- "sw [reply/text for switch]*": "Useful when you forgot to change the keyboard layout",
-}