diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..5e2d95422896506c72439686f9f1238a489ca561 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +.webm +*.mp3 +*.mp4 +*.webp +*.weba +*.part +*.ytdl +final.png +background.png +temp.png +# python +venv/ +__pycache__/ +# tgbot +config.py +*.session +*.session-journal \ No newline at end of file diff --git a/.github/.gitkeep b/.github/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/.github/workflows/.gitkeep b/.github/workflows/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000000000000000000000000000000000000..3ca1a96ef1842af06ed70fcfc363d9717eaaa00e --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,26 @@ +name: Auto Fix +on: [push] +jobs: + python-auto-fix: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install black isort autoflake flake8 + - name: Auto Fix + run: | + black --exclude=venv . + isort --skip-glob='**/venv/**' . + autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports . + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --extend-ignore=E203,W503 + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Code Analysis + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Auto Fix" + commit_options: "--no-verify" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f399bd53a6276c5137847cfde3ceb5a8380ded26 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.10 + +RUN apt-get update -y && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends ffmpeg neofetch \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY . /app/ +WORKDIR /app/ + +RUN pip3 install --no-cache-dir --upgrade --requirement requirements.txt + +CMD bash start \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Procfile b/Procfile new file mode 100644 index 0000000000000000000000000000000000000000..e529b50ac60a6dcfddd6702013cd1e1c1a6fdc4d --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +worker: python3 -m ubot diff --git a/app.json b/app.json new file mode 100644 index 0000000000000000000000000000000000000000..dcaa7a8e51edfd127ca835a1fde6a18b94a34e5a --- /dev/null +++ b/app.json @@ -0,0 +1,49 @@ +{ + "env": { + "SESSION_STRING": { + "description": "", + "required": true + }, + "BOT_TOKEN": { + "description": "", + "required": true + }, + "API_ID": { + "description": "", + "required": true + }, + "BLACKLIST_CHAT": { + "description": "", + "required": false, + "value": "-1001473548283" + }, + "API_HASH": { + "description": "", + "required": true + }, + "LOG_UBOT": { + "description": "", + "required": true + }, + "OWNER_ID": { + "description": "", + "required": false, + "value": "5262326516" + }, + "MONGO_URL": { + "description": "", + "required": true + }, + "COMMAND": { + "description": "", + "required": true + }, + "TEXT_PAYMENT": { + "description": "", + "required": true + } + }, + "buildpacks": [ + {"url": "heroku/python"} + ] +} diff --git a/cookies.txt b/cookies.txt new file mode 100644 index 0000000000000000000000000000000000000000..4fd1db9895884571bcb2e4f3b852e524f9b96b96 --- /dev/null +++ b/cookies.txt @@ -0,0 +1,62 @@ +# Netscape HTTP Cookie File +# http://curl.haxx.se/rfc/cookie_spec.html +# This is a generated file! Do not edit. + +.youtube.com TRUE / TRUE 1742495179 GPS 1 +.youtube.com TRUE / TRUE 0 YSC NMQgqj8IHIY +.youtube.com TRUE / TRUE 1758045461 VISITOR_INFO1_LIVE 1KSM8NRk7Gc +.youtube.com TRUE / TRUE 1758045461 VISITOR_PRIVACY_METADATA CgJJRBIEGgAgWg%3D%3D +.chromewebstore.google.com TRUE / FALSE 1777053403 _ga GA1.1.443692314.1742493403 +chromewebstore.google.com FALSE / TRUE 1745085403 OTZ 8003157_28_28__28_ +.chromewebstore.google.com TRUE / FALSE 1777053421 _ga_KHZNC1Q6K0 GS1.1.1742493402.1.1.1742493421.0.0.0 +accounts.google.com FALSE / TRUE 1745085436 OTZ 8003157_28_28__28_ +.google.com TRUE / TRUE 1758304584 NID 522=ROpAQMxeipmPI5hJSIfAy1gRsNT2lWZ0rUik0jUIc15NZzZfNF6qLW-6aQAiJGtTK8q-kgydEhI3NvlxBzEY3iQ9h6ceglj9MKUVTLnvVSLfwnHM4LHphhuIJtQZOVite4cYpPzNoc1lGLkfm76Kt25XW_96INY2P-xWfU1yfNBEtYn9DNhmeqBA61YayNJmoW7qcipagvVUiqWmcGQKSwqp8FltuqeaKNDDWDb5i9OnyQ3adwBItNb2lC2uod5J6uq18NedbP8ZicNZxajQdhkMdczXpUCq_zW_f76VJmCWJePBy4WazSXIyAo1fA6ArCQFlb4ngWkY5GByERN1NuNsC016t_TIO3bnHdB0VGaETfxuh75TMHrF_1nMrZjZdFFci7iFGPNwaFFwUhAGOis-HQez937tUazv7ZpjXf7nV5F7Pmr0zWdj1lPmUuZM-W9EsDrjm2wbQQ7rGB7uW_3aAukNspprZiF03pP-OR_CayrXVPfXksHZ-a3EqAta6WqleUBiuFGQQf6pw7priv3CNnJzrT3BZL1R9VUvYurXhIpX_afb9aS_k4bRwoXAoRZlQzO0NaF0KUsMKWYcyH0IJwkFvL90FbrQct7m5KY4cJg7plnc20C62NPeQzNLsEYQkMMK +.google.com TRUE / FALSE 1777053453 SID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHejaAuju9q0ZOnulmIj204wACgYKAVQSARMSFQHGX2Mi9xQ3JCZOKSx7fK5T5lFE2RoVAUF8yKp0A8SkSkWUn0FOr7IlYd3f0076 +.google.com TRUE / TRUE 1777053453 __Secure-1PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHaG8fC83GVGtdHIPaagOH5QACgYKAX8SARMSFQHGX2Migyw2qqLXKUZMe_JVb7ZWhxoVAUF8yKrlokpWBOo5od-qydz_8M750076 +.google.com TRUE / TRUE 1777053453 __Secure-3PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFH9jcjN6xmybllJElETyydbwACgYKAU4SARMSFQHGX2Mi0NutW1iOfmvqOI5MRl8O6xoVAUF8yKp_EUYRLrtV_uj6QXNXU_530076 +.google.com TRUE / FALSE 1777053453 HSID ATGq7DD9MUY8rNePd +.google.com TRUE / TRUE 1777053453 SSID A5F08K1748DP7xWdG +.google.com TRUE / FALSE 1777053453 APISID FAbCw9ISRnDMJZNq/A5zaDoEEthvwA0zd_ +.google.com TRUE / TRUE 1777053453 SAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.google.com TRUE / TRUE 1777053453 __Secure-1PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.google.com TRUE / TRUE 1777053453 __Secure-3PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +accounts.google.com FALSE / TRUE 1777053453 __Host-GAPS 1:wk8AAJGgerDGlli0Zi1i8lAK698iwuUKsGj2k5GsgcmexLyBhpHD5xIdL-tVM84HFrMPQgs7evzcuJC944b2aETAwhD7ew:pKpPHCI1C7e35Rez +accounts.google.com FALSE / TRUE 1777053453 LSID s.ID|s.youtube:g.a000vAh-rxC0vfqo74SRxoaj8Kox679AsDaM78ZseMFlgr-5ijMqKeUgE0zmSQ-tcepaHJB6twACgYKAbMSARMSFQHGX2MiGWA_of0kCQhe7cs3RaFVIBoVAUF8yKqTD1uoXa8Yq5kA_VWpjRdg0076 +accounts.google.com FALSE / TRUE 1777053453 __Host-1PLSID s.ID|s.youtube:g.a000vAh-rxC0vfqo74SRxoaj8Kox679AsDaM78ZseMFlgr-5ijMqPtkX-h07W0-1r78y3EZIDwACgYKAWsSARMSFQHGX2MivKGYihu0FGylVmuc-AV1vhoVAUF8yKr6qaewtWTkn4TV_TfbDB3m0076 +accounts.google.com FALSE / TRUE 1777053453 __Host-3PLSID s.ID|s.youtube:g.a000vAh-rxC0vfqo74SRxoaj8Kox679AsDaM78ZseMFlgr-5ijMqXtOba46wnHiFTTaqgJBL3wACgYKATISARMSFQHGX2MiJoqRJnWljdDlOHls36vlMxoVAUF8yKqV0dOh7MizgT-qboPPEA5i0076 +accounts.google.com FALSE / TRUE 1777053453 ACCOUNT_CHOOSER AFx_qI64q5aQBDfPNVPSwUNgpq-rfyXVYEOPoRzUn99LSGuWM4ElPxxZIEkC3wDqZMBOk0dALPcI0ja3_dK9Dflp38NPLfKyXcASIvuOEsDkHyiTofC-u-O8nQvdjY22VuQ6m-_1wJql +.youtube.com TRUE / FALSE 1777053461 HSID AuJsLBa_AeRgZJgn5 +.youtube.com TRUE / TRUE 1777053461 SSID ATdK1Fc5-PY4mJgx3 +.youtube.com TRUE / FALSE 1777053461 APISID FAbCw9ISRnDMJZNq/A5zaDoEEthvwA0zd_ +.youtube.com TRUE / TRUE 1777053461 SAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.youtube.com TRUE / TRUE 1777053461 __Secure-1PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.youtube.com TRUE / TRUE 1777053461 __Secure-3PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.youtube.com TRUE / FALSE 1777053461 SID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHejaAuju9q0ZOnulmIj204wACgYKAVQSARMSFQHGX2Mi9xQ3JCZOKSx7fK5T5lFE2RoVAUF8yKp0A8SkSkWUn0FOr7IlYd3f0076 +.youtube.com TRUE / TRUE 1777053461 __Secure-1PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHaG8fC83GVGtdHIPaagOH5QACgYKAX8SARMSFQHGX2Migyw2qqLXKUZMe_JVb7ZWhxoVAUF8yKrlokpWBOo5od-qydz_8M750076 +.youtube.com TRUE / TRUE 1777053461 __Secure-3PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFH9jcjN6xmybllJElETyydbwACgYKAU4SARMSFQHGX2Mi0NutW1iOfmvqOI5MRl8O6xoVAUF8yKp_EUYRLrtV_uj6QXNXU_530076 +.google.co.id TRUE / FALSE 1777053461 HSID AuJsLBa_AeRgZJgn5 +.google.co.id TRUE / TRUE 1777053461 SSID ATdK1Fc5-PY4mJgx3 +.google.co.id TRUE / FALSE 1777053461 APISID FAbCw9ISRnDMJZNq/A5zaDoEEthvwA0zd_ +.google.co.id TRUE / TRUE 1777053461 SAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.google.co.id TRUE / TRUE 1777053461 __Secure-1PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.google.co.id TRUE / TRUE 1777053461 __Secure-3PAPISID OZVAFzZpS49D7nm6/A97O0L_AYKjZCk7Gu +.google.co.id TRUE / FALSE 1777053461 SID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHejaAuju9q0ZOnulmIj204wACgYKAVQSARMSFQHGX2Mi9xQ3JCZOKSx7fK5T5lFE2RoVAUF8yKp0A8SkSkWUn0FOr7IlYd3f0076 +.google.co.id TRUE / TRUE 1777053461 __Secure-1PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFHaG8fC83GVGtdHIPaagOH5QACgYKAX8SARMSFQHGX2Migyw2qqLXKUZMe_JVb7ZWhxoVAUF8yKrlokpWBOo5od-qydz_8M750076 +.google.co.id TRUE / TRUE 1777053461 __Secure-3PSID g.a000vAh-r33pTXu66l_ztYc6yr2q6egEXbqWhmqKeUGXMj9xntFH9jcjN6xmybllJElETyydbwACgYKAU4SARMSFQHGX2Mi0NutW1iOfmvqOI5MRl8O6xoVAUF8yKp_EUYRLrtV_uj6QXNXU_530076 +.youtube.com TRUE / TRUE 1758045453 __Secure-ROLLOUT_TOKEN CI3P1O2sqL2GEhCE_urXnZmMAxjowZP7nZmMAw%3D%3D +.google.com TRUE / FALSE 1774029461 SIDCC AKEyXzUtIgVVxOvXMN4Mo5pyaKTN09ZOwkvdVOXcEUR8GVtzKoE59NsK3v-pHaZ3WcEUrmkPPg +.google.com TRUE / TRUE 1774029461 __Secure-1PSIDCC AKEyXzVm_w7ARPsvhWH-2YuaYJCr1v4yLh_4TYjaYwAqoJvhSTRjHr6j5-2tyo8YF0frCNoR +.youtube.com TRUE / TRUE 1774029461 __Secure-1PSIDTS sidts-CjIB7pHptW3hpTyzz4VYfJwJRu0iE9zHey9cleF0sUMLcGvcJE28Qdz0JKJJK6ENP3dfYxAA +.youtube.com TRUE / TRUE 1774029461 __Secure-3PSIDTS sidts-CjIB7pHptW3hpTyzz4VYfJwJRu0iE9zHey9cleF0sUMLcGvcJE28Qdz0JKJJK6ENP3dfYxAA +.google.co.id TRUE / TRUE 1758304653 NID 522=ZWpmHYYnca1fr63ObY2yCUGO6RqOCxXH2z-MgU8ozlNv1sNCaJxdYa53ypc68oOhYK-A5Tf7OPGu76Mc-PK3b2NbdYo156Lx_QTZsMOTDXAn01D6YZtw0n4mjdxgi02BLNQueLAYEAdkjqfigntl0o-znRHxyhe1uW_21qmIlDlNn7PNc941c0JRM2PXWPqbT_aTVcINB-MUwhElmIvcSdR1jxFo2QtYBM8N5NCTcCKW2zgN3YuVeNTdlfaCrtruhHCSS7vTuZyEFF0sHITwNTQfZm-r-djHSEZKNIdHMb6llf6mB7ZgZB9kRaqNAT3rvMbHwPB-i1EmtvAJIgcwbAagzX58qZy-WCYH6njUhuol0TMonYDJnwgrzd3caNY3_hyzZMCw-0jY0xPc_ufypJK6I1ivkjbLcBwIlKEDK6SGAIkZCZdJvR5ehTeK0RBKVKCkbB19ERqLklDneNzqgpbDpqTRWnfTzWK06MAglR8JUPwGU2uD8qHcqGu7QFzCySneWHMC5jjv2mI53qI7ktz03E-yhKZ8zOp0NfrilErsgaTXQkmW0NFvXEhL9PELu70G2Nkdb87DPfDzSPbl0trRI6iSK6xmi2twLaqSq2rrPMlPeM4JR1PZISxFRRY +.youtube.com TRUE / TRUE 1777053461 LOGIN_INFO AFmmF2swRgIhANNWB6VfLV2z11-qzouReMrOZDKMobfiEJ_GpSe9aX6ZAiEA6fyMbvxZLSrOkQjMTBE1bH4M2eaBRJUfcpRy7P3Tsis:QUQ3MjNmd3F6aElJWHEyNllMX2NfSUk5Rjh2YTdkZ0JuOWVuZWMwa0hVWmpWakUwWmFXNGtrcXREUGw4dEVsWVVaVlpINzlRT1VhRUdYZlR0cHFzcmwxUzBUWkx5NE5FMFMtTVAwanZVTFd0V29QX21IZXhpblFaMkdhSW9DSkUyN2NBN1d2WVRWM0tOQUJzMGhSUzFGUjZsT0d2VHljc1Nn +.youtube.com TRUE / TRUE 1777053548 PREF f6=40000000&tz=Asia.Jakarta&f4=4000000&f7=100 +.doubleclick.net TRUE / TRUE 1758045497 APC AfxxVi5J5muTFUpyPJjekSrNCC8Cflp0tDhyq5zg3ZGJMTSEzJ6-Vw +.doubleclick.net TRUE / TRUE 1745085497 ar_debug 1 +.doubleclick.net TRUE / TRUE 1758045497 receive-cookie-deprecation 1 +.doubleclick.net TRUE / TRUE 1777053497 IDE AHWqTUnuyYeW13I4dphsoQWfFmV4-ThjsfPo0G78w1SNH_zVQADXELgjNWoI7woEC74 +.youtube.com TRUE / TRUE 1742494105 CONSISTENCY AKreu9vypuk8Wg6Vp2vH7OLdrdLI6UXTtReV6KS8Lwvo_4BbV4HkkYlR-IjQ_Vh4xGyuo_S-b489zXPY_hoi5pCKKJEAw0_BZTWwiOg-xsdjG6bIK9kq9ooefqSDV-hyY7ZuTftDD1vKNDIS_7Hth_qx +.google.com TRUE / TRUE 1774029550 __Secure-3PSIDCC AKEyXzUv6VVgZSCsg1BzWrHu-agRTl_ikgRHKLvQkKNXPsSlBKPan4yowiV3_zounh-uH4VY +.youtube.com TRUE / FALSE 1774029552 SIDCC AKEyXzWGRayUMY-oUqSN-oqth_dWIdH0jo6CQhTaqBP5dh4TW5Rk4KNoJkk7-Bs8M8XsxuCniw +.youtube.com TRUE / TRUE 1774029552 __Secure-1PSIDCC AKEyXzXu5MvpCn_i0503bteT_uiOo9TarcgJN9FMVM4yW3PiiEfRBHAkChxu_z4QpgAEdbGeYw +.youtube.com TRUE / TRUE 1774029552 __Secure-3PSIDCC AKEyXzVFZObT8kF1rmnr0R1HTRtbtWJmPocI0PnGsKrBMEpnl2JlbFV0bQ3QZGejq6_OsVkx \ No newline at end of file diff --git a/generate.py b/generate.py new file mode 100644 index 0000000000000000000000000000000000000000..976e98d8b83307a1a3632546873f79a79fd017eb --- /dev/null +++ b/generate.py @@ -0,0 +1,29 @@ +from asyncio import run + +from pyrogram import Client as c + +API_ID = input("\nEnter Your API_ID:\n > ") +API_HASH = input("\nEnter Your API_HASH:\n > ") + +print("\n\n Enter Phone number when asked.\n\n") + +i = c(name="pyrogram", api_id=API_ID, api_hash=API_HASH, in_memory=True) + + +async def main(): + await i.start() + ss = await i.export_session_string() + await i.send_message( + i.me.id, + f""" +STRING_PYROGRAM + +`{ss}` + +YOUR_ID: {i.me.id} +""", + ) + print("Please check your saved messages") + + +run(main()) diff --git a/github-action.txt b/github-action.txt new file mode 100644 index 0000000000000000000000000000000000000000..763427016e24dffa551890584ad157565229a97e --- /dev/null +++ b/github-action.txt @@ -0,0 +1,10 @@ +autoflake==2.1.1 +black==23.3.0 +click==8.1.3 +isort==5.12.0 +mypy-extensions==1.0.0 +packaging==23.1 +pathspec==0.11.1 +platformdirs==3.6.0 +pyflakes==3.0.1 +tomli==2.0.1 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..a56b5e875579380862be0a6b44ef374a28b3c94b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,43 @@ +py-tgcalls==2.0.2 +ntgcalls==1.2.1 +kymang==2.0.2 +git+https://github.com/naya1503/pyrogram +tgcrypto +pytz +psutil +dnspython==2.3.0 +python-dotenv +GitPython +pykeyboard +bs4 +pymediainfo +opencv-python-headless +unidecode +attrify +pySmartDL +html2text +removebg +aiofiles +aiohttp +gpytranslate +gtts +telegraph +pyromod==1.1 +openai +youtube-search-python +yt-dlp +wget +python-dateutil +emoji +search_engine_parser +httpx[http2] +httpx +pytimeparse +flask +flask_restful +uvloop +Pillow==8.3.2 +motor==3.0.0 +requests +meval +speedtest-cli diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000000000000000000000000000000000000..e2a09b68339f9b2fca35481167a6844262a8f045 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.* diff --git a/start b/start new file mode 100644 index 0000000000000000000000000000000000000000..45ad88ae2893aeda28d0f14640f78d9810a4d9ac --- /dev/null +++ b/start @@ -0,0 +1,2 @@ +git pull +python3 -m ubot \ No newline at end of file diff --git a/storage/15.otf b/storage/15.otf new file mode 100644 index 0000000000000000000000000000000000000000..7ca959a60ba4086514cce5a3d49473842f87707c --- /dev/null +++ b/storage/15.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d884ef26a2b02efdb34365d8850b92a50cc3d6878355c9cfbb7bf57baa184cd1 +size 344944 diff --git a/storage/16.otf b/storage/16.otf new file mode 100644 index 0000000000000000000000000000000000000000..8273971159f32a442de5a941cbf0c9455153fcb3 --- /dev/null +++ b/storage/16.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4418223b8bdbc613972b6f76ab2777ab329bbd9a02778a495a303602fd9844d4 +size 48840 diff --git a/storage/17.ttf b/storage/17.ttf new file mode 100644 index 0000000000000000000000000000000000000000..775d772ae0bc9fed6e5d51cd48ebf48ec9712987 --- /dev/null +++ b/storage/17.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3398a13fa56d7cc47454ad2dc455b150f54e0bd0eaaaf2df2fb49e664053d093 +size 395312 diff --git a/storage/18.ttf b/storage/18.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bc5aed5bd2bf7ad96983aabdc14bd6652006054d --- /dev/null +++ b/storage/18.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dd09420a6dc82bfc88ed89268e93cc58225ecc183711c21630eb3455d39304a +size 31436 diff --git a/storage/19.ttf b/storage/19.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0adbf5fc479407ba2fa962ca3ba61b3b24738be1 --- /dev/null +++ b/storage/19.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c185db8d7be47e411a56c3b5b87c0748ec16d3ca558dcbbbcc46dd926b3b5fe6 +size 446644 diff --git a/storage/2.ttf b/storage/2.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fe48fba5b809cfafa06cf54347a320005ba2dad7 --- /dev/null +++ b/storage/2.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bb0d23e78dc94851b86732c28b9e0da1724893ba9301483bfdfcea50c19fac4 +size 21872 diff --git a/storage/20.ttf b/storage/20.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7d293ea87d0e6ba8e68a9b78a7adb6ff3cd779a1 --- /dev/null +++ b/storage/20.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9405a3d44fa8a40f12990bf2fc557ee08b107dcdb70f2f6af7490cfd9269706b +size 706524 diff --git a/storage/22.otf b/storage/22.otf new file mode 100644 index 0000000000000000000000000000000000000000..b1fe850e7b83a3d703355a5cbf73eb883175a48a --- /dev/null +++ b/storage/22.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cb2c9c70eb40ede42414dae08ff4d77108d654cb136a1c80118ea9396c0142f +size 28004 diff --git a/storage/23.ttf b/storage/23.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e1e0de4b104faae7e85ba782c1da8e21f5547e10 --- /dev/null +++ b/storage/23.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e34b5e344275fb0da0698c2c3f48e34a83496639b965619266a39371d567a59 +size 26572 diff --git a/storage/24.ttf b/storage/24.ttf new file mode 100644 index 0000000000000000000000000000000000000000..524e17ef1ab983321d79a97eff059e2a70b2042c --- /dev/null +++ b/storage/24.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e11431fef495416e4df0360d9b2158563ad008efe8e25a99403d7d793dee04 +size 41416 diff --git a/storage/3.ttf b/storage/3.ttf new file mode 100644 index 0000000000000000000000000000000000000000..82b50f2d870bbba748c687e4b04c569f37822624 --- /dev/null +++ b/storage/3.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7ac136a7670f9c57bc9cb612466829ddf4ce628c5c9738aca693821d300159b +size 11688 diff --git a/storage/4.ttf b/storage/4.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d508e3f0554f67d38d68c8725bc2aaa61ce87201 --- /dev/null +++ b/storage/4.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22476934b7fd7fbe26e47b6224d118e6c31d39bde23bab8bedbded2f88dd24af +size 51256 diff --git a/storage/6.ttf b/storage/6.ttf new file mode 100644 index 0000000000000000000000000000000000000000..24ae7906c035fbd8b607ee5cc86b6cfdb73d3092 --- /dev/null +++ b/storage/6.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdc8a783806a63a7671a24c3cec2b8e1eb15a9a7b3d611d0a704ed2bd1f3d824 +size 53744 diff --git a/storage/7.otf b/storage/7.otf new file mode 100644 index 0000000000000000000000000000000000000000..e4b66c9b818153336d15c6ef97f21f3b6c0c976b --- /dev/null +++ b/storage/7.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca2a6ef77010ed61ffa5ecdccfa40654f9d633abac02bf98180c3fa4e26b29ef +size 8244 diff --git a/storage/9.ttf b/storage/9.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7ffd67eda8d26eecac25056383a9ae7d6297ed54 --- /dev/null +++ b/storage/9.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dce9671e258eefd69623ea9a9b9d3bcb980183d4905c7946daf9443587d3a4e +size 32136 diff --git a/storage/AVENGEANCE HEROIC AVENGER AT.otf b/storage/AVENGEANCE HEROIC AVENGER AT.otf new file mode 100644 index 0000000000000000000000000000000000000000..e7060503bd9413eeb0601fe300754d5a6f8a6126 --- /dev/null +++ b/storage/AVENGEANCE HEROIC AVENGER AT.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efe44ac1f2d1db3f2959f0cf495e00f138d782af14a628032f9a634208fc9be3 +size 101068 diff --git a/storage/AVENGEANCE HEROIC AVENGER AT.ttf b/storage/AVENGEANCE HEROIC AVENGER AT.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0a07503e65605dffc75caa1e617f36375f516cb6 --- /dev/null +++ b/storage/AVENGEANCE HEROIC AVENGER AT.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:026d2bc24998acbf542d3a7d750c64755ff34cb8fb5fec6875a4f0d628978133 +size 167120 diff --git a/storage/AVENGEANCE HEROIC AVENGER BI.otf b/storage/AVENGEANCE HEROIC AVENGER BI.otf new file mode 100644 index 0000000000000000000000000000000000000000..b3ff0c1f60dbf17513b3ac8b18fd6ad699e40dc5 --- /dev/null +++ b/storage/AVENGEANCE HEROIC AVENGER BI.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d2d958e877dfd57b3216d9907eb756ab21a11f05f3ee3bdd44a746bd1f3cb0b +size 101056 diff --git a/storage/Big Space.otf b/storage/Big Space.otf new file mode 100644 index 0000000000000000000000000000000000000000..04bfaa804d2a09affb019b569b9d6f3fe15cd50a --- /dev/null +++ b/storage/Big Space.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a7ffc34acac7a33b2ad61252fa700770d10be7b1f19a66633331681af297296 +size 45708 diff --git a/storage/Blessed.ttf b/storage/Blessed.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0056d48ec6edcbfcc62468f5d879b9c3187cfd90 --- /dev/null +++ b/storage/Blessed.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a52e44eacf1a17532f648f4c8cf7b0bc481db9566bbd9b5d64f2a1169af0dede +size 207576 diff --git a/storage/CRAWLER-RegularDEMO.ttf b/storage/CRAWLER-RegularDEMO.ttf new file mode 100644 index 0000000000000000000000000000000000000000..018e509ed76d94e53d5c55b9c3654aaf3e08cb1f --- /dev/null +++ b/storage/CRAWLER-RegularDEMO.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:027247270344187686188dba69fbbb870a1ac085e19cdd182245ee12e8028a1d +size 84540 diff --git a/storage/CROWNT.TTF b/storage/CROWNT.TTF new file mode 100644 index 0000000000000000000000000000000000000000..4fb026e2d6e764d459423fb85f617b87138d3703 --- /dev/null +++ b/storage/CROWNT.TTF @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a7f5d314aa8b44500da428d3b386692b09fd2429917045999e566d970036388 +size 19208 diff --git a/storage/Chopsic.otf b/storage/Chopsic.otf new file mode 100644 index 0000000000000000000000000000000000000000..f7fb542e190811dadca21f9fd878f7b32f41546b --- /dev/null +++ b/storage/Chopsic.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:781678382345c604694317b82e526fdf07d7c20140e648ebef09debc8a541d04 +size 24264 diff --git a/storage/Crozzoe-Personal-Use.otf b/storage/Crozzoe-Personal-Use.otf new file mode 100644 index 0000000000000000000000000000000000000000..6d6fb7fca4e18e8dce28680b357ca6df7eacbe4e --- /dev/null +++ b/storage/Crozzoe-Personal-Use.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:186ea9b397e082d4be919213bbff04f6a73135447799d7f844b8cb0c35997397 +size 128824 diff --git a/storage/DIGIT.ttf b/storage/DIGIT.ttf new file mode 100644 index 0000000000000000000000000000000000000000..df4c6a5067e47585f40f05520314f83683bcdd36 --- /dev/null +++ b/storage/DIGIT.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d330a549ac9e7e73b8514136989517ef0deacbd003a4f3d66a7252d64d55b31 +size 25480 diff --git a/storage/Damages-Italic.ttf b/storage/Damages-Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..17292b01fc131db86a62e45878223b5502ac70b2 --- /dev/null +++ b/storage/Damages-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ca143d7239e640f623ecab100b31588d590386efe710a6fe6fe47cb2c73d19 +size 21204 diff --git a/storage/Damages.ttf b/storage/Damages.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3eaa6e333f31dc2b9137909f85d9daa4d8580458 --- /dev/null +++ b/storage/Damages.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3437720ebea199a4082bc2c82d912fb451162b7368414b2552f8b587baa1a512 +size 27724 diff --git a/storage/Damages3D-Italic.ttf b/storage/Damages3D-Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7a0b727203c9616230bccab97507d7984cef6ce4 --- /dev/null +++ b/storage/Damages3D-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:491fc1a6e8aadaf7e43f71d2058cde393039ae7a6e4eb6390ae2e7a2dca537d9 +size 25516 diff --git a/storage/Damages3D.ttf b/storage/Damages3D.ttf new file mode 100644 index 0000000000000000000000000000000000000000..6881356a3ba0f84298af497e742ef479e6d5b84d --- /dev/null +++ b/storage/Damages3D.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85fc29fdffa03ccfec2738794d07f5c0f2c96f247a38a05dc50e45c16d12da16 +size 35588 diff --git a/storage/Damages3DFilled-Italic.ttf b/storage/Damages3DFilled-Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..736184b1e0e969ab3bc1724ef5f01c0419884b4a --- /dev/null +++ b/storage/Damages3DFilled-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:422f0acc1be040a4b27b426a7f230bb97dfae5d4016ff7e0237ec57668513352 +size 34380 diff --git a/storage/Damages3DFilled.ttf b/storage/Damages3DFilled.ttf new file mode 100644 index 0000000000000000000000000000000000000000..339e47f8e504f6e37467a379a20df76a77f76aa1 --- /dev/null +++ b/storage/Damages3DFilled.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e1fd4522f32db371a57c7ad9e44061b993ee536571738f8db679638d6eef706 +size 51572 diff --git a/storage/Damar Kurung.otf b/storage/Damar Kurung.otf new file mode 100644 index 0000000000000000000000000000000000000000..e39220d5311e7daa640f380fc758c13c028b2b59 --- /dev/null +++ b/storage/Damar Kurung.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:284928db06d0713873543da929cdc96800f3435ff47ce160723dc57fe4d03ced +size 18620 diff --git a/storage/Damar Kurung.ttf b/storage/Damar Kurung.ttf new file mode 100644 index 0000000000000000000000000000000000000000..72f2afbc82cdedb3412594a284fdfdb866aa38b1 --- /dev/null +++ b/storage/Damar Kurung.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c639bbddbd4ae1f57eb09e52b18f7684ff24029fdf7ee544beabfe179610d76a +size 18620 diff --git a/storage/Dark Ministry.ttf b/storage/Dark Ministry.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f9c72f54ec5f2a7ca95ab02fa992a07ec383b82e --- /dev/null +++ b/storage/Dark Ministry.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:129a04efb659f2f3b6244410ce024505edbcd83d7a0060c5426c9561b6f6585b +size 8100 diff --git a/storage/Dark Seed.otf b/storage/Dark Seed.otf new file mode 100644 index 0000000000000000000000000000000000000000..dbbf4fec95c94f92b810e83c2efab8210ed236c7 --- /dev/null +++ b/storage/Dark Seed.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3032cb0a21d4b946bdb1e0a1a29c4017c706043db6aff95249e893d840c6429c +size 19952 diff --git a/storage/Dark.ttf b/storage/Dark.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3bc1bddff7c96d3b8e65f25b959d5c136771bdba --- /dev/null +++ b/storage/Dark.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70a0b32ade35a2c9513fbf8c81ae02d67c4d6675023caeade9d6e2c0a1b9d717 +size 22896 diff --git a/storage/Dash-Dermo.ttf b/storage/Dash-Dermo.ttf new file mode 100644 index 0000000000000000000000000000000000000000..527e09aed6731a12a5fc2aa395b90a6713c47ccc --- /dev/null +++ b/storage/Dash-Dermo.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:037bd4e92caae57cf6454b379acbae614a99eb04d4efe048f55f4d39974263bf +size 21136 diff --git a/storage/Dead Revolution.otf b/storage/Dead Revolution.otf new file mode 100644 index 0000000000000000000000000000000000000000..f4f02318e1f2b0fb242719335994949e6bb54542 --- /dev/null +++ b/storage/Dead Revolution.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd21158f78e61e673da9bc1fd084dade1ef3de4efeaf55a0018f3024e8027d67 +size 21260 diff --git a/storage/DezertDemoDash.ttf b/storage/DezertDemoDash.ttf new file mode 100644 index 0000000000000000000000000000000000000000..baa076edf99d42d4d50b5e25c83ee149bff454ce --- /dev/null +++ b/storage/DezertDemoDash.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54fe0bf3dc8942e20d3a8562ddf03ad263d8177024384f32fca8b59cbe0eb1fa +size 8808 diff --git a/storage/DezertDemoItalic.ttf b/storage/DezertDemoItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0d0ed167f205050ee9ad2d6d338e2782c0129ebe --- /dev/null +++ b/storage/DezertDemoItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45afe04b1cbfc399fe6a054776066655cd02c76853f23067f4bb1ce3d5e31a2d +size 6740 diff --git a/storage/DezertDemoItalicDash.ttf b/storage/DezertDemoItalicDash.ttf new file mode 100644 index 0000000000000000000000000000000000000000..282d2b14207c8462075f331660331d040885fbb4 --- /dev/null +++ b/storage/DezertDemoItalicDash.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5001aac1e86d4a4e975f8f8b812afad16fb9beeca3bcb8cdea486ffac75bd13 +size 9364 diff --git a/storage/DezertDemoOutline.ttf b/storage/DezertDemoOutline.ttf new file mode 100644 index 0000000000000000000000000000000000000000..87ca689a992f9ce5f0d83f3deb772f1632bdbd15 --- /dev/null +++ b/storage/DezertDemoOutline.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c3211e4e11fb9f342917a7751eb44a6a0a1aaab4f118efa2a764437746bd31d +size 9808 diff --git a/storage/DezertDemoOutlineDash.ttf b/storage/DezertDemoOutlineDash.ttf new file mode 100644 index 0000000000000000000000000000000000000000..11379260e375c046955d34e4b7d6f8329e2fdbc4 --- /dev/null +++ b/storage/DezertDemoOutlineDash.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57490221c669fd055b3ba0a7cde2479272bff206c5a8cc695cf01edb60d1197c +size 13852 diff --git a/storage/DezertDemoRegular.ttf b/storage/DezertDemoRegular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0314933a9ea94e794334f31666614edd60ea436d --- /dev/null +++ b/storage/DezertDemoRegular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d32f2eadc78d259b32e0f0db83516e13c1fc4f3fc908968df81bb7b5d8ab6e37 +size 6312 diff --git a/storage/DisposableDroidBB_bld.ttf b/storage/DisposableDroidBB_bld.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f4249d6b47e5c4dea56e6738a865093f592215d0 --- /dev/null +++ b/storage/DisposableDroidBB_bld.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6be633b7cfde24055d1dcad7d55a539d12b6f42fb95660e607a58e0c1fb9bb0a +size 29236 diff --git a/storage/DragonForcE.ttf b/storage/DragonForcE.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8dfc545028d904e9cdf25894dc0a4aa25c9950aa --- /dev/null +++ b/storage/DragonForcE.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7013ee9141781afc55da59c518b9eb9dbab5f2953f59e384fd7a396191c0cab3 +size 17276 diff --git a/storage/Dramaga Demo.otf b/storage/Dramaga Demo.otf new file mode 100644 index 0000000000000000000000000000000000000000..22c2e53c9f2335ab968a726afc8a9e3cecdfe7fb --- /dev/null +++ b/storage/Dramaga Demo.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:678fdfe51959258e658ec028b0679fb32a26d9d56082c7c7a25aea09c7eca407 +size 11592 diff --git a/storage/Dramaga Demo.ttf b/storage/Dramaga Demo.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e89d96f49bf775a02f97db291c31007a837c4892 --- /dev/null +++ b/storage/Dramaga Demo.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05aebda0ab9f75837995de226d4353fd712af17e3e8a6144f53fab71095520a2 +size 43200 diff --git a/storage/Dreamscar.ttf b/storage/Dreamscar.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e73027866d6d892fe23b6f9b28d24459e31e7163 --- /dev/null +++ b/storage/Dreamscar.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58a92276a65f689fcf0d302b9fe776e391f76364a0178aa8fe6f2ac1caf7c0a9 +size 21244 diff --git a/storage/EVILDEAD.TTF b/storage/EVILDEAD.TTF new file mode 100644 index 0000000000000000000000000000000000000000..40cc89fb3960931c089da12b321742fc7046f1a6 --- /dev/null +++ b/storage/EVILDEAD.TTF @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f43bcb89e4fe14c599c435e1f7e67d171258edce121962944f4bd4c11611981 +size 16364 diff --git a/storage/Europhonic.otf b/storage/Europhonic.otf new file mode 100644 index 0000000000000000000000000000000000000000..8634dad7fa740799364c6875f36ae2940a58bf40 --- /dev/null +++ b/storage/Europhonic.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df37427b1a7a4b194ff51eef5a9ab6b4fb2fa1dfec3bc338286d1a2a6c70153d +size 19788 diff --git a/storage/Exorcista_-Jed_40.ttf b/storage/Exorcista_-Jed_40.ttf new file mode 100644 index 0000000000000000000000000000000000000000..81f1706b94d30ce6adcb002304e98fbbb7a98536 --- /dev/null +++ b/storage/Exorcista_-Jed_40.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5286304cbff96a126412ba8d0b719118be0e20d2cbacc3dc26ae57ba14c448df +size 17868 diff --git a/storage/Fire Flight FREE.otf b/storage/Fire Flight FREE.otf new file mode 100644 index 0000000000000000000000000000000000000000..32480c9d4159816b0e824cc3edb1b1747b0cc37c --- /dev/null +++ b/storage/Fire Flight FREE.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5abd9f08445b554b15c7cc10372157860e81ce12e995ec1632ebdcc1cd6f50e +size 21508 diff --git a/storage/Fire Flight FREE.ttf b/storage/Fire Flight FREE.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4aef36b659e0119de33e91645bb2e1a2d0c492a4 --- /dev/null +++ b/storage/Fire Flight FREE.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d43e88991f47f65ca422829c4cb520d80e0fd8ab597b2e4deb2ac9ca9fb0bb96 +size 51652 diff --git a/storage/FontRemix.ttf b/storage/FontRemix.ttf new file mode 100644 index 0000000000000000000000000000000000000000..351de7b5a976f3080edeae2d032165abbf647414 --- /dev/null +++ b/storage/FontRemix.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afbd30c1ad67286eff72df63b5d563a6d3827c01bca881013ae87982930ac369 +size 56364 diff --git a/storage/FontRemix2.ttf b/storage/FontRemix2.ttf new file mode 100644 index 0000000000000000000000000000000000000000..def5db2437da3a8342445b4603ac323390e45ba7 --- /dev/null +++ b/storage/FontRemix2.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f95c7f62a6f11a6d7662b1a0a00cdd731434eb66e9a802f14bd0fa4007410825 +size 34956 diff --git a/storage/Friend Head.otf b/storage/Friend Head.otf new file mode 100644 index 0000000000000000000000000000000000000000..ccfac2c762bd869a6d36334901eda5257b20a4cc --- /dev/null +++ b/storage/Friend Head.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2be2cdf8ab161d4693738248ae88297dadeff43807dec383841ea21dcde2263 +size 23912 diff --git a/storage/Frostbite Boss Fight.otf b/storage/Frostbite Boss Fight.otf new file mode 100644 index 0000000000000000000000000000000000000000..ff2fc25d720d8daadbd9f6dbb784b9331c63ecba --- /dev/null +++ b/storage/Frostbite Boss Fight.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dd0201d3d183e4f11a0f8c687841cddfd8d3ece7c18c7b6bbe1a1909bc9fa99 +size 25192 diff --git a/storage/Fucking Hostile.ttf b/storage/Fucking Hostile.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3d60672bc1147428e08e737a89d71372563a449a --- /dev/null +++ b/storage/Fucking Hostile.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff634ab7dd40bfaa427d9babcd1606a2bec6843ec4026b77b8538e12ecfe8eb5 +size 311856 diff --git a/storage/GRAMES.ttf b/storage/GRAMES.ttf new file mode 100644 index 0000000000000000000000000000000000000000..ff636799e50aa094231e5b706ca8b477094da1c4 --- /dev/null +++ b/storage/GRAMES.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbee498be7b1b58085a17aab47e86d6dd0ea981b16fbfd44aec39832b6d5b32c +size 36276 diff --git a/storage/Gang Wolfik.ttf b/storage/Gang Wolfik.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd9b0c8cb24c7b58cd6465cd624804c743847409 --- /dev/null +++ b/storage/Gang Wolfik.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8272ccd83f97be3e0f3d05b5ce68dfe8647da38859360292d21d53afcb79161d +size 28988 diff --git a/storage/Garda.ttf b/storage/Garda.ttf new file mode 100644 index 0000000000000000000000000000000000000000..29f073150a6e5a67d195454976a2b0fcfd4c1b83 --- /dev/null +++ b/storage/Garda.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:159056d769a73c3a4f951143aead48fd775a0cb19b2e69b23565d6725bcc61b0 +size 5048 diff --git a/storage/Garreng-Personal-Use.otf b/storage/Garreng-Personal-Use.otf new file mode 100644 index 0000000000000000000000000000000000000000..4a0ad65ab2fba00de6009150a4f928a576b7d020 --- /dev/null +++ b/storage/Garreng-Personal-Use.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e617a60c869cc2e5c1ef3567020d361cccdf9050494b4dc7a81022240a03d293 +size 80276 diff --git a/storage/Geizer.otf b/storage/Geizer.otf new file mode 100644 index 0000000000000000000000000000000000000000..81f4f85d21a93bce39d8f700f5dab394b3f899c2 --- /dev/null +++ b/storage/Geizer.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:188b15b1f3b42c164bbb075026f7f37ae8240d7b8d3ae4e2922698ce602d1e90 +size 33072 diff --git a/storage/Georgent.otf b/storage/Georgent.otf new file mode 100644 index 0000000000000000000000000000000000000000..777d09bf6fb5475c8a21ebbdb9b39faf8ffc43e0 --- /dev/null +++ b/storage/Georgent.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e6c2ab6d696359515f582c8ead7a089774d671fbfab558de9786b9f65462d70 +size 43940 diff --git a/storage/Georgent.ttf b/storage/Georgent.ttf new file mode 100644 index 0000000000000000000000000000000000000000..572f866d2d6e2cdc9580f8cad96b45394804c39f --- /dev/null +++ b/storage/Georgent.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f55512b4e2ea387b1c115010ec5ec16c981e06fc5dd28157ef0104934d64620 +size 12232 diff --git a/storage/Hallowed Grad.otf b/storage/Hallowed Grad.otf new file mode 100644 index 0000000000000000000000000000000000000000..fb2bbbc2827ffed8878214752f6b6b93cd211c9b --- /dev/null +++ b/storage/Hallowed Grad.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3448e14d67b4147396442b84e87e0d2362fe9f86401c24cab621db7096b0847a +size 15428 diff --git a/storage/Harker Bold Italic.otf b/storage/Harker Bold Italic.otf new file mode 100644 index 0000000000000000000000000000000000000000..a3759e87f79550f9c1b6c711b5f8c20cfd0f3685 --- /dev/null +++ b/storage/Harker Bold Italic.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6e6fc02c4179508505d82266445ad8f078d64e5d73ffd1175a7d6644373db63 +size 30456 diff --git a/storage/Harker Italic.otf b/storage/Harker Italic.otf new file mode 100644 index 0000000000000000000000000000000000000000..8058902936283f4bfc060dd7ff4bc6ad57207250 --- /dev/null +++ b/storage/Harker Italic.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5cc97017e0eebdfefe3e2b7261eba759a6011b958de0d90b06b64a1c62ac07d +size 30456 diff --git a/storage/Maghrib.ttf b/storage/Maghrib.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0056cbcbd902b280c8ffcbafb1c6885bd50fc41c --- /dev/null +++ b/storage/Maghrib.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b1914953c7bdb2bf68c68fca275ef63c4aede5ec084c9788dc1f1a020d34c51 +size 81788 diff --git a/storage/ObelixProB-cyr Alfi Stefa.ttf b/storage/ObelixProB-cyr Alfi Stefa.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9eff21ab4948c4b2d330acd5274a3e6c18b92551 --- /dev/null +++ b/storage/ObelixProB-cyr Alfi Stefa.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40ba364fcb2f93178cb9431e2d4ea82e607408873dcf0767248fb217dedc6095 +size 22236 diff --git a/storage/RealFast Alfi Stefa.ttf b/storage/RealFast Alfi Stefa.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e19f6613646add3a63955ac177376445f6468e7a --- /dev/null +++ b/storage/RealFast Alfi Stefa.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c836de18a3b67fa81487a5ca9a61eeb8bd64ebd88002f29d531bfde69c9e3baf +size 272532 diff --git a/storage/Roboto-Black.ttf b/storage/Roboto-Black.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1fecc35f489d510b0f5f16db867dc0a8d175590e --- /dev/null +++ b/storage/Roboto-Black.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c78ce438e9d91ea8c16341aaf2c6cf07f9c347eb1130bd922796ad4fb78fe885 +size 164936 diff --git a/storage/Roboto-BlackItalic.ttf b/storage/Roboto-BlackItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9894f60c3e54041c8d4eb873deeb4f8e0008c0e3 --- /dev/null +++ b/storage/Roboto-BlackItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e7928c14bbddea37ec9ba2453f00bd8f4d73c42c20528e42abc5b89d2732db1 +size 166320 diff --git a/storage/Roboto-Bold.ttf b/storage/Roboto-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..38df8b52f672921ccad88548517ad2ca6e55f9d4 --- /dev/null +++ b/storage/Roboto-Bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24571503140760240924dcd1238f77e7cd0454c0d8b0793990cefa2fad71471f +size 163448 diff --git a/storage/Roboto-BoldCondensed.ttf b/storage/Roboto-BoldCondensed.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9d00a79bb1ddabcf8dc29bddafebe6fb75023714 --- /dev/null +++ b/storage/Roboto-BoldCondensed.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c9245c0246a9c745793c7eaa9cc1fc964a12570009031ea0223115bec6e9426 +size 161308 diff --git a/storage/Roboto-BoldCondensedItalic.ttf b/storage/Roboto-BoldCondensedItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..025878468ce2ff818dd41376a5ad449c7c9c1cfc --- /dev/null +++ b/storage/Roboto-BoldCondensedItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1117eab9f490123cf8a656fa936a4c9a7e4918b88ae576d64d3d79507096f7b9 +size 163584 diff --git a/storage/Roboto-BoldItalic.ttf b/storage/Roboto-BoldItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f06044265e83be6f4205bf2484783ccb62997154 --- /dev/null +++ b/storage/Roboto-BoldItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:165a6d02fd8973703787feeef5319b7fd8cb3f665a3c1e702ef0ca49701547c9 +size 165864 diff --git a/storage/Roboto-Condensed.ttf b/storage/Roboto-Condensed.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2b4631aab5ca25b800e94710829094359e4ae144 --- /dev/null +++ b/storage/Roboto-Condensed.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2efe5301b93d1e4aa90fed89f766a88be1b80be64873f853c1b6e089cab19fea +size 158284 diff --git a/storage/Roboto-CondensedItalic.ttf b/storage/Roboto-CondensedItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..34ead880baded5edbc5f9d8293b28e1828b387e4 --- /dev/null +++ b/storage/Roboto-CondensedItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2d5ec131c1a767138d09f77383b4bf68051c02164dd83e4b6c58feb25c473ed +size 161792 diff --git a/storage/Roboto-Italic.ttf b/storage/Roboto-Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1cd51b2c5ae5b6017aa1cf6300b2fc80ad91a22c --- /dev/null +++ b/storage/Roboto-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cd9337020d0b1593bae42dcca5cfc0fb86f5806ef469d66d09eae1e56ce346b +size 328640 diff --git a/storage/Roboto-Medium.ttf b/storage/Roboto-Medium.ttf new file mode 100644 index 0000000000000000000000000000000000000000..38245334ef1ffae8853c94b3e559504a8e0c887b --- /dev/null +++ b/storage/Roboto-Medium.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02868d6a7e80d4e7836b6263dd50d26a63e923a1223c9e027aad6dc2501c27cc +size 160696 diff --git a/storage/Roboto-MediumItalic.ttf b/storage/Roboto-MediumItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d7335282bb3ee401291d5d6391162a4bef9b42b6 --- /dev/null +++ b/storage/Roboto-MediumItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27f4345bc02f3cdec1522bfeae70aced6bdf217d40878108cfe2baa535d04fa4 +size 163940 diff --git a/storage/Roboto-Regular.ttf b/storage/Roboto-Regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0e3da8ef61a8ab91cd02a6c82418e9060ed20e47 --- /dev/null +++ b/storage/Roboto-Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16466ef65064e6f3885a6d2806b8949ac1ac38b524dd0cf8fc96565eb4cc28e8 +size 158604 diff --git a/storage/Roboto-Thin.ttf b/storage/Roboto-Thin.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a27e4516ed8b94dca3a277a35304a704a5d13eb3 --- /dev/null +++ b/storage/Roboto-Thin.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2843669daf030733f6b7c541a98ebbff5ce5c2d8cbae423bd8d278a36e169399 +size 122512 diff --git a/storage/Roboto-ThinItalic.ttf b/storage/Roboto-ThinItalic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fe3cfa365a00403c03bd776db1afae47139c2974 --- /dev/null +++ b/storage/Roboto-ThinItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55031ef14f6c49947255ab6e0ef7112938cb1ecb903f85553ddc7842422a5841 +size 125884 diff --git a/storage/TM_BLACK.png b/storage/TM_BLACK.png new file mode 100644 index 0000000000000000000000000000000000000000..5972e18ec8004ce0dad6ac3ac33c894d79cb9570 Binary files /dev/null and b/storage/TM_BLACK.png differ diff --git a/storage/TruenoBlkOl.otf b/storage/TruenoBlkOl.otf new file mode 100644 index 0000000000000000000000000000000000000000..6578c0b018270e02302e969a8eaad78064da2769 --- /dev/null +++ b/storage/TruenoBlkOl.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:847c1422270a4e0cafcf24a3b4dccb7f823c117fd0646c6ef8196d12cdeeb144 +size 159536 diff --git a/storage/TruenoRg.otf b/storage/TruenoRg.otf new file mode 100644 index 0000000000000000000000000000000000000000..54e7fabdf8aa596c93f9b8f85607cfd2b878fe14 --- /dev/null +++ b/storage/TruenoRg.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03b9e3215ebb9a0a6aed1df732549b67f15c5fecc5fd8d8aac31a3f302cbf87f +size 37948 diff --git a/storage/TruenoRgIt.otf b/storage/TruenoRgIt.otf new file mode 100644 index 0000000000000000000000000000000000000000..acd242f0b52275ef8fb7dca4ee861d1f34e1b9c7 --- /dev/null +++ b/storage/TruenoRgIt.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5267d1e70b3a26994a443d887d9ce2799f16618255220eb874ed5fb50773955 +size 54244 diff --git a/storage/TruenoSBdIt.otf b/storage/TruenoSBdIt.otf new file mode 100644 index 0000000000000000000000000000000000000000..151bd49fb62a6b7afdf263a9199b6f5e5312b9da --- /dev/null +++ b/storage/TruenoSBdIt.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b33b2226ae54cd7505a39953c24aa5b6ee18bfdbd434862a6e1d8007e4812ff1 +size 75556 diff --git a/storage/Vendetta.otf b/storage/Vendetta.otf new file mode 100644 index 0000000000000000000000000000000000000000..782c328c1319d7ba9e7137f4d8a3b96420efdef6 --- /dev/null +++ b/storage/Vendetta.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e1cd3977b7463e3cb4724b3f4903f2ea87b0e2d8bc689eac1e4f0c1a49254cc +size 110372 diff --git a/storage/assfont.ttf b/storage/assfont.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c9bc3e58a855740804ad1312ba8302933767b153 --- /dev/null +++ b/storage/assfont.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e92aceba3c95fabe12edf01ae248f613f6d97eef3bdb7009200cb3fae53df609 +size 55300 diff --git a/storage/default.ttf b/storage/default.ttf new file mode 100644 index 0000000000000000000000000000000000000000..edc3dbeebeb35c67ce7de21ff400c97eda884b6b --- /dev/null +++ b/storage/default.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00f1fc230ac99f9b97ba1a7c214eb5b909a78660cb3826fca7d64c3af5a14848 +size 136076 diff --git a/storage/digital.ttf b/storage/digital.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c89de39dad1c2fd9cb81a5928f627498bc1a003c --- /dev/null +++ b/storage/digital.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36a2aefc772bf9df3157008579d37bde8b52921985c9894231ba1576580d2002 +size 23344 diff --git a/storage/elric.TTF b/storage/elric.TTF new file mode 100644 index 0000000000000000000000000000000000000000..d79568fc048c6acaa232c8b8841fe25cf6ceb19d --- /dev/null +++ b/storage/elric.TTF @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94278497fef52147ce168334a6c8a4b10acb515d5c9d072c834da36bcf1bf5a8 +size 51276 diff --git a/storage/font.otf b/storage/font.otf new file mode 100644 index 0000000000000000000000000000000000000000..19f1a356b3686ad91ec3e0bf0e0991e3f436e343 --- /dev/null +++ b/storage/font.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce85c044fc8227164e8f3461d3257a32c25f48000ca55c4e73b4397f70148d32 +size 125304 diff --git a/storage/fontx.ttf b/storage/fontx.ttf new file mode 100644 index 0000000000000000000000000000000000000000..67b0e194272790e74283fb42f186641f5c571bcb --- /dev/null +++ b/storage/fontx.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f53a60b095bfcbb7cadcc55955980eeb46b977770ac552b34185f4538af6775 +size 30980 diff --git a/storage/hawkmoon.ttf b/storage/hawkmoon.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e95c6fe021c3705fe6cdfa273fb4f4a662af0bc6 --- /dev/null +++ b/storage/hawkmoon.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c8b61e93a383230071afd2eb885e48d7c433d1f21bae684ebb00bd5f8c59a04 +size 59056 diff --git a/storage/monumentextended-regular.otf b/storage/monumentextended-regular.otf new file mode 100644 index 0000000000000000000000000000000000000000..99b838a01ffeade2645ed59e6fbd9ab3ffc09010 --- /dev/null +++ b/storage/monumentextended-regular.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62b958648c1a7f8e984788b7f02902d11531f76e481ce0b9043ad53840a72d09 +size 34380 diff --git a/storage/template.jpg b/storage/template.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b884031dc1fa2292b0064369c248ac4da32d13f Binary files /dev/null and b/storage/template.jpg differ diff --git a/storage/vc.mp3 b/storage/vc.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..236861e8c98d186ddcf8e6f6b632f95250a33883 Binary files /dev/null and b/storage/vc.mp3 differ diff --git a/ubot/__init__.py b/ubot/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f578c9a38831db38681bcba17186173113084b0 --- /dev/null +++ b/ubot/__init__.py @@ -0,0 +1,184 @@ +import asyncio +import logging +import os +import re +from os import execvp +from sys import executable + +from aiohttp import ClientSession +from pyrogram import * +from pyrogram.enums import * +from pyrogram.handlers import * +from pyrogram.types import * +from pyromod import listen +from pytgcalls import PyTgCalls + +from ubot.config import * +from aiohttp import ClientSession + +async def create_session(): + return ClientSession() + +loop = asyncio.get_event_loop() +aiosession = loop.run_until_complete(create_session()) + + + +def gas(): + execvp(executable, [executable, "-m", "ubot"]) + + +class ConnectionHandler(logging.Handler): + def emit(self, record): + for X in ["OSError"]: + if X in record.getMessage(): + gas() + + +logger = logging.getLogger() +logger.setLevel(logging.ERROR) + +formatter = logging.Formatter("[%(levelname)s] - %(name)s - %(message)s", "%d-%b %H:%M") +stream_handler = logging.StreamHandler() + +stream_handler.setFormatter(formatter) +connection_handler = ConnectionHandler() + +logger.addHandler(stream_handler) +logger.addHandler(connection_handler) + +LOGS = logging.getLogger(__name__) + + +def LOGGER(name: str) -> logging.Logger: + return logging.getLogger(name) + + +class Ubot(Client): + __module__ = "pyrogram.client" + _ubot = [] + _prefix = {} + _get_my_id = [] + _translate = {} + _get_my_peer = {} + + def __init__(self, api_id, api_hash, device_model="Ichigo-Userbot", **kwargs): + super().__init__(**kwargs) + self.api_id = api_id + self.api_hash = api_hash + self.device_model = device_model + self.call_py = PyTgCalls(self) + + def on_message(self, filters=None, group=0): + def decorator(func): + for ub in self._ubot: + ub.add_handler(MessageHandler(func, filters)) + return func + + return decorator + + def set_prefix(self, user_id, prefix): + self._prefix[self.me.id] = prefix + + async def start(self): + await super().start() + await self.call_py.start() + handler = await get_pref(self.me.id) + if handler: + self._prefix[self.me.id] = handler + else: + self._prefix[self.me.id] = ["."] + self._ubot.append(self) + self._get_my_id.append(self.me.id) + self._translate[self.me.id] = {"negara": "id"} + print( + f"Starting Userbot ({self.me.id}|{self.me.first_name}{self.me.last_name})" + ) + + +async def get_prefix(user_id): + return ubot._prefix.get(user_id, ".") + + +def anjay(cmd): + command_re = re.compile(r"([\"'])(.*?)(? bool: + user = await bacotdb.find_one({"user_id": user_id}) + if not user: + return False + return True + + +async def get_served_users() -> list: + users_list = [] + async for user in bacotdb.find({"user_id": {"$gt": 0}}): + users_list.append(user) + return users_list + + +async def add_served_user(user_id: int): + is_served = await is_served_user(user_id) + if is_served: + return + return await bacotdb.insert_one({"user_id": user_id}) diff --git a/ubot/core/database/expired.py b/ubot/core/database/expired.py new file mode 100644 index 0000000000000000000000000000000000000000..1cbc26b7d01d7e384929decfa158cf613cfa7e09 --- /dev/null +++ b/ubot/core/database/expired.py @@ -0,0 +1,23 @@ +from ubot.core.database import db + +userEXP = db.expired + + +async def get_expired_date(user_id): + user = await userEXP.users.find_one({"_id": user_id}) + if user: + return user.get("expire_date") + else: + return None + + +async def set_expired_date(user_id, expire_date): + await userEXP.users.update_one( + {"_id": user_id}, {"$set": {"expire_date": expire_date}}, upsert=True + ) + + +async def rem_expired_date(user_id): + await userEXP.users.update_one( + {"_id": user_id}, {"$unset": {"expire_date": ""}}, upsert=True + ) diff --git a/ubot/core/database/gbans.py b/ubot/core/database/gbans.py new file mode 100644 index 0000000000000000000000000000000000000000..6f127e4f26714a88dbd907a477635c51f7683d1a --- /dev/null +++ b/ubot/core/database/gbans.py @@ -0,0 +1,35 @@ +from ubot.core.database import db + +blockeddb = db["skyubot"]["gbans"] + + +async def get_banned_users(gua: int) -> list: + results = [] + async for user in blockeddb.find({"gua": gua, "user_id": {"$gt": 0}}): + results.append(user["user_id"]) + return results + + +async def get_banned_count(gua: int) -> int: + users = blockeddb.find({"gua": gua, "user_id": {"$gt": 0}}) + users = await users.to_list(length=100000) + return len(users) + + +async def is_banned_user(gua: int, user_id: int) -> bool: + user = await blockeddb.find_one({"gua": gua, "user_id": user_id}) + return bool(user) + + +async def add_banned_user(gua: int, user_id: int): + is_gbanned = await is_banned_user(gua, user_id) + if is_gbanned: + return + return await blockeddb.insert_one({"gua": gua, "user_id": user_id}) + + +async def remove_banned_user(gua: int, user_id: int): + is_gbanned = await is_banned_user(gua, user_id) + if not is_gbanned: + return + return await blockeddb.delete_one({"gua": gua, "user_id": user_id}) diff --git a/ubot/core/database/logdb.py b/ubot/core/database/logdb.py new file mode 100644 index 0000000000000000000000000000000000000000..30a35b6411528784b141bb4a4d38ff7d2054da60 --- /dev/null +++ b/ubot/core/database/logdb.py @@ -0,0 +1,22 @@ +from ubot.core.database import db + +logrupdb = db.logger + + +async def get_log_group(user_id: int) -> bool: + cek = await logrupdb.find_one({"user_id": user_id}) + if not cek: + return None + return cek["logger"] + + +async def set_log_group(user_id: int, logger): + cek = await get_log_group(user_id) + if cek: + await logrupdb.update_one({"user_id": user_id}, {"$set": {"logger": logger}}) + else: + await logrupdb.insert_one({"user_id": user_id, "logger": logger}) + + +async def del_log_group(user_id: int): + await logrupdb.delete_one({"user_id": user_id}) diff --git a/ubot/core/database/notes.py b/ubot/core/database/notes.py new file mode 100644 index 0000000000000000000000000000000000000000..d29f9715fc524780d186838abd389f653b26a607 --- /dev/null +++ b/ubot/core/database/notes.py @@ -0,0 +1,56 @@ +from ubot.core.database import db + +notesdb = db.notes + + +async def save_note(user_id, note_name, message): + doc = {"_id": user_id, "notes": {note_name: message}} + result = await notesdb.find_one({"_id": user_id}) + if result: + await notesdb.update_one( + {"_id": user_id}, {"$set": {f"notes.{note_name}": message}} + ) + else: + await notesdb.insert_one(doc) + + +async def get_note(user_id, note_name): + result = await notesdb.find_one({"_id": user_id}) + if result is not None: + try: + note_id = result["notes"][note_name] + return note_id + except KeyError: + return None + else: + return None + + +async def rm_note(user_id, note_name): + await notesdb.update_one({"_id": user_id}, {"$unset": {f"notes.{note_name}": ""}}) + + +async def all_notes(user_id): + results = await notesdb.find_one({"_id": user_id}) + try: + notes_dic = results["notes"] + key_list = notes_dic.keys() + return key_list + except: + return None + + +async def rm_all(user_id): + await notesdb.update_one({"_id": user_id}, {"$unset": {"notes": ""}}) + + +async def save_selfnote(user_id, note_name, text, data_type, content): + doc = {"_id": user_id, "notes": {note_name: {data_type: content}}} + result = await notesdb.find_one({"_id": user_id}) + + if result: + await notesdb.update_one( + {"_id": user_id}, {"$set": {f"notes.{note_name}.{data_type}": content}} + ) + else: + await notesdb.insert_one(doc) diff --git a/ubot/core/database/otp.py b/ubot/core/database/otp.py new file mode 100644 index 0000000000000000000000000000000000000000..0af39a6ea243948bac73c8c71b31d2beee60651f --- /dev/null +++ b/ubot/core/database/otp.py @@ -0,0 +1,23 @@ +from ubot.core.database import db + +getopt = db.twofactor + + +async def get_two_factor(user_id): + user = await getopt.users.find_one({"_id": user_id}) + if user: + return user.get("twofactor") + else: + return None + + +async def set_two_factor(user_id, twofactor): + await getopt.users.update_one( + {"_id": user_id}, {"$set": {"twofactor": twofactor}}, upsert=True + ) + + +async def rem_two_factor(user_id): + await getopt.users.update_one( + {"_id": user_id}, {"$unset": {"twofactor": ""}}, upsert=True + ) diff --git a/ubot/core/database/permit.py b/ubot/core/database/permit.py new file mode 100644 index 0000000000000000000000000000000000000000..e525683de3b2320faa1d74133c350800cfa5d0a4 --- /dev/null +++ b/ubot/core/database/permit.py @@ -0,0 +1,40 @@ +from ubot.core.database import db + +permitdb = db.permitdb + + +async def add_approved_user(user_id): + good_usr = int(user_id) + does_they_exists = await permitdb.users.find_one({"user_id": "setujui"}) + if does_they_exists: + await permitdb.users.update_one( + {"user_id": "setujui"}, {"$push": {"good_id": good_usr}} + ) + else: + await permitdb.users.insert_one({"user_id": "setujui", "good_id": [good_usr]}) + + +async def rm_approved_user(user_id): + bad_usr = int(user_id) + does_good_ones_exists = await permitdb.users.find_one({"user_id": "setujui"}) + if does_good_ones_exists: + await permitdb.users.update_one( + {"user_id": "setujui"}, {"$pull": {"good_id": bad_usr}} + ) + else: + return None + + +async def check_user_approved(user_id): + random_usr = int(user_id) + does_good_users_exists = await permitdb.users.find_one({"user_id": "setujui"}) + if does_good_users_exists: + good_users_list = [ + cool_user for cool_user in does_good_users_exists.get("good_id") + ] + if random_usr in good_users_list: + return True + else: + return False + else: + return False diff --git a/ubot/core/database/pref.py b/ubot/core/database/pref.py new file mode 100644 index 0000000000000000000000000000000000000000..31783f4a1ca5f90554c43a38cb104b2aeb4eb59f --- /dev/null +++ b/ubot/core/database/pref.py @@ -0,0 +1,23 @@ +from ubot.core.database import db + +prefixes = db.prefixesi + + +async def get_pref(user_id): + user = await prefixes.users.find_one({"_id": user_id}) + if user: + return user.get("prefixesi") + else: + return "." + + +async def set_pref(user_id, prefix): + await prefixes.users.update_one( + {"_id": user_id}, {"$set": {"prefixesi": prefix}}, upsert=True + ) + + +async def rem_pref(user_id): + await prefixes.users.update_one( + {"_id": user_id}, {"$unset": {"prefixesi": ""}}, upsert=True + ) diff --git a/ubot/core/database/premium.py b/ubot/core/database/premium.py new file mode 100644 index 0000000000000000000000000000000000000000..0caa53462827c0ac8bf35619194cd6489f233c7f --- /dev/null +++ b/ubot/core/database/premium.py @@ -0,0 +1,24 @@ +from ubot.core.database import db + +user = db.sudoers + + +async def get_prem(): + prem = await user.find_one({"prem": "prem"}) + if not prem: + return [] + return prem["list"] + + +async def add_prem(user_id): + list = await get_prem() + list.append(user_id) + await user.update_one({"prem": "prem"}, {"$set": {"list": list}}, upsert=True) + return True + + +async def remove_prem(user_id): + list = await get_prem() + list.remove(user_id) + await user.update_one({"prem": "prem"}, {"$set": {"list": list}}, upsert=True) + return True diff --git a/ubot/core/database/reseller.py b/ubot/core/database/reseller.py new file mode 100644 index 0000000000000000000000000000000000000000..a546e661d084c009ac049adcd1e7c77a67e7a951 --- /dev/null +++ b/ubot/core/database/reseller.py @@ -0,0 +1,28 @@ +from ubot.core.database import db + +resell = db.babu + + +async def get_seles(): + seles = await resell.find_one({"babu": "babu"}) + if not seles: + return [] + return seles["reseller"] + + +async def add_seles(user_id): + reseller = await get_seles() + reseller.append(user_id) + await resell.update_one( + {"babu": "babu"}, {"$set": {"reseller": reseller}}, upsert=True + ) + return True + + +async def remove_seles(user_id): + reseller = await get_seles() + reseller.remove(user_id) + await resell.update_one( + {"babu": "babu"}, {"$set": {"reseller": reseller}}, upsert=True + ) + return True diff --git a/ubot/core/database/saved.py b/ubot/core/database/saved.py new file mode 100644 index 0000000000000000000000000000000000000000..7e3fa83913edf1560806d83441b5b50615fc514e --- /dev/null +++ b/ubot/core/database/saved.py @@ -0,0 +1,45 @@ +from ubot.core.database import db + +blchatdb = db.blchat + + +async def get_chat(user_id): + chat = await blchatdb.find_one({"chat": user_id}) + if not chat: + return [] + return chat["list"] + + +async def add_chat(user_id, chat_id): + list = await get_chat(user_id) + list.append(chat_id) + await blchatdb.update_one({"chat": user_id}, {"$set": {"list": list}}, upsert=True) + return True + + +async def remove_chat(user_id, chat_id): + list = await get_chat(user_id) + list.remove(chat_id) + await blchatdb.update_one({"chat": user_id}, {"$set": {"list": list}}, upsert=True) + return True + + +async def blacklisted_chats(user_id: int) -> list: + chats_list = [] + async for chat in blchatdb.users.find({"user_id": user_id, "chat_id": {"$lt": 0}}): + chats_list.append(chat["chat_id"]) + return chats_list + + +async def blacklist_chat(user_id: int, chat_id: int) -> bool: + if not await blchatdb.users.find_one({"user_id": user_id, "chat_id": chat_id}): + await blchatdb.users.insert_one({"user_id": user_id, "chat_id": chat_id}) + return True + return False + + +async def whitelist_chat(user_id: int, chat_id: int) -> bool: + if await blchatdb.users.find_one({"user_id": user_id, "chat_id": chat_id}): + await blchatdb.users.delete_one({"user_id": user_id, "chat_id": chat_id}) + return True + return False diff --git a/ubot/core/database/spamdb.py b/ubot/core/database/spamdb.py new file mode 100644 index 0000000000000000000000000000000000000000..d8fd59670577b1d0cf63892eaba93bcb494e70e7 --- /dev/null +++ b/ubot/core/database/spamdb.py @@ -0,0 +1,140 @@ +from ubot.core.database import db + +from typing import List + +spamgc = db.spamgcdb +gcastdb = db.gcastandb +katagikesdb = db.katagikes +rndmgikesdb = db.rndmteks + + +async def ambil_jumlah_rndm() -> dict: + orang_nya = 0 + rndm_nya = 0 + async for org in rndmgikesdb.find({"orang": {"$lt": 0}}): + rndmm = await daftar_rndm(org["orang"]) + rndm_nya += len(rndmm) + orang_nya += 1 + return { + "orang_nya": orang_nya, + "rndm_nya": rndm_nya, + } + + +async def daftar_rndm(orang: int) -> List[str]: + _rndmm = await rndmgikesdb.find_one({"orang": orang}) + return [] if not _rndmm else _rndmm["rndmm"] + + +async def tambah_rndm(orang: int, rndm: str): + rndm = rndm.lower().strip() + _rndmm = await daftar_rndm(orang) + _rndmm.append(rndm) + await rndmgikesdb.update_one( + {"orang": orang}, + {"$set": {"rndmm": _rndmm}}, + upsert=True, + ) + + +async def kureng_rndm(orang: int, rndm: str) -> bool: + rndmmd = await daftar_rndm(orang) + rndm = rndm.lower().strip() + if rndm in rndmmd: + rndmmd.remove(rndm) + await rndmgikesdb.update_one( + {"orang": orang}, + {"$set": {"rndmm": rndmmd}}, + upsert=True, + ) + return True + return False + + +async def ambil_jumlah_kata() -> dict: + orang_nya = 0 + kata_nya = 0 + async for org in katagikesdb.find({"orang": {"$lt": 0}}): + katax = await ambil_daftar(org["orang"]) + kata_nya += len(katax) + orang_nya += 1 + return { + "orang_nya": orang_nya, + "kata_nya": kata_nya, + } + + +async def ambil_daftar(orang: int) -> List[str]: + _katax = await katagikesdb.find_one({"orang": orang}) + return [] if not _katax else _katax["katax"] + + +async def tambah_kata(orang: int, kata: str): + kata = kata.lower().strip() + _katax = await ambil_daftar(orang) + _katax.append(kata) + await katagikesdb.update_one( + {"orang": orang}, + {"$set": {"katax": _katax}}, + upsert=True, + ) + + +async def kureng_kata(orang: int, kata: str) -> bool: + kataxd = await ambil_daftar(orang) + kata = kata.lower().strip() + if kata in kataxd: + kataxd.remove(kata) + await katagikesdb.update_one( + {"orang": orang}, + {"$set": {"katax": kataxd}}, + upsert=True, + ) + return True + return False + + +async def ambil_gcs(user_id): + sch = await gcastdb.find_one({"chat_id": user_id}) + if not sch: + return [] + return sch["list"] + + +async def tambah_gcs(user_id, chat_id): + list = await ambil_gcs(user_id) + list.append(chat_id) + await gcastdb.update_one( + {"chat_id": user_id}, {"$set": {"list": list}}, upsert=True + ) + return True + + +async def kureng_gcs(user_id, chat_id): + list = await ambil_gcs(user_id) + list.remove(chat_id) + await gcastdb.update_one( + {"chat_id": user_id}, {"$set": {"list": list}}, upsert=True + ) + return True + + +async def ambil_spgc(user_id): + sch = await spamgc.find_one({"chat_id": user_id}) + if not sch: + return [] + return sch["list"] + + +async def tambah_spgc(user_id, chat_id): + list = await ambil_spgc(user_id) + list.append(chat_id) + await spamgc.update_one({"chat_id": user_id}, {"$set": {"list": list}}, upsert=True) + return True + + +async def kureng_spgc(user_id, chat_id): + list = await ambil_spgc(user_id) + list.remove(chat_id) + await spamgc.update_one({"chat_id": user_id}, {"$set": {"list": list}}, upsert=True) + return True \ No newline at end of file diff --git a/ubot/core/database/userbot.py b/ubot/core/database/userbot.py new file mode 100644 index 0000000000000000000000000000000000000000..ca9517e9b836958266df1af3f0bf66e59ae55406 --- /dev/null +++ b/ubot/core/database/userbot.py @@ -0,0 +1,35 @@ +from ubot.core.database import db + +ubotdb = db.ubot + + +async def add_ubot(user_id, api_id, api_hash, session_string): + return await ubotdb.update_one( + {"user_id": user_id}, + { + "$set": { + "api_id": api_id, + "api_hash": api_hash, + "session_string": session_string, + } + }, + upsert=True, + ) + + +async def remove_ubot(user_id): + return await ubotdb.delete_one({"user_id": user_id}) + + +async def get_userbots(): + data = [] + async for ubot in ubotdb.find({"user_id": {"$exists": 1}}): + data.append( + dict( + name=str(ubot["user_id"]), + api_id=ubot["api_id"], + api_hash=ubot["api_hash"], + session_string=ubot["session_string"], + ) + ) + return data diff --git a/ubot/core/database/variabel.py b/ubot/core/database/variabel.py new file mode 100644 index 0000000000000000000000000000000000000000..e1ebd71fe838782cdb7800d5ac8186e6cd39ba7e --- /dev/null +++ b/ubot/core/database/variabel.py @@ -0,0 +1,45 @@ +from ubot.core.database import db + +vardb = db.variable + + +async def set_var(orang, nama_var, value, query="datanya"): + update_data = {"$set": {f"{query}.{nama_var}": value}} + await vardb.update_one({"_id": orang}, update_data, upsert=True) + + +async def get_var(orang, nama_var, query="datanya"): + result = await vardb.find_one({"_id": orang}) + return result.get(query, {}).get(nama_var, None) if result else None + + +async def remove_var(orang, nama_var, query="datanya"): + hapus_data = {"$unset": {f"{query}.{nama_var}": ""}} + await vardb.update_one({"_id": orang}, hapus_data) + + +async def all_var(user_id, query="datanya"): + result = await vardb.find_one({"_id": user_id}) + return result.get(query) if result else None + + +async def rmall_var(orang): + await vardb.delete_one({"_id": orang}) + + +async def ambil_list_var(user_id, nama_var, query="datanya"): + data_ = await get_var(user_id, nama_var, query) + return [int(x) for x in str(data_).split()] if data_ else [] + + +async def add_var(user_id, nama_var, value, query="datanya"): + list_data = await ambil_list_var(user_id, nama_var, query) + list_data.append(value) + await set_var(user_id, nama_var, " ".join(map(str, list_data)), query) + + +async def rem_var(user_id, nama_var, value, query="datanya"): + list_data = await ambil_list_var(user_id, nama_var, query) + if value in list_data: + list_data.remove(value) + await set_var(user_id, nama_var, " ".join(map(str, list_data)), query) diff --git a/ubot/core/function/__init__.py b/ubot/core/function/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..17077c962dceaa051684908a590fa20183c2a799 --- /dev/null +++ b/ubot/core/function/__init__.py @@ -0,0 +1,2 @@ +from ubot.core.function.expired import * +from ubot.core.function.plugins import * diff --git a/ubot/core/function/expired.py b/ubot/core/function/expired.py new file mode 100644 index 0000000000000000000000000000000000000000..49410a2a38cb7f989b0143c3acf4efbf26295d15 --- /dev/null +++ b/ubot/core/function/expired.py @@ -0,0 +1,42 @@ +import asyncio +from datetime import datetime + +from pyrogram.types import InlineKeyboardMarkup +from pytz import timezone + +from ubot import bot, ubot +from ubot.config import LOG_UBOT +from ubot.core.database import (get_chat, get_expired_date, rem_expired_date, + remove_chat, remove_ubot, rm_all) +from ubot.core.helpers import MSG, Button + + +async def expired_userbot(X): + try: + time = datetime.now(timezone("Asia/Jakarta")).strftime("%d-%m-%Y") + exp = (await get_expired_date(X.me.id)).strftime("%d-%m-%Y") + if time == exp: + for chat in await get_chat(X.me.id): + await remove_chat(X.me.id, chat) + await rm_all(X.me.id) + await remove_ubot(X.me.id) + await rem_expired_date(X.me.id) + ubot._get_my_id.remove(X.me.id) + ubot._ubot.remove(X) + await X.log_out() + expired_text = MSG.EXPIRED_MSG_BOT(X) + expired_button = Button.expired_button_bot() + await bot.send_message( + LOG_UBOT, + expired_text, + reply_markup=InlineKeyboardMarkup(expired_button), + ) + except Exception as e: + print(f"Error: {str(e)}") + + +async def expiredUserbots(): + while True: + tasks = [expired_userbot(X) for X in ubot._ubot] + await asyncio.gather(*tasks) + await asyncio.sleep(60) diff --git a/ubot/core/function/plugins.py b/ubot/core/function/plugins.py new file mode 100644 index 0000000000000000000000000000000000000000..862dc6edb23e1d8a6f41e9da64844ac2c77e3b4d --- /dev/null +++ b/ubot/core/function/plugins.py @@ -0,0 +1,49 @@ +from importlib import import_module +from platform import python_version + +from pyrogram import __version__ +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup + +from ubot import bot, ubot +from ubot.config import OWNER_ID +from ubot.core.helpers import PY +from ubot.modules import loadModule + +HELP_COMMANDS = {} + + +async def loadPlugins(): + modules = loadModule() + for mod in modules: + imported_module = import_module(f"ubot.modules.{mod}") + if hasattr(imported_module, "__MODULE__") and imported_module.__MODULE__: + imported_module.__MODULE__ = imported_module.__MODULE__ + if hasattr(imported_module, "__HELP__") and imported_module.__HELP__: + HELP_COMMANDS[ + imported_module.__MODULE__.replace(" ", "_").lower() + ] = imported_module + print(f"[🤖 @{bot.me.username} 🤖] [🔥 TELAH BERHASIL DIAKTIFKAN! 🔥]") + await bot.send_message( + OWNER_ID, + f""" +🤖 {bot.me.mention} Aktif + +Modules : {len(HELP_COMMANDS)} +Python : {python_version()} +Pyrogram : {__version__} +Users : {len(ubot._ubot)} +""", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton("Git Pull", callback_data="gitpull"), + InlineKeyboardButton("Restart", callback_data="restart"), + ], + ] + ), + ) + + +@PY.CALLBACK("0_cls") +async def _(client, callback_query): + await callback_query.message.delete() diff --git a/ubot/core/helpers/__init__.py b/ubot/core/helpers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..42235fe455821543edf68622f60d39950b6295f3 --- /dev/null +++ b/ubot/core/helpers/__init__.py @@ -0,0 +1,15 @@ +from ubot.core.helpers import http +from ubot.core.helpers.client import * +from ubot.core.helpers.decorator import * +from ubot.core.helpers.font_tool import * +from ubot.core.helpers.get_file_id import * +from ubot.core.helpers.inline import * +from ubot.core.helpers.kang_tool import * +from ubot.core.helpers.misc import * +from ubot.core.helpers.openAi import * +from ubot.core.helpers.section import * +from ubot.core.helpers.text import * +from ubot.core.helpers.tools import * +from ubot.core.helpers.unpack import * +from ubot.core.helpers.uptime import * +from ubot.core.helpers.yt_dl import * diff --git a/ubot/core/helpers/client.py b/ubot/core/helpers/client.py new file mode 100644 index 0000000000000000000000000000000000000000..d7a0416e77a01a75fe0de6bf8fcbe75a4fb5c73f --- /dev/null +++ b/ubot/core/helpers/client.py @@ -0,0 +1,127 @@ +from pyrogram import filters + +from ubot import * + + +class PY: + @staticmethod + def BOT(command, filter=False): + def wrapper(func): + message_filters = ( + filters.command(command) & filter + if filter + else filters.command(command) + ) + + @bot.on_message(message_filters) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def GC(): + def wrapper(func): + @ubot.on_message( + filters.group + & filters.mentioned + & filters.incoming + & ~filters.bot + & ~filters.via_bot + ) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def PC(): + def wrapper(func): + @ubot.on_message( + filters.private + & filters.incoming + & ~filters.me + & ~filters.bot + & ~filters.service + ) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def PM(): + def wrapper(func): + @ubot.on_message( + filters.private + & filters.incoming + & ~filters.me + & ~filters.bot + & ~filters.via_bot + & ~filters.service, + ) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def LISTEN(): + def wrapper(func): + @ubot.on_message(filters.mentioned & filters.incoming & filters.group) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def UBOT(command, sudo=False): + def wrapper(func): + sudo_command = anjay(command) if sudo else anjay(command) & filters.me + + @ubot.on_message(sudo_command) + async def wrapped_func(client, message): + if sudo: + sudo_id = await ambil_list_var(client.me.id, "SUDO_USER", "ID_NYA") + if client.me.id not in sudo_id: + sudo_id.append(client.me.id) + if message.from_user.id in sudo_id: + return await func(client, message) + else: + return await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def INLINE(command): + def wrapper(func): + @bot.on_inline_query(filters.regex(command)) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper + + @staticmethod + def CALLBACK(command): + def wrapper(func): + @bot.on_callback_query(filters.regex(command)) + async def wrapped_func(client, message): + await func(client, message) + + return wrapped_func + + return wrapper diff --git a/ubot/core/helpers/colong.py b/ubot/core/helpers/colong.py new file mode 100644 index 0000000000000000000000000000000000000000..946e5a2d79338daf51e859fc9621e0121ef22be8 --- /dev/null +++ b/ubot/core/helpers/colong.py @@ -0,0 +1,110 @@ +import asyncio +import math +import time + +from pyrogram.errors.exceptions import * + + +def humanbytes(size): + """Convert Bytes To Bytes So That Human Can Read It""" + if not size: + return "" + power = 2**10 + raised_to_pow = 0 + dict_power_n = {0: "", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"} + while size > power: + size /= power + raised_to_pow += 1 + return str(round(size, 2)) + " " + dict_power_n[raised_to_pow] + "B" + + +def time_formatter(milliseconds: int) -> str: + """Time Formatter""" + seconds, milliseconds = divmod(int(milliseconds), 1000) + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + tmp = ( + ((str(days) + " day(s), ") if days else "") + + ((str(hours) + " hour(s), ") if hours else "") + + ((str(minutes) + " minute(s), ") if minutes else "") + + ((str(seconds) + " second(s), ") if seconds else "") + + ((str(milliseconds) + " millisecond(s), ") if milliseconds else "") + ) + return tmp[:-2] + + +async def progress(current, total, message, start, type_of_ps, file_name=None): + """Progress Bar For Showing Progress While Uploading / Downloading File - Normal""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current == total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + if elapsed_time == 0: + return + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "{0}{1} {2}%\n".format( + "".join(["▰" for i in range(math.floor(percentage / 10))]), + "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + try: + await message.edit( + "{}\n**File Name:** `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass + else: + try: + await message.edit("{}\n{}".format(type_of_ps, tmp)) + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass + + +async def cb_progress(current, total, cb, start, type_of_ps, file_name=None): + """Progress Bar For Showing Progress While Uploading / Downloading File - Inline""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current == total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + if elapsed_time == 0: + return + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "{0}{1} {2}%\n".format( + "".join(["▰" for i in range(math.floor(percentage / 10))]), + "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + try: + await cb.edit_message_text( + "{}\n**File Name:** `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass + else: + try: + await message.edit_message_text("{}\n{}".format(type_of_ps, tmp)) + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass diff --git a/ubot/core/helpers/decorator.py b/ubot/core/helpers/decorator.py new file mode 100644 index 0000000000000000000000000000000000000000..d9e6710ba0a4c6fc91b529209412706bdd609907 --- /dev/null +++ b/ubot/core/helpers/decorator.py @@ -0,0 +1,33 @@ +from pyrogram.enums import ChatType + +from ubot import OWNER_ID, bot, ubot + + +async def load_user_allchats(client): + pcnya = [] + gcnya = [] + async for dialog in client.get_dialogs(limit=None): + try: + if dialog.chat.type == ChatType.PRIVATE: + pcnya.append(dialog.chat.id) + elif dialog.chat.type in (ChatType.GROUP, ChatType.SUPERGROUP): + gcnya.append(dialog.chat.id) + except Exception as e: + print(f"Error: {e}") + + return pcnya, gcnya + + +async def installing_user(client): + pcnya, gcnya = await load_user_allchats(client) + client_id = client.me.id + client._get_my_peer[client_id] = {"pm": pcnya, "gc": gcnya} + + +async def installPeer(): + try: + for client in ubot._ubot: + await installing_user(client) + except Exception: + pass + await bot.send_message(OWNER_ID, "✅ Sukses Install Data Pengguna.") diff --git a/ubot/core/helpers/font_tool.py b/ubot/core/helpers/font_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..57ed39043b740baa3b36349bcfe34ab8d5ea6089 --- /dev/null +++ b/ubot/core/helpers/font_tool.py @@ -0,0 +1,2560 @@ +class Fonts: + def typewriter(text): + style = { + "a": "𝚊", + "b": "𝚋", + "c": "𝚌", + "d": "𝚍", + "e": "𝚎", + "f": "𝚏", + "g": "𝚐", + "h": "𝚑", + "i": "𝚒", + "j": "𝚓", + "k": "𝚔", + "l": "𝚕", + "m": "𝚖", + "n": "𝚗", + "o": "𝚘", + "p": "𝚙", + "q": "𝚚", + "r": "𝚛", + "s": "𝚜", + "t": "𝚝", + "u": "𝚞", + "v": "𝚟", + "w": "𝚠", + "x": "𝚡", + "y": "𝚢", + "z": "𝚣", + "A": "𝙰", + "B": "𝙱", + "C": "𝙲", + "D": "𝙳", + "E": "𝙴", + "F": "𝙵", + "G": "𝙶", + "H": "𝙷", + "I": "𝙸", + "J": "𝙹", + "K": "𝙺", + "L": "𝙻", + "M": "𝙼", + "N": "𝙽", + "O": "𝙾", + "P": "𝙿", + "Q": "𝚀", + "R": "𝚁", + "S": "𝚂", + "T": "𝚃", + "U": "𝚄", + "V": "𝚅", + "W": "𝚆", + "X": "𝚇", + "Y": "𝚈", + "Z": "𝚉", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def outline(text): + style = { + "a": "𝕒", + "b": "𝕓", + "c": "𝕔", + "d": "𝕕", + "e": "𝕖", + "f": "𝕗", + "g": "𝕘", + "h": "𝕙", + "i": "𝕚", + "j": "𝕛", + "k": "𝕜", + "l": "𝕝", + "m": "𝕞", + "n": "𝕟", + "o": "𝕠", + "p": "𝕡", + "q": "𝕢", + "r": "𝕣", + "s": "𝕤", + "t": "𝕥", + "u": "𝕦", + "v": "𝕧", + "w": "𝕨", + "x": "𝕩", + "y": "𝕪", + "z": "𝕫", + "A": "𝔸", + "B": "𝔹", + "C": "ℂ", + "D": "𝔻", + "E": "𝔼", + "F": "𝔽", + "G": "𝔾", + "H": "ℍ", + "I": "𝕀", + "J": "𝕁", + "K": "𝕂", + "L": "𝕃", + "M": "𝕄", + "N": "ℕ", + "O": "𝕆", + "P": "ℙ", + "Q": "ℚ", + "R": "ℝ", + "S": "𝕊", + "T": "𝕋", + "U": "𝕌", + "V": "𝕍", + "W": "𝕎", + "X": "𝕏", + "Y": "𝕐", + "Z": "ℤ", + "0": "𝟘", + "1": "𝟙", + "2": "𝟚", + "3": "𝟛", + "4": "𝟜", + "5": "𝟝", + "6": "𝟞", + "7": "𝟟", + "8": "𝟠", + "9": "𝟡", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def serief(text): + style = { + "a": "𝐚", + "b": "𝐛", + "c": "𝐜", + "d": "𝐝", + "e": "𝐞", + "f": "𝐟", + "g": "𝐠", + "h": "𝐡", + "i": "𝐢", + "j": "𝐣", + "k": "𝐤", + "l": "𝐥", + "m": "𝐦", + "n": "𝐧", + "o": "𝐨", + "p": "𝐩", + "q": "𝐪", + "r": "𝐫", + "s": "𝐬", + "t": "𝐭", + "u": "𝐮", + "v": "𝐯", + "w": "𝐰", + "x": "𝐱", + "y": "𝐲", + "z": "𝐳", + "A": "𝐀", + "B": "𝐁", + "C": "𝐂", + "D": "𝐃", + "E": "𝐄", + "F": "𝐅", + "G": "𝐆", + "H": "𝐇", + "I": "𝐈", + "J": "𝐉", + "K": "𝐊", + "L": "𝐋", + "M": "𝐌", + "N": "𝐍", + "O": "𝐎", + "P": "𝐏", + "Q": "𝐐", + "R": "𝐑", + "S": "𝐒", + "T": "𝐓", + "U": "𝐔", + "V": "𝐕", + "W": "𝐖", + "X": "𝐗", + "Y": "𝐘", + "Z": "𝐙", + "0": "𝟎", + "1": "𝟏", + "2": "𝟐", + "3": "𝟑", + "4": "𝟒", + "5": "𝟓", + "6": "𝟔", + "7": "𝟕", + "8": "𝟖", + "9": "𝟗", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def bold_cool(text): + style = { + "a": "𝒂", + "b": "𝒃", + "c": "𝒄", + "d": "𝒅", + "e": "𝒆", + "f": "𝒇", + "g": "𝒈", + "h": "𝒉", + "i": "𝒊", + "j": "𝒋", + "k": "𝒌", + "l": "𝒍", + "m": "𝒎", + "n": "𝒏", + "o": "𝒐", + "p": "𝒑", + "q": "𝒒", + "r": "𝒓", + "s": "𝒔", + "t": "𝒕", + "u": "𝒖", + "v": "𝒗", + "w": "𝒘", + "x": "𝒙", + "y": "𝒚", + "z": "𝒛", + "A": "𝑨", + "B": "𝑩", + "C": "𝑪", + "D": "𝑫", + "E": "𝑬", + "F": "𝑭", + "G": "𝑮", + "H": "𝑯", + "I": "𝑰", + "J": "𝑱", + "K": "𝑲", + "L": "𝑳", + "M": "𝑴", + "N": "𝑵", + "O": "𝑶", + "P": "𝑷", + "Q": "𝑸", + "R": "𝑹", + "S": "𝑺", + "T": "𝑻", + "U": "𝑼", + "V": "𝑽", + "W": "𝑾", + "X": "𝑿", + "Y": "𝒀", + "Z": "𝒁", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def cool(text): + style = { + "a": "𝑎", + "b": "𝑏", + "c": "𝑐", + "d": "𝑑", + "e": "𝑒", + "f": "𝑓", + "g": "𝑔", + "h": "ℎ", + "i": "𝑖", + "j": "𝑗", + "k": "𝑘", + "l": "𝑙", + "m": "𝑚", + "n": "𝑛", + "o": "𝑜", + "p": "𝑝", + "q": "𝑞", + "r": "𝑟", + "s": "𝑠", + "t": "𝑡", + "u": "𝑢", + "v": "𝑣", + "w": "𝑤", + "x": "𝑥", + "y": "𝑦", + "z": "𝑧", + "A": "𝐴", + "B": "𝐵", + "C": "𝐶", + "D": "𝐷", + "E": "𝐸", + "F": "𝐹", + "G": "𝐺", + "H": "𝐻", + "I": "𝐼", + "J": "𝐽", + "K": "𝐾", + "L": "𝐿", + "M": "𝑀", + "N": "𝑁", + "O": "𝑂", + "P": "𝑃", + "Q": "𝑄", + "R": "𝑅", + "S": "𝑆", + "T": "𝑇", + "U": "𝑈", + "V": "𝑉", + "W": "𝑊", + "X": "𝑋", + "Y": "𝑌", + "Z": "𝑍", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def smallcap(text): + style = { + "a": "ᴀ", + "b": "ʙ", + "c": "ᴄ", + "d": "ᴅ", + "e": "ᴇ", + "f": "ғ", + "g": "ɢ", + "h": "ʜ", + "i": "ɪ", + "j": "J", + "k": "ᴋ", + "l": "ʟ", + "m": "ᴍ", + "n": "ɴ", + "o": "ᴏ", + "p": "ᴘ", + "q": "ǫ", + "r": "ʀ", + "s": "s", + "t": "ᴛ", + "u": "ᴜ", + "v": "ᴠ", + "w": "ᴡ", + "x": "x", + "y": "ʏ", + "z": "ᴢ", + "A": "A", + "B": "B", + "C": "C", + "D": "D", + "E": "E", + "F": "F", + "G": "G", + "H": "H", + "I": "I", + "J": "J", + "K": "K", + "L": "L", + "M": "M", + "N": "N", + "O": "O", + "P": "P", + "Q": "Q", + "R": "R", + "S": "S", + "T": "T", + "U": "U", + "V": "V", + "W": "W", + "X": "X", + "Y": "Y", + "Z": "Z", + "0": "𝟶", + "1": "𝟷", + "2": "𝟸", + "3": "𝟹", + "4": "𝟺", + "5": "𝟻", + "6": "𝟼", + "7": "𝟽", + "8": "𝟾", + "9": "𝟿", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def script(text): + style = { + "a": "𝒶", + "b": "𝒷", + "c": "𝒸", + "d": "𝒹", + "e": "ℯ", + "f": "𝒻", + "g": "ℊ", + "h": "𝒽", + "i": "𝒾", + "j": "𝒿", + "k": "𝓀", + "l": "𝓁", + "m": "𝓂", + "n": "𝓃", + "o": "ℴ", + "p": "𝓅", + "q": "𝓆", + "r": "𝓇", + "s": "𝓈", + "t": "𝓉", + "u": "𝓊", + "v": "𝓋", + "w": "𝓌", + "x": "𝓍", + "y": "𝓎", + "z": "𝓏", + "A": "𝒜", + "B": "ℬ", + "C": "𝒞", + "D": "𝒟", + "E": "ℰ", + "F": "ℱ", + "G": "𝒢", + "H": "ℋ", + "I": "ℐ", + "J": "𝒥", + "K": "𝒦", + "L": "ℒ", + "M": "ℳ", + "N": "𝒩", + "O": "𝒪", + "P": "𝒫", + "Q": "𝒬", + "R": "ℛ", + "S": "𝒮", + "T": "𝒯", + "U": "𝒰", + "V": "𝒱", + "W": "𝒲", + "X": "𝒳", + "Y": "𝒴", + "Z": "𝒵", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def bold_script(text): + style = { + "a": "𝓪", + "b": "𝓫", + "c": "𝓬", + "d": "𝓭", + "e": "𝓮", + "f": "𝓯", + "g": "𝓰", + "h": "𝓱", + "i": "𝓲", + "j": "𝓳", + "k": "𝓴", + "l": "𝓵", + "m": "𝓶", + "n": "𝓷", + "o": "𝓸", + "p": "𝓹", + "q": "𝓺", + "r": "𝓻", + "s": "𝓼", + "t": "𝓽", + "u": "𝓾", + "v": "𝓿", + "w": "𝔀", + "x": "𝔁", + "y": "𝔂", + "z": "𝔃", + "A": "𝓐", + "B": "𝓑", + "C": "𝓒", + "D": "𝓓", + "E": "𝓔", + "F": "𝓕", + "G": "𝓖", + "H": "𝓗", + "I": "𝓘", + "J": "𝓙", + "K": "𝓚", + "L": "𝓛", + "M": "𝓜", + "N": "𝓝", + "O": "𝓞", + "P": "𝓟", + "Q": "𝓠", + "R": "𝓡", + "S": "𝓢", + "T": "𝓣", + "U": "𝓤", + "V": "𝓥", + "W": "𝓦", + "X": "𝓧", + "Y": "𝓨", + "Z": "𝓩", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def tiny(text): + style = { + "a": "ᵃ", + "b": "ᵇ", + "c": "ᶜ", + "d": "ᵈ", + "e": "ᵉ", + "f": "ᶠ", + "g": "ᵍ", + "h": "ʰ", + "i": "ⁱ", + "j": "ʲ", + "k": "ᵏ", + "l": "ˡ", + "m": "ᵐ", + "n": "ⁿ", + "o": "ᵒ", + "p": "ᵖ", + "q": "ᵠ", + "r": "ʳ", + "s": "ˢ", + "t": "ᵗ", + "u": "ᵘ", + "v": "ᵛ", + "w": "ʷ", + "x": "ˣ", + "y": "ʸ", + "z": "ᶻ", + "A": "ᵃ", + "B": "ᵇ", + "C": "ᶜ", + "D": "ᵈ", + "E": "ᵉ", + "F": "ᶠ", + "G": "ᵍ", + "H": "ʰ", + "I": "ⁱ", + "J": "ʲ", + "K": "ᵏ", + "L": "ˡ", + "M": "ᵐ", + "N": "ⁿ", + "O": "ᵒ", + "P": "ᵖ", + "Q": "ᵠ", + "R": "ʳ", + "S": "ˢ", + "T": "ᵗ", + "U": "ᵘ", + "V": "ᵛ", + "W": "ʷ", + "X": "ˣ", + "Y": "ʸ", + "Z": "ᶻ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def comic(text): + style = { + "a": "ᗩ", + "b": "ᗷ", + "c": "ᑕ", + "d": "ᗪ", + "e": "ᗴ", + "f": "ᖴ", + "g": "ᘜ", + "h": "ᕼ", + "i": "I", + "j": "ᒍ", + "k": "K", + "l": "ᒪ", + "m": "ᗰ", + "n": "ᑎ", + "o": "O", + "p": "ᑭ", + "q": "ᑫ", + "r": "ᖇ", + "s": "Տ", + "t": "T", + "u": "ᑌ", + "v": "ᐯ", + "w": "ᗯ", + "x": "᙭", + "y": "Y", + "z": "ᘔ", + "A": "ᗩ", + "B": "ᗷ", + "C": "ᑕ", + "D": "ᗪ", + "E": "ᗴ", + "F": "ᖴ", + "G": "ᘜ", + "H": "ᕼ", + "I": "I", + "J": "ᒍ", + "K": "K", + "L": "ᒪ", + "M": "ᗰ", + "N": "ᑎ", + "O": "O", + "P": "ᑭ", + "Q": "ᑫ", + "R": "ᖇ", + "S": "Տ", + "T": "T", + "U": "ᑌ", + "V": "ᐯ", + "W": "ᗯ", + "X": "᙭", + "Y": "Y", + "Z": "ᘔ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def san(text): + style = { + "a": "𝗮", + "b": "𝗯", + "c": "𝗰", + "d": "𝗱", + "e": "𝗲", + "f": "𝗳", + "g": "𝗴", + "h": "𝗵", + "i": "𝗶", + "j": "𝗷", + "k": "𝗸", + "l": "𝗹", + "m": "𝗺", + "n": "𝗻", + "o": "𝗼", + "p": "𝗽", + "q": "𝗾", + "r": "𝗿", + "s": "𝘀", + "t": "𝘁", + "u": "𝘂", + "v": "𝘃", + "w": "𝘄", + "x": "𝘅", + "y": "𝘆", + "z": "𝘇", + "A": "𝗔", + "B": "𝗕", + "C": "𝗖", + "D": "𝗗", + "E": "𝗘", + "F": "𝗙", + "G": "𝗚", + "H": "𝗛", + "I": "𝗜", + "J": "𝗝", + "K": "𝗞", + "L": "𝗟", + "M": "𝗠", + "N": "𝗡", + "O": "𝗢", + "P": "𝗣", + "Q": "𝗤", + "R": "𝗥", + "S": "𝗦", + "T": "𝗧", + "U": "𝗨", + "V": "𝗩", + "W": "𝗪", + "X": "𝗫", + "Y": "𝗬", + "Z": "𝗭", + "0": "𝟬", + "1": "𝟭", + "2": "𝟮", + "3": "𝟯", + "4": "𝟰", + "5": "𝟱", + "6": "𝟲", + "7": "𝟳", + "8": "𝟴", + "9": "𝟵", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def slant_san(text): + style = { + "a": "𝙖", + "b": "𝙗", + "c": "𝙘", + "d": "𝙙", + "e": "𝙚", + "f": "𝙛", + "g": "𝙜", + "h": "𝙝", + "i": "𝙞", + "j": "𝙟", + "k": "𝙠", + "l": "𝙡", + "m": "𝙢", + "n": "𝙣", + "o": "𝙤", + "p": "𝙥", + "q": "𝙦", + "r": "𝙧", + "s": "𝙨", + "t": "𝙩", + "u": "𝙪", + "v": "𝙫", + "w": "𝙬", + "x": "𝙭", + "y": "𝙮", + "z": "𝙯", + "A": "𝘼", + "B": "𝘽", + "C": "𝘾", + "D": "𝘿", + "E": "𝙀", + "F": "𝙁", + "G": "𝙂", + "H": "𝙃", + "I": "𝙄", + "J": "𝙅", + "K": "𝙆", + "L": "𝙇", + "M": "𝙈", + "N": "𝙉", + "O": "𝙊", + "P": "𝙋", + "Q": "𝙌", + "R": "𝙍", + "S": "𝙎", + "T": "𝙏", + "U": "𝙐", + "V": "𝙑", + "W": "𝙒", + "X": "𝙓", + "Y": "𝙔", + "Z": "𝙕", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def slant(text): + style = { + "a": "𝘢", + "b": "𝘣", + "c": "𝘤", + "d": "𝘥", + "e": "𝘦", + "f": "𝘧", + "g": "𝘨", + "h": "𝘩", + "i": "𝘪", + "j": "𝘫", + "k": "𝘬", + "l": "𝘭", + "m": "𝘮", + "n": "𝘯", + "o": "𝘰", + "p": "𝘱", + "q": "𝘲", + "r": "𝘳", + "s": "𝘴", + "t": "𝘵", + "u": "𝘶", + "v": "𝘷", + "w": "𝘸", + "x": "𝘹", + "y": "𝘺", + "z": "𝘻", + "A": "𝘈", + "B": "𝘉", + "C": "𝘊", + "D": "𝘋", + "E": "𝘌", + "F": "𝘍", + "G": "𝘎", + "H": "𝘏", + "I": "𝘐", + "J": "𝘑", + "K": "𝘒", + "L": "𝘓", + "M": "𝘔", + "N": "𝘕", + "O": "𝘖", + "P": "𝘗", + "Q": "𝘘", + "R": "𝘙", + "S": "𝘚", + "T": "𝘛", + "U": "𝘜", + "V": "𝘝", + "W": "𝘞", + "X": "𝘟", + "Y": "𝘠", + "Z": "𝘡", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def sim(text): + style = { + "a": "𝖺", + "b": "𝖻", + "c": "𝖼", + "d": "𝖽", + "e": "𝖾", + "f": "𝖿", + "g": "𝗀", + "h": "𝗁", + "i": "𝗂", + "j": "𝗃", + "k": "𝗄", + "l": "𝗅", + "m": "𝗆", + "n": "𝗇", + "o": "𝗈", + "p": "𝗉", + "q": "𝗊", + "r": "𝗋", + "s": "𝗌", + "t": "𝗍", + "u": "𝗎", + "v": "𝗏", + "w": "𝗐", + "x": "𝗑", + "y": "𝗒", + "z": "𝗓", + "A": "𝖠", + "B": "𝖡", + "C": "𝖢", + "D": "𝖣", + "E": "𝖤", + "F": "𝖥", + "G": "𝖦", + "H": "𝖧", + "I": "𝖨", + "J": "𝖩", + "K": "𝖪", + "L": "𝖫", + "M": "𝖬", + "N": "𝖭", + "O": "𝖮", + "P": "𝖯", + "Q": "𝖰", + "R": "𝖱", + "S": "𝖲", + "T": "𝖳", + "U": "𝖴", + "V": "𝖵", + "W": "𝖶", + "X": "𝖷", + "Y": "𝖸", + "Z": "𝖹", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def circles(text): + style = { + "a": "Ⓐ︎", + "b": "Ⓑ︎", + "c": "Ⓒ︎", + "d": "Ⓓ︎", + "e": "Ⓔ︎", + "f": "Ⓕ︎", + "g": "Ⓖ︎", + "h": "Ⓗ︎", + "i": "Ⓘ︎", + "j": "Ⓙ︎", + "k": "Ⓚ︎", + "l": "Ⓛ︎", + "m": "Ⓜ︎", + "n": "Ⓝ︎", + "o": "Ⓞ︎", + "p": "Ⓟ︎", + "q": "Ⓠ︎", + "r": "Ⓡ︎", + "s": "Ⓢ︎", + "t": "Ⓣ︎", + "u": "Ⓤ︎", + "v": "Ⓥ︎", + "w": "Ⓦ︎", + "x": "Ⓧ︎", + "y": "Ⓨ︎", + "z": "Ⓩ︎", + "A": "Ⓐ︎", + "B": "Ⓑ︎", + "C": "Ⓒ︎", + "D": "Ⓓ︎", + "E": "Ⓔ︎", + "F": "Ⓕ︎", + "G": "Ⓖ︎", + "H": "Ⓗ︎", + "I": "Ⓘ︎", + "J": "Ⓙ︎", + "K": "Ⓚ︎", + "L": "Ⓛ︎", + "M": "Ⓜ︎", + "N": "Ⓝ︎", + "O": "Ⓞ︎", + "P": "Ⓟ︎", + "Q": "Ⓠ︎", + "R": "Ⓡ︎", + "S": "Ⓢ︎", + "T": "Ⓣ︎", + "U": "Ⓤ︎", + "V": "Ⓥ︎", + "W": "Ⓦ︎", + "X": "Ⓧ︎", + "Y": "Ⓨ︎", + "Z": "Ⓩ︎", + "0": "⓪", + "1": "①", + "2": "②", + "3": "③", + "4": "④", + "5": "⑤", + "6": "⑥", + "7": "⑦", + "8": "⑧", + "9": "⑨", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def dark_circle(text): + style = { + "a": "🅐︎", + "b": "🅑︎", + "c": "🅒︎", + "d": "🅓︎", + "e": "🅔︎", + "f": "🅕︎", + "g": "🅖︎", + "h": "🅗︎", + "i": "🅘︎", + "j": "🅙︎", + "k": "🅚︎", + "l": "🅛︎", + "m": "🅜︎", + "n": "🅝︎", + "o": "🅞︎", + "p": "🅟︎", + "q": "🅠︎", + "r": "🅡︎", + "s": "🅢︎", + "t": "🅣︎", + "u": "🅤︎", + "v": "🅥︎", + "w": "🅦︎", + "x": "🅧︎", + "y": "🅨︎", + "z": "🅩︎", + "A": "🅐︎", + "B": "🅑︎", + "C": "🅒︎", + "D": "🅓︎", + "E": "🅔︎", + "F": "🅕︎", + "G": "🅖︎", + "H": "🅗︎", + "I": "🅘︎", + "J": "🅙︎", + "K": "🅚︎", + "L": "🅛︎", + "M": "🅜︎", + "N": "🅝︎", + "O": "🅞︎", + "P": "🅟︎", + "Q": "🅠︎", + "R": "🅡︎", + "S": "🅢︎", + "T": "🅣︎", + "U": "🅤︎", + "V": "🅥︎", + "W": "🅦︎", + "X": "🅧︎", + "Y": "🅨︎", + "Z": "🅩", + "0": "⓿", + "1": "➊", + "2": "➋", + "3": "➌", + "4": "➍", + "5": "➎", + "6": "➏", + "7": "➐", + "8": "➑", + "9": "➒", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def gothic(text): + style = { + "a": "𝔞", + "b": "𝔟", + "c": "𝔠", + "d": "𝔡", + "e": "𝔢", + "f": "𝔣", + "g": "𝔤", + "h": "𝔥", + "i": "𝔦", + "j": "𝔧", + "k": "𝔨", + "l": "𝔩", + "m": "𝔪", + "n": "𝔫", + "o": "𝔬", + "p": "𝔭", + "q": "𝔮", + "r": "𝔯", + "s": "𝔰", + "t": "𝔱", + "u": "𝔲", + "v": "𝔳", + "w": "𝔴", + "x": "𝔵", + "y": "𝔶", + "z": "𝔷", + "A": "𝔄", + "B": "𝔅", + "C": "ℭ", + "D": "𝔇", + "E": "𝔈", + "F": "𝔉", + "G": "𝔊", + "H": "ℌ", + "I": "ℑ", + "J": "𝔍", + "K": "𝔎", + "L": "𝔏", + "M": "𝔐", + "N": "𝔑", + "O": "𝔒", + "P": "𝔓", + "Q": "𝔔", + "R": "ℜ", + "S": "𝔖", + "T": "𝔗", + "U": "𝔘", + "V": "𝔙", + "W": "𝔚", + "X": "𝔛", + "Y": "𝔜", + "Z": "ℨ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def bold_gothic(text): + style = { + "a": "𝖆", + "b": "𝖇", + "c": "𝖈", + "d": "𝖉", + "e": "𝖊", + "f": "𝖋", + "g": "𝖌", + "h": "𝖍", + "i": "𝖎", + "j": "𝖏", + "k": "𝖐", + "l": "𝖑", + "m": "𝖒", + "n": "𝖓", + "o": "𝖔", + "p": "𝖕", + "q": "𝖖", + "r": "𝖗", + "s": "𝖘", + "t": "𝖙", + "u": "𝖚", + "v": "𝖛", + "w": "𝖜", + "x": "𝖝", + "y": "𝖞", + "z": "𝖟", + "A": "𝕬", + "B": "𝕭", + "C": "𝕮", + "D": "𝕺", + "E": "𝕰", + "F": "𝕱", + "G": "𝕲", + "H": "𝕳", + "I": "𝕴", + "J": "𝕵", + "K": "𝕶", + "L": "𝕷", + "M": "𝕸", + "N": "𝕹", + "O": "𝕺", + "P": "𝕻", + "Q": "𝕼", + "R": "𝕽", + "S": "𝕾", + "T": "𝕿", + "U": "𝖀", + "V": "𝖁", + "W": "𝖂", + "X": "𝖃", + "Y": "𝖄", + "Z": "𝖅", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def upside_down(text): + style = { + "a": "ɐ", + "b": "q", + "c": "ɔ", + "d": "p", + "e": "ǝ", + "f": "ɟ", + "g": "ƃ", + "h": "ɥ", + "i": "ᴉ", + "j": "ɾ", + "k": "ʞ", + "l": "l", + "m": "ɯ", + "n": "u", + "o": "o", + "p": "d", + "q": "b", + "r": "ɹ", + "s": "s", + "t": "ʇ", + "u": "n", + "v": "ʌ", + "w": "ʍ", + "y": "ƃ", + "z": "z", + "A": "ɐ", + "B": "q", + "C": "ɔ", + "D": "p", + "E": "ǝ", + "F": "ɟ", + "G": "ƃ", + "H": "ɥ", + "I": "ᴉ", + "J": "ɾ", + "K": "ʞ", + "L": "l", + "N": "ɯ", + "M": "u", + "O": "o", + "P": "d", + "Q": "b", + "R": "ɹ", + "S": "s", + "T": "ʇ", + "U": "n", + "V": "ʌ", + "W": "ʍ", + "Y": "ƃ", + "Z": "z", + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def cloud(text): + style = { + "a": "a͜͡", + "b": "b͜͡", + "c": "c͜͡", + "d": "d͜͡", + "e": "e͜͡", + "f": "f͜͡", + "g": "g͜͡", + "h": "h͜͡", + "i": "i͜͡", + "j": "j͜͡", + "k": "k͜͡", + "l": "l͜͡", + "m": "m͜͡", + "n": "n͜͡", + "o": "o͜͡", + "p": "p͜͡", + "q": "q͜͡", + "r": "r͜͡", + "s": "s͜͡", + "t": "t͜͡", + "u": "u͜͡", + "v": "v͜͡", + "w": "w͜͡", + "x": "x͜͡", + "y": "y͜͡", + "z": "z͜͡", + "A": "A͜͡", + "B": "B͜͡", + "C": "C͜͡", + "D": "D͜͡", + "E": "E͜͡", + "F": "F͜͡", + "G": "G͜͡", + "H": "H͜͡", + "I": "I͜͡", + "J": "J͜͡", + "K": "K͜͡", + "L": "L͜͡", + "M": "M͜͡", + "N": "N͜͡", + "O": "O͜͡", + "P": "P͜͡", + "Q": "Q͜͡", + "R": "R͜͡", + "S": "S͜͡", + "T": "T͜͡", + "U": "U͜͡", + "V": "V͜͡", + "W": "W͜͡", + "X": "X͜͡", + "Y": "Y͜͡", + "Z": "Z͜͡", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def happy(text): + style = { + "a": "ă̈", + "b": "b̆̈", + "c": "c̆̈", + "d": "d̆̈", + "e": "ĕ̈", + "f": "f̆̈", + "g": "ğ̈", + "h": "h̆̈", + "i": "ĭ̈", + "j": "j̆̈", + "k": "k̆̈", + "l": "l̆̈", + "m": "m̆̈", + "n": "n̆̈", + "o": "ŏ̈", + "p": "p̆̈", + "q": "q̆̈", + "r": "r̆̈", + "s": "s̆̈", + "t": "t̆̈", + "u": "ŭ̈", + "v": "v̆̈", + "w": "w̆̈", + "x": "x̆̈", + "y": "y̆̈", + "z": "z̆̈", + "A": "Ă̈", + "B": "B̆̈", + "C": "C̆̈", + "D": "D̆̈", + "E": "Ĕ̈", + "F": "F̆̈", + "G": "Ğ̈", + "H": "H̆̈", + "I": "Ĭ̈", + "J": "J̆̈", + "K": "K̆̈", + "L": "L̆̈", + "M": "M̆̈", + "N": "N̆̈", + "O": "Ŏ̈", + "P": "P̆̈", + "Q": "Q̆̈", + "R": "R̆̈", + "S": "S̆̈", + "T": "T̆̈", + "U": "Ŭ̈", + "V": "V̆̈", + "W": "W̆̈", + "X": "X̆̈", + "Y": "Y̆̈", + "Z": "Z̆̈", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def sad(text): + style = { + "a": "ȃ̈", + "b": "b̑̈", + "c": "c̑̈", + "d": "d̑̈", + "e": "ȇ̈", + "f": "f̑̈", + "g": "g̑̈", + "h": "h̑̈", + "i": "ȋ̈", + "j": "j̑̈", + "k": "k̑̈", + "l": "l̑̈", + "m": "m̑̈", + "n": "n̑̈", + "o": "ȏ̈", + "p": "p̑̈", + "q": "q̑̈", + "r": "ȓ̈", + "s": "s̑̈", + "t": "t̑̈", + "u": "ȗ̈", + "v": "v̑̈", + "w": "w̑̈", + "x": "x̑̈", + "y": "y̑̈", + "z": "z̑̈", + "A": "Ȃ̈", + "B": "B̑̈", + "C": "C̑̈", + "D": "D̑̈", + "E": "Ȇ̈", + "F": "F̑̈", + "G": "G̑̈", + "H": "H̑̈", + "I": "Ȋ̈", + "J": "J̑̈", + "K": "K̑̈", + "L": "L̑̈", + "M": "M̑̈", + "N": "N̑̈", + "O": "Ȏ̈", + "P": "P̑̈", + "Q": "Q̑̈", + "R": "Ȓ̈", + "S": "S̑̈", + "T": "T̑̈", + "U": "Ȗ̈", + "V": "V̑̈", + "W": "W̑̈", + "X": "X̑̈", + "Y": "Y̑̈", + "Z": "Z̑̈", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def special(text): + style = { + "a": "🇦 ", + "b": "🇧 ", + "c": "🇨 ", + "d": "🇩 ", + "e": "🇪 ", + "f": "🇫 ", + "g": "🇬 ", + "h": "🇭 ", + "i": "🇮 ", + "j": "🇯 ", + "k": "🇰 ", + "l": "🇱 ", + "m": "🇲 ", + "n": "🇳 ", + "o": "🇴 ", + "p": "🇵 ", + "q": "🇶 ", + "r": "🇷 ", + "s": "🇸 ", + "t": "🇹 ", + "u": "🇺 ", + "v": "🇻 ", + "w": "🇼 ", + "x": "🇽 ", + "y": "🇾 ", + "z": "🇿 ", + "A": "🇦 ", + "B": "🇧 ", + "C": "🇨 ", + "D": "🇩 ", + "E": "🇪 ", + "F": "🇫 ", + "G": "🇬 ", + "H": "🇭 ", + "I": "🇮 ", + "J": "🇯 ", + "K": "🇰 ", + "L": "🇱 ", + "M": "🇲 ", + "N": "🇳 ", + "O": "🇴 ", + "P": "🇵 ", + "Q": "🇶 ", + "R": "🇷 ", + "S": "🇸 ", + "T": "🇹 ", + "U": "🇺 ", + "V": "🇻 ", + "W": "🇼 ", + "X": "🇽 ", + "Y": "🇾 ", + "Z": "🇿 ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def square(text): + style = { + "a": "🄰", + "b": "🄱", + "c": "🄲", + "d": "🄳", + "e": "🄴", + "f": "🄵", + "g": "🄶", + "h": "🄷", + "i": "🄸", + "j": "🄹", + "k": "🄺", + "l": "🄻", + "m": "🄼", + "n": "🄽", + "o": "🄾", + "p": "🄿", + "q": "🅀", + "r": "🅁", + "s": "🅂", + "t": "🅃", + "u": "🅄", + "v": "🅅", + "w": "🅆", + "x": "🅇", + "y": "🅈", + "z": "🅉", + "A": "🄰", + "B": "🄱", + "C": "🄲", + "D": "🄳", + "E": "🄴", + "F": "🄵", + "G": "🄶", + "H": "🄷", + "I": "🄸", + "J": "🄹", + "K": "🄺", + "L": "🄻", + "M": "🄼", + "N": "🄽", + "O": "🄾", + "P": "🄿", + "Q": "🅀", + "R": "🅁", + "S": "🅂", + "T": "🅃", + "U": "🅄", + "V": "🅅", + "W": "🅆", + "X": "🅇", + "Y": "🅈", + "Z": "🅉", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def dark_square(text): + style = { + "a": "🅰︎", + "b": "🅱︎", + "c": "🅲︎", + "d": "🅳︎", + "e": "🅴︎", + "f": "🅵︎", + "g": "🅶︎", + "h": "🅷︎", + "i": "🅸︎", + "j": "🅹︎", + "k": "🅺︎", + "l": "🅻︎", + "m": "🅼︎", + "n": "🅽︎", + "o": "🅾︎", + "p": "🅿︎", + "q": "🆀︎", + "r": "🆁︎", + "s": "🆂︎", + "t": "🆃︎", + "u": "🆄︎", + "v": "🆅︎", + "w": "🆆︎", + "x": "🆇︎", + "y": "🆈︎", + "z": "🆉︎", + "A": "🅰︎", + "B": "🅱︎", + "C": "🅲︎", + "D": "🅳︎", + "E": "🅴︎", + "F": "🅵︎", + "G": "🅶︎", + "H": "🅷︎", + "I": "🅸︎", + "J": "🅹︎", + "K": "🅺︎", + "L": "🅻︎", + "M": "🅼︎", + "N": "🅽︎", + "O": "🅾︎", + "P": "🅿︎", + "Q": "🆀︎", + "R": "🆁︎", + "S": "🆂︎", + "T": "🆃︎", + "U": "🆄︎", + "V": "🆅︎", + "W": "🆆︎", + "X": "🆇︎", + "Y": "🆈︎", + "Z": "🆉︎", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def andalucia(text): + style = { + "a": "ꪖ", + "b": "᥇", + "c": "ᥴ", + "d": "ᦔ", + "e": "ꫀ", + "f": "ᠻ", + "g": "ᧁ", + "h": "ꫝ", + "i": "𝓲", + "j": "𝓳", + "k": "𝘬", + "l": "ꪶ", + "m": "ꪑ", + "n": "ꪀ", + "o": "ꪮ", + "p": "ρ", + "q": "𝘲", + "r": "𝘳", + "s": "𝘴", + "t": "𝓽", + "u": "ꪊ", + "v": "ꪜ", + "w": "᭙", + "x": "᥊", + "y": "ꪗ", + "z": "ɀ", + "A": "ꪖ", + "B": "᥇", + "C": "ᥴ", + "D": "ᦔ", + "E": "ꫀ", + "F": "ᠻ", + "G": "ᧁ", + "H": "ꫝ", + "I": "𝓲", + "J": "𝓳", + "K": "𝘬", + "L": "ꪶ", + "M": "ꪑ", + "N": "ꪀ", + "O": "ꪮ", + "P": "ρ", + "Q": "𝘲", + "R": "𝘳", + "S": "𝘴", + "T": "𝓽", + "U": "ꪊ", + "V": "ꪜ", + "W": "᭙", + "X": "᥊", + "Y": "ꪗ", + "Z": "ɀ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def manga(text): + style = { + "a": "卂", + "b": "乃", + "c": "匚", + "d": "ᗪ", + "e": "乇", + "f": "千", + "g": "ᘜ", + "h": "卄", + "i": "|", + "j": "フ", + "k": "Ҝ", + "l": "ㄥ", + "m": "爪", + "n": "几", + "o": "ㄖ", + "p": "卩", + "q": "Ҩ", + "r": "尺", + "s": "丂", + "t": "ㄒ", + "u": "ㄩ", + "v": "ᐯ", + "w": "山", + "x": "乂", + "y": "ㄚ", + "z": "乙", + "A": "卂", + "B": "乃", + "C": "匚", + "D": "ᗪ", + "E": "乇", + "F": "千", + "G": "ᘜ", + "H": "卄", + "I": "|", + "J": "フ", + "K": "Ҝ", + "L": "ㄥ", + "M": "爪", + "N": "几", + "O": "ㄖ", + "P": "卩", + "Q": "Ҩ", + "R": "尺", + "S": "丂", + "T": "ㄒ", + "U": "ㄩ", + "V": "ᐯ", + "W": "山", + "X": "乂", + "Y": "ㄚ", + "Z": "乙", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def stinky(text): + style = { + "a": "a̾", + "b": "b̾", + "c": "c̾", + "d": "d̾", + "e": "e̾", + "f": "f̾", + "g": "g̾", + "h": "h̾", + "i": "i̾", + "j": "j̾", + "k": "k̾", + "l": "l̾", + "m": "m̾", + "n": "n̾", + "o": "o̾", + "p": "p̾", + "q": "q̾", + "r": "r̾", + "s": "s̾", + "t": "t̾", + "u": "u̾", + "v": "v̾", + "w": "w̾", + "x": "x̾", + "y": "y̾", + "z": "z̾", + "A": "A̾", + "B": "B̾", + "C": "C̾", + "D": "D̾", + "E": "E̾", + "F": "F̾", + "G": "G̾", + "H": "H̾", + "I": "I̾", + "J": "J̾", + "K": "K̾", + "L": "L̾", + "M": "M̾", + "N": "N̾", + "O": "O̾", + "P": "P̾", + "Q": "Q̾", + "R": "R̾", + "S": "S̾", + "T": "T̾", + "U": "U̾", + "V": "V̾", + "W": "W̾", + "X": "X̾", + "Y": "Y̾", + "Z": "Z̾", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def bubbles(text): + style = { + "a": "ḁͦ", + "b": "b̥ͦ", + "c": "c̥ͦ", + "d": "d̥ͦ", + "e": "e̥ͦ", + "f": "f̥ͦ", + "g": "g̥ͦ", + "h": "h̥ͦ", + "i": "i̥ͦ", + "j": "j̥ͦ", + "k": "k̥ͦ", + "l": "l̥ͦ", + "m": "m̥ͦ", + "n": "n̥ͦ", + "o": "o̥ͦ", + "p": "p̥ͦ", + "q": "q̥ͦ", + "r": "r̥ͦ", + "s": "s̥ͦ", + "t": "t̥ͦ", + "u": "u̥ͦ", + "v": "v̥ͦ", + "w": "w̥ͦ", + "x": "x̥ͦ", + "y": "y̥ͦ", + "z": "z̥ͦ", + "A": "Ḁͦ", + "B": "B̥ͦ", + "C": "C̥ͦ", + "D": "D̥ͦ", + "E": "E̥ͦ", + "F": "F̥ͦ", + "G": "G̥ͦ", + "H": "H̥ͦ", + "I": "I̥ͦ", + "J": "J̥ͦ", + "K": "K̥ͦ", + "L": "L̥ͦ", + "M": "M̥ͦ", + "N": "N̥ͦ", + "O": "O̥ͦ", + "P": "P̥ͦ", + "Q": "Q̥ͦ", + "R": "R̥ͦ", + "S": "S̥ͦ", + "T": "T̥ͦ", + "U": "U̥ͦ", + "V": "V̥ͦ", + "W": "W̥ͦ", + "X": "X̥ͦ", + "Y": "Y̥ͦ", + "Z": "Z̥ͦ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def underline(text): + style = { + "a": "a͟", + "b": "b͟", + "c": "c͟", + "d": "d͟", + "e": "e͟", + "f": "f͟", + "g": "g͟", + "h": "h͟", + "i": "i͟", + "j": "j͟", + "k": "k͟", + "l": "l͟", + "m": "m͟", + "n": "n͟", + "o": "o͟", + "p": "p͟", + "q": "q͟", + "r": "r͟", + "s": "s͟", + "t": "t͟", + "u": "u͟", + "v": "v͟", + "w": "w͟", + "x": "x͟", + "y": "y͟", + "z": "z͟", + "A": "A͟", + "B": "B͟", + "C": "C͟", + "D": "D͟", + "E": "E͟", + "F": "F͟", + "G": "G͟", + "H": "H͟", + "I": "I͟", + "J": "J͟", + "K": "K͟", + "L": "L͟", + "M": "M͟", + "N": "N͟", + "O": "O͟", + "P": "P͟", + "Q": "Q͟", + "R": "R͟", + "S": "S͟", + "T": "T͟", + "U": "U͟", + "V": "V͟", + "W": "W͟", + "X": "X͟", + "Y": "Y͟", + "Z": "Z͟", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def ladybug(text): + style = { + "a": "ꍏ", + "b": "ꌃ", + "c": "ꏳ", + "d": "ꀷ", + "e": "ꏂ", + "f": "ꎇ", + "g": "ꁅ", + "h": "ꀍ", + "i": "ꀤ", + "j": "꒻", + "k": "ꀘ", + "l": "꒒", + "m": "ꎭ", + "n": "ꈤ", + "o": "ꂦ", + "p": "ᖘ", + "q": "ꆰ", + "r": "ꋪ", + "s": "ꌚ", + "t": "꓄", + "u": "ꀎ", + "v": "꒦", + "w": "ꅐ", + "x": "ꉧ", + "y": "ꌩ", + "z": "ꁴ", + "A": "ꍏ", + "B": "ꌃ", + "C": "ꏳ", + "D": "ꀷ", + "E": "ꏂ", + "F": "ꎇ", + "G": "ꁅ", + "H": "ꀍ", + "I": "ꀤ", + "J": "꒻", + "K": "ꀘ", + "L": "꒒", + "M": "ꎭ", + "N": "ꈤ", + "O": "ꂦ", + "P": "ᖘ", + "Q": "ꆰ", + "R": "ꋪ", + "S": "ꌚ", + "T": "꓄", + "U": "ꀎ", + "V": "꒦", + "W": "ꅐ", + "X": "ꉧ", + "Y": "ꌩ", + "Z": "ꁴ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def rays(text): + style = { + "a": "a҉", + "b": "b҉", + "c": "c҉", + "d": "d҉", + "e": "e҉", + "f": "f҉", + "g": "g҉", + "h": "h҉", + "i": "i҉", + "j": "j҉", + "k": "k҉", + "l": "l҉", + "m": "m҉", + "n": "n҉", + "o": "o҉", + "p": "p҉", + "q": "q҉", + "r": "r҉", + "s": "s҉", + "t": "t҉", + "u": "u҉", + "v": "v҉", + "w": "w҉", + "x": "x҉", + "y": "y҉", + "z": "z҉", + "A": "A҉", + "B": "B҉", + "C": "C҉", + "D": "D҉", + "E": "E҉", + "F": "F҉", + "G": "G҉", + "H": "H҉", + "I": "I҉", + "J": "J҉", + "K": "K҉", + "L": "L҉", + "M": "M҉", + "N": "N҉", + "O": "O҉", + "P": "P҉", + "Q": "Q҉", + "R": "R҉", + "S": "S҉", + "T": "T҉", + "U": "U҉", + "V": "V҉", + "W": "W҉", + "X": "X҉", + "Y": "Y҉", + "Z": "Z҉", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def birds(text): + style = { + "a": "a҈", + "b": "b҈", + "c": "c҈", + "d": "d҈", + "e": "e҈", + "f": "f҈", + "g": "g҈", + "h": "h҈", + "i": "i҈", + "j": "j҈", + "k": "k҈", + "l": "l҈", + "m": "m҈", + "n": "n҈", + "o": "o҈", + "p": "p҈", + "q": "q҈", + "r": "r҈", + "s": "s҈", + "t": "t҈", + "u": "u҈", + "v": "v҈", + "w": "w҈", + "x": "x҈", + "y": "y҈", + "z": "z҈", + "A": "A҈", + "B": "B҈", + "C": "C҈", + "D": "D҈", + "E": "E҈", + "F": "F҈", + "G": "G҈", + "H": "H҈", + "I": "I҈", + "J": "J҈", + "K": "K҈", + "L": "L҈", + "M": "M҈", + "N": "N҈", + "O": "O҈", + "P": "P҈", + "Q": "Q҈", + "R": "R҈", + "S": "S҈", + "T": "T҈", + "U": "U҈", + "V": "V҈", + "W": "W҈", + "X": "X҈", + "Y": "Y҈", + "Z": "Z҈", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def slash(text): + style = { + "a": "a̸", + "b": "b̸", + "c": "c̸", + "d": "d̸", + "e": "e̸", + "f": "f̸", + "g": "g̸", + "h": "h̸", + "i": "i̸", + "j": "j̸", + "k": "k̸", + "l": "l̸", + "m": "m̸", + "n": "n̸", + "o": "o̸", + "p": "p̸", + "q": "q̸", + "r": "r̸", + "s": "s̸", + "t": "t̸", + "u": "u̸", + "v": "v̸", + "w": "w̸", + "x": "x̸", + "y": "y̸", + "z": "z̸", + "A": "A̸", + "B": "B̸", + "C": "C̸", + "D": "D̸", + "E": "E̸", + "F": "F̸", + "G": "G̸", + "H": "H̸", + "I": "I̸", + "J": "J̸", + "K": "K̸", + "L": "L̸", + "M": "M̸", + "N": "N̸", + "O": "O̸", + "P": "P̸", + "Q": "Q̸", + "R": "R̸", + "S": "S̸", + "T": "T̸", + "U": "U̸", + "V": "V̸", + "W": "W̸", + "X": "X̸", + "Y": "Y̸", + "Z": "Z̸", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def stop(text): + style = { + "a": "a⃠", + "b": "b⃠", + "c": "c⃠", + "d": "d⃠", + "e": "e⃠", + "f": "f⃠", + "g": "g⃠", + "h": "h⃠", + "i": "i⃠", + "j": "j⃠", + "k": "k⃠", + "l": "l⃠", + "m": "m⃠", + "n": "n⃠", + "o": "o⃠", + "p": "p⃠", + "q": "q⃠", + "r": "r⃠", + "s": "s⃠", + "t": "t⃠", + "u": "u⃠", + "v": "v⃠", + "w": "w⃠", + "x": "x⃠", + "y": "y⃠", + "z": "z⃠", + "A": "A⃠", + "B": "B⃠", + "C": "C⃠", + "D": "D⃠", + "E": "E⃠", + "F": "F⃠", + "G": "G⃠", + "H": "H⃠", + "I": "I⃠", + "J": "J⃠", + "K": "K⃠", + "L": "L⃠", + "M": "M⃠", + "N": "N⃠", + "O": "O⃠", + "P": "P⃠", + "Q": "Q⃠", + "R": "R⃠", + "S": "S⃠", + "T": "T⃠", + "U": "U⃠", + "V": "V⃠", + "W": "W⃠", + "X": "X⃠", + "Y": "Y⃠", + "Z": "Z⃠", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def skyline(text): + style = { + "a": "a̺͆", + "b": "b̺͆", + "c": "c̺͆", + "d": "d̺͆", + "e": "e̺͆", + "f": "f̺͆", + "g": "g̺͆", + "h": "h̺͆", + "i": "i̺͆", + "j": "j̺͆", + "k": "k̺͆", + "l": "l̺͆", + "m": "m̺͆", + "n": "n̺͆", + "o": "o̺͆", + "p": "p̺͆", + "q": "q̺͆", + "r": "r̺͆", + "s": "s̺͆", + "t": "t̺͆", + "u": "u̺͆", + "v": "v̺͆", + "w": "w̺͆", + "x": "x̺͆", + "y": "y̺͆", + "z": "z̺͆", + "A": "A̺͆", + "B": "B̺͆", + "C": "C̺͆", + "D": "D̺͆", + "E": "E̺͆", + "F": "F̺͆", + "G": "G̺͆", + "H": "H̺͆", + "I": "I̺͆", + "J": "J̺͆", + "K": "K̺͆", + "L": "L̺͆", + "M": "M̺͆", + "N": "N̺͆", + "O": "O̺͆", + "P": "P̺͆", + "Q": "Q̺͆", + "R": "R̺͆", + "S": "S̺͆", + "T": "T̺͆", + "U": "U̺͆", + "V": "V̺͆", + "W": "W̺͆", + "X": "X̺͆", + "Y": "Y̺͆", + "Z": "Z̺͆", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def arrows(text): + style = { + "a": "a͎", + "b": "b͎", + "c": "c͎", + "d": "d͎", + "e": "e͎", + "f": "f͎", + "g": "g͎", + "h": "h͎", + "i": "i͎", + "j": "j͎", + "k": "k͎", + "l": "l͎", + "m": "m͎", + "n": "n͎", + "o": "o͎", + "p": "p͎", + "q": "q͎", + "r": "r͎", + "s": "s͎", + "t": "t͎", + "u": "u͎", + "v": "v͎", + "w": "w͎", + "x": "x͎", + "y": "y͎", + "z": "z͎", + "A": "A͎", + "B": "B͎", + "C": "C͎", + "D": "D͎", + "E": "E͎", + "F": "F͎", + "G": "G͎", + "H": "H͎", + "I": "I͎", + "J": "J͎", + "K": "K͎", + "L": "L͎", + "M": "M͎", + "N": "N͎", + "O": "O͎", + "P": "P͎", + "Q": "Q͎", + "R": "R͎", + "S": "S͎", + "T": "T͎", + "U": "U͎", + "V": "V͎", + "W": "W͎", + "X": "X͎", + "Y": "Y͎", + "Z": "Z͎", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def rvnes(text): + style = { + "a": "ል", + "b": "ጌ", + "c": "ር", + "d": "ዕ", + "e": "ቿ", + "f": "ቻ", + "g": "ኗ", + "h": "ዘ", + "i": "ጎ", + "j": "ጋ", + "k": "ጕ", + "l": "ረ", + "m": "ጠ", + "n": "ክ", + "o": "ዐ", + "p": "የ", + "q": "ዒ", + "r": "ዪ", + "s": "ነ", + "t": "ፕ", + "u": "ሁ", + "v": "ሀ", + "w": "ሠ", + "x": "ሸ", + "y": "ሃ", + "z": "ጊ", + "A": "ል", + "B": "ጌ", + "C": "ር", + "D": "ዕ", + "E": "ቿ", + "F": "ቻ", + "G": "ኗ", + "H": "ዘ", + "I": "ጎ", + "J": "ጋ", + "K": "ጕ", + "L": "ረ", + "M": "ጠ", + "N": "ክ", + "O": "ዐ", + "P": "የ", + "Q": "ዒ", + "R": "ዪ", + "S": "ነ", + "T": "ፕ", + "U": "ሁ", + "V": "ሀ", + "W": "ሠ", + "X": "ሸ", + "Y": "ሃ", + "Z": "ጊ", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def strike(text): + style = { + "a": "a̶", + "b": "b̶", + "c": "c̶", + "d": "d̶", + "e": "e̶", + "f": "f̶", + "g": "g̶", + "h": "h̶", + "i": "i̶", + "j": "j̶", + "k": "k̶", + "l": "l̶", + "m": "m̶", + "n": "n̶", + "o": "o̶", + "p": "p̶", + "q": "q̶", + "r": "r̶", + "s": "s̶", + "t": "t̶", + "u": "u̶", + "v": "v̶", + "w": "w̶", + "x": "x̶", + "y": "y̶", + "z": "z̶", + "A": "A̶", + "B": "B̶", + "C": "C̶", + "D": "D̶", + "E": "E̶", + "F": "F̶", + "G": "G̶", + "H": "H̶", + "I": "I̶", + "J": "J̶", + "K": "K̶", + "L": "L̶", + "M": "M̶", + "N": "N̶", + "O": "O̶", + "P": "P̶", + "Q": "Q̶", + "R": "R̶", + "S": "S̶", + "T": "T̶", + "U": "U̶", + "V": "V̶", + "W": "W̶", + "X": "X̶", + "Y": "Y̶", + "Z": "Z̶", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + def frozen(text): + style = { + "a": "a༙", + "b": "b༙", + "c": "c༙", + "d": "d༙", + "e": "e༙", + "f": "f༙", + "g": "g༙", + "h": "h༙", + "i": "i༙", + "j": "j༙", + "k": "k༙", + "l": "l༙", + "m": "m༙", + "n": "n༙", + "o": "o༙", + "p": "p༙", + "q": "q༙", + "r": "r༙", + "s": "s༙", + "t": "t༙", + "u": "u༙", + "v": "v༙", + "w": "w༙", + "x": "x༙", + "y": "y༙", + "z": "z༙", + "A": "A༙", + "B": "B༙", + "C": "C༙", + "D": "D༙", + "E": "E༙", + "F": "F༙", + "G": "G༙", + "H": "H༙", + "I": "I༙", + "J": "J༙", + "K": "K༙", + "L": "L༙", + "M": "M༙", + "N": "N༙", + "O": "O༙", + "P": "P༙", + "Q": "Q༙", + "R": "R༙", + "S": "S༙", + "T": "T༙", + "U": "U༙", + "V": "V༙", + "W": "W༙", + "X": "X༙", + "Y": "Y༙", + "Z": "Z༙", + } + for i, j in style.items(): + text = text.replace(i, j) + return text + + +def gens_font(font, text): + if font == "typewriter": + get_font = Fonts.typewriter(text) + if font == "outline": + get_font = Fonts.outline(text) + if font == "serief": + get_font = Fonts.serief(text) + if font == "bold_cool": + get_font = Fonts.bold_cool(text) + if font == "cool": + get_font = Fonts.cool(text) + if font == "smallcap": + get_font = Fonts.smallcap(text) + if font == "script": + get_font = Fonts.script(text) + if font == "bold_script": + get_font = Fonts.bold_script(text) + if font == "tiny": + get_font = Fonts.tiny(text) + if font == "comic": + get_font = Fonts.comic(text) + if font == "san": + get_font = Fonts.san(text) + if font == "slant_san": + get_font = Fonts.slant_san(text) + if font == "slant": + get_font = Fonts.slant(text) + if font == "sim": + get_font = Fonts.sim(text) + if font == "circles": + get_font = Fonts.circles(text) + if font == "dark_circle": + get_font = Fonts.dark_circle(text) + if font == "gothic": + get_font = Fonts.gothic(text) + if font == "upside_down": + get_font = Fonts.upside_down(text) + if font == "bold_gothic": + get_font = Fonts.bold_gothic(text) + if font == "cloud": + get_font = Fonts.cloud(text) + if font == "happy": + get_font = Fonts.happy(text) + if font == "sad": + get_font = Fonts.sad(text) + if font == "special": + get_font = Fonts.special(text) + if font == "square": + get_font = Fonts.square(text) + if font == "dark_square": + get_font = Fonts.dark_square(text) + if font == "andalucia": + get_font = Fonts.andalucia(text) + if font == "manga": + get_font = Fonts.manga(text) + if font == "stinky": + get_font = Fonts.stinky(text) + if font == "bubbles": + get_font = Fonts.bubbles(text) + if font == "underline": + get_font = Fonts.underline(text) + if font == "ladybug": + get_font = Fonts.ladybug(text) + if font == "rays": + get_font = Fonts.rays(text) + if font == "birds": + get_font = Fonts.birds(text) + if font == "slash": + get_font = Fonts.slash(text) + if font == "stop": + get_font = Fonts.stop(text) + if font == "skyline": + get_font = Fonts.skyline(text) + if font == "arrows": + get_font = Fonts.arrows(text) + if font == "rvnes": + get_font = Fonts.rvnes(text) + if font == "strike": + get_font = Fonts.strike(text) + if font == "frozen": + get_font = Fonts.frozen(text) + return get_font + + +query_fonts = [ + { + "𝚃𝚢𝚙𝚎𝚠𝚛𝚒𝚝𝚎𝚛": "typewriter", + "𝕆𝕦𝕥𝕝𝕚𝕟𝕖": "outline", + "𝐒𝐞𝐫𝐢𝐟": "serief", + "𝑺𝒆𝒓𝒊𝒇": "bold_cool", + "𝑆𝑒𝑟𝑖𝑓": "cool", + "SᴍᴀʟʟCᴀᴘs": "smallcap", + "𝓈𝒸𝓇𝒾𝓅𝓉": "script", + "𝓼𝓬𝓻𝓲𝓹𝓽": "bold_script", + "ᵗⁱⁿʸ": "tiny", + "ᑕOᗰIᑕ": "comic", + "𝗦𝗮𝗻𝘀": "san", + "𝙎𝙖𝙣𝙨": "slant_san", + "𝘚𝘢𝘯𝘴": "slant", + "𝖲𝖺𝗇𝗌": "sim", + "Ⓒ︎Ⓘ︎Ⓡ︎Ⓒ︎Ⓛ︎Ⓔ︎Ⓢ︎": "circles", + "🅒︎🅘︎🅡︎🅒︎🅛︎🅔︎🅢︎": "dark_circle", + "𝔊𝔬𝔱𝔥𝔦𝔠": "gothic", + "𝕲𝖔𝖙𝖍𝖎𝖈": "bold_gothic", + "uʍop ǝpᴉsdn": "upside_down", + "C͜͡l͜͡o͜͡u͜͡d͜͡s͜͡": "cloud", + }, + { + "H̆̈ă̈p̆̈p̆̈y̆̈": "happy", + "S̑̈ȃ̈d̑̈": "sad", + "🇸 🇵 🇪 🇨 🇮 🇦 🇱": "special", + "🅂🅀🅄🄰🅁🄴🅂": "square", + "🆂︎🆀︎🆄︎🅰︎🆁︎🅴︎🆂︎": "dark_square", + "ꪖꪀᦔꪖꪶꪊᥴ𝓲ꪖ": "andalucia", + "爪卂几ᘜ卂": "manga", + "S̾t̾i̾n̾k̾y̾": "stinky", + "B̥ͦu̥ͦb̥ͦb̥ͦl̥ͦe̥ͦs̥ͦ": "bubbles", + "U͟n͟d͟e͟r͟l͟i͟n͟e͟": "underline", + "꒒ꍏꀷꌩꌃꀎꁅ": "ladybug", + "R҉a҉y҉s҉": "rays", + "B҈i҈r҈d҈s҈": "birds", + "S̸l̸a̸s̸h̸": "slash", + "s⃠t⃠o⃠p⃠": "stop", + "S̺͆k̺͆y̺͆l̺͆i̺͆n̺͆e̺͆": "skyline", + "A͎r͎r͎o͎w͎s͎": "arrows", + "ዪሀክቿነ": "rvnes", + "S̶t̶r̶i̶k̶e̶": "strike", + "F༙r༙o༙z༙e༙n༙": "frozen", + }, +] diff --git a/ubot/core/helpers/get_file_id.py b/ubot/core/helpers/get_file_id.py new file mode 100644 index 0000000000000000000000000000000000000000..d68a7ce8ad13016e519acb593929bcfb977ab8c2 --- /dev/null +++ b/ubot/core/helpers/get_file_id.py @@ -0,0 +1,87 @@ +def get_file_id(msg): + if msg.media: + for message_type in ( + "photo", + "animation", + "audio", + "document", + "video", + "video_note", + "voice", + "contact", + "dice", + "poll", + "location", + "venue", + "sticker", + ): + obj = getattr(msg, message_type) + if obj: + setattr(obj, "message_type", message_type) + return obj + + +def qr_gen(content): + return { + "data": content, + "config": { + "body": "circle-zebra", + "eye": "frame13", + "eyeBall": "ball14", + "erf1": [], + "erf2": [], + "erf3": [], + "brf1": [], + "brf2": [], + "brf3": [], + "bodyColor": "#000000", + "bgColor": "#FFFFFF", + "eye1Color": "#000000", + "eye2Color": "#000000", + "eye3Color": "#000000", + "eyeBall1Color": "#000000", + "eyeBall2Color": "#000000", + "eyeBall3Color": "#000000", + "gradientColor1": "", + "gradientColor2": "", + "gradientType": "linear", + "gradientOnEyes": "true", + "logo": "", + "logoMode": "default", + }, + "size": 1000, + "download": "imageUrl", + "file": "png", + } + + +lang_code_translate = { + "Afrikaans": "af", + "Arabic": "ar", + "Chinese": "zh-cn", + "Czech": "cs", + "German": "e", + "Greek": "el", + "English": "en", + "Spanish": "es", + "French": "fr", + "Hindi": "hi", + "Indonesian": "id", + "Icelandic": "is", + "Italian": "it", + "Japanese": "ja", + "Javanese": "jw", + "Korean": "ko", + "Latin": "la", + "Myanmar": "my", + "Nepali": "ne", + "Dutch": "nl", + "Portuguese": "pt", + "Russian": "ru", + "Sundanese": "su", + "Swedish": "sv", + "Thailand": "th", + "Filipino": "tl", + "Turkish": "tr", + "Vietname": "vi", +} diff --git a/ubot/core/helpers/http.py b/ubot/core/helpers/http.py new file mode 100644 index 0000000000000000000000000000000000000000..1a2df887ef82a4aed19a55d6922abc36fa86f066 --- /dev/null +++ b/ubot/core/helpers/http.py @@ -0,0 +1,59 @@ +from asyncio import gather + +import httpx + +from ubot import aiosession as session + +# HTTPx Async Client +http = httpx.AsyncClient( + http2=True, + verify=False, + timeout=httpx.Timeout(40), +) + + +async def get(url: str, *args, **kwargs): + async with session.get(url, *args, **kwargs) as resp: + try: + data = await resp.json() + except Exception: + data = await resp.text() + return data + + +async def head(url: str, *args, **kwargs): + async with session.head(url, *args, **kwargs) as resp: + try: + data = await resp.json() + except Exception: + data = await resp.text() + return data + + +async def post(url: str, *args, **kwargs): + async with session.post(url, *args, **kwargs) as resp: + try: + data = await resp.json() + except Exception: + data = await resp.text() + return data + + +async def multiget(url: str, times: int, *args, **kwargs): + return await gather(*[get(url, *args, **kwargs) for _ in range(times)]) + + +async def multihead(url: str, times: int, *args, **kwargs): + return await gather(*[head(url, *args, **kwargs) for _ in range(times)]) + + +async def multipost(url: str, times: int, *args, **kwargs): + return await gather(*[post(url, *args, **kwargs) for _ in range(times)]) + + +async def resp_get(url: str, *args, **kwargs): + return await session.get(url, *args, **kwargs) + + +async def resp_post(url: str, *args, **kwargs): + return await session.post(url, *args, **kwargs) diff --git a/ubot/core/helpers/inline.py b/ubot/core/helpers/inline.py new file mode 100644 index 0000000000000000000000000000000000000000..f89568638b05f43a4a7ef188df2d599319811901 --- /dev/null +++ b/ubot/core/helpers/inline.py @@ -0,0 +1,284 @@ +import re + +from pykeyboard import InlineKeyboard +from pyrogram.errors import MessageNotModified +from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle, + InputTextMessageContent) + +from ubot import * + + +class Button: + def alive(get_id): + button = [ + [ + InlineKeyboardButton( + text="Close", + callback_data=f"alv_cls {int(get_id[1])} {int(get_id[2])}", + ) + ] + ] + return button + + def button_add_expired(user_id): + buttons = InlineKeyboard(row_width=3) + keyboard = [] + for X in range(1, 13): + keyboard.append( + InlineKeyboardButton( + f"{X} Month", + callback_data=f"success {user_id} {X}", + ) + ) + buttons.add(*keyboard) + buttons.row( + InlineKeyboardButton("Account Link", callback_data=f"profil {user_id}") + ) + buttons.row( + InlineKeyboardButton("Reject Payment", callback_data=f"failed {user_id}") + ) + return buttons + + def deak(user_id, count): + button = [ + [ + InlineKeyboardButton( + "Return ", + callback_data=f"prev_ub {int(count)}", + ), + InlineKeyboardButton( + "Approve", callback_data=f"deak_akun {int(count)}" + ), + ], + ] + return button + + def expired_button_bot(): + button = [ + [ + InlineKeyboardButton( + text=f"{bot.me.first_name}", + url=f"https://t.me/{bot.me.username}", + ) + ] + ] + return button + + def start(message): + if message.from_user.id not in USER_ID: + button = [ + [InlineKeyboardButton("Create a Userbot", callback_data="bahan")], + [ + InlineKeyboardButton("Tutorial", callback_data="cb_tutor"), + InlineKeyboardButton( + "Account Status", callback_data="start_profile" + ), + ], + ] + else: + button = [ + [InlineKeyboardButton("Create a Userbot", callback_data="bahan")], + [ + InlineKeyboardButton("Updates", callback_data="gitpull"), + InlineKeyboardButton("Restart", callback_data="restart"), + ], + [ + InlineKeyboardButton("User Check", callback_data="cek_ubot"), + InlineKeyboardButton("Hosting", callback_data="host"), + ], + ] + return button + + def plus_minus(query, user_id): + button = [ + [ + InlineKeyboardButton( + "-1", + callback_data=f"kurang {query}", + ), + InlineKeyboardButton( + "+1", + callback_data=f"tambah {query}", + ), + ], + [InlineKeyboardButton("Confirmation", callback_data="confirm")], + [InlineKeyboardButton("Cancel", callback_data=f"home {user_id}")], + ] + return button + + def userbot(user_id, count): + button = [ + [ + InlineKeyboardButton( + "Delete From Database", + callback_data=f"del_ubot {int(user_id)}", + ) + ], + [ + InlineKeyboardButton( + "Check Number", + callback_data=f"get_phone {int(count)}", + ) + ], + [ + InlineKeyboardButton( + "Check Expiry", + callback_data=f"cek_masa_aktif {int(user_id)}", + ) + ], + [ + InlineKeyboardButton( + "Check OTP", + callback_data=f"get_otp {int(count)}", + ) + ], + [ + InlineKeyboardButton( + "Check 2L Verification", + callback_data=f"get_faktor {int(count)}", + ) + ], + [InlineKeyboardButton("Destroyed", callback_data=f"ub_deak {int(count)}")], + [ + InlineKeyboardButton("❮", callback_data=f"prev_ub {int(count)}"), + InlineKeyboardButton("❯", callback_data=f"next_ub {int(count)}"), + ], + [ + InlineKeyboardButton("Tutup", callback_data=f"0_cls"), + ], + ] + return button + + def ambil_akun(user_id, count): + button = [ + [ + InlineKeyboardButton( + "Delete From Database", + callback_data=f"del_ubot {int(user_id)}", + ) + ], + [ + InlineKeyboardButton( + "Check Number", + callback_data=f"get_phone {int(count)}", + ) + ], + [ + InlineKeyboardButton( + "Check Expiry", + callback_data=f"cek_masa_aktif {int(user_id)}", + ) + ], + [ + InlineKeyboardButton( + "Check OTP", + callback_data=f"get_otp {int(count)}", + ) + ], + [ + InlineKeyboardButton( + "Check 2L Verification", + callback_data=f"get_faktor {int(count)}", + ) + ], + [InlineKeyboardButton("Destroyed", callback_data=f"ub_deak {int(count)}")], + [ + InlineKeyboardButton("❮", callback_data=f"prev_ub {int(count)}"), + InlineKeyboardButton("❯", callback_data=f"next_ub {int(count)}"), + ], + ] + return button + + +class INLINE: + def QUERY(func): + async def wrapper(client, inline_query): + users = ubot._get_my_id + if inline_query.from_user.id not in users: + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title=f"Anda Belum Melakukan Pembelian @{bot.me.username}", + input_message_content=InputTextMessageContent( + f"Kamu Bisa Melakukan Pembelian @{bot.me.username} Agar Bisa Menggunakan" + ), + ) + ) + ], + ) + else: + await func(client, inline_query) + + return wrapper + + def DATA(func): + async def wrapper(client, callback_query): + users = ubot._get_my_id + if callback_query.from_user.id not in users: + await callback_query.answer( + f"Silakan Order Bot @{bot.me.username} Agar Bisa Menggunakan Bot Ini", + True, + ) + else: + try: + await func(client, callback_query) + except MessageNotModified: + await callback_query.answer("❌ ERROR") + + return wrapper + + +async def create_button(m): + buttons = InlineKeyboard(row_width=1) + keyboard = [] + msg = [] + if "~" not in m.text.split(None, 1)[1]: + for X in m.text.split(None, 1)[1].split(): + X_parts = X.split("|", 1) + keyboard.append( + InlineKeyboardButton(X_parts[0].replace("_", " "), url=X_parts[1]) + ) + msg.append(X_parts[0]) + buttons.add(*keyboard) + if m.reply_to_message: + text = m.reply_to_message.text + else: + text = " ".join(msg) + else: + for X in m.text.split("~", 1)[1].split(): + X_parts = X.split("|", 1) + keyboard.append( + InlineKeyboardButton(X_parts[0].replace("_", " "), url=X_parts[1]) + ) + buttons.add(*keyboard) + text = m.text.split("~", 1)[0].split(None, 1)[1] + + return buttons, text + + +async def gcast_create_button(m): + buttons = InlineKeyboard(row_width=2) + keyboard = [] + split_text = m.text.split("~", 1) + for X in split_text[1].split(): + button_data = X.split("|", 1) + button_label = button_data[0].replace("_", " ") + button_url = button_data[1] + keyboard.append(InlineKeyboardButton(button_label, url=button_url)) + buttons.add(*keyboard) + text_button = split_text[0].split(None, 1)[1] + return buttons, text_button + + +async def notes_create_button(text): + buttons = InlineKeyboard(row_width=2) + keyboard = [] + for button_text in re.findall(r"\[(.*?)\]", text): + button_label, button_url = button_text.split("|") + keyboard.append(InlineKeyboardButton(button_label, url=button_url)) + buttons.add(*keyboard) + text_button = re.sub(r"\[(.*?)\]", "", text) + return buttons, text_button diff --git a/ubot/core/helpers/kang_tool.py b/ubot/core/helpers/kang_tool.py new file mode 100644 index 0000000000000000000000000000000000000000..2551f0d76d97e37c8703204f4c1dfe4777aa30a8 --- /dev/null +++ b/ubot/core/helpers/kang_tool.py @@ -0,0 +1,110 @@ +import math +import os +from io import BytesIO + +from PIL import Image +from pyrogram import errors, raw +from pyrogram.file_id import FileId + +STICKER_DIMENSIONS = (512, 512) + + +async def resize_file_to_sticker_size(file_path): + im = Image.open(file_path) + if (im.width, im.height) < STICKER_DIMENSIONS: + size1 = im.width + size2 = im.height + if im.width > im.height: + scale = STICKER_DIMENSIONS[0] / size1 + size1new = STICKER_DIMENSIONS[0] + size2new = size2 * scale + else: + scale = STICKER_DIMENSIONS[1] / size2 + size1new = size1 * scale + size2new = STICKER_DIMENSIONS[1] + size1new = math.floor(size1new) + size2new = math.floor(size2new) + sizenew = (size1new, size2new) + im = im.resize(sizenew) + else: + im.thumbnail(STICKER_DIMENSIONS) + try: + temp_file = BytesIO() + im.save(temp_file, "PNG") + temp_file.seek(0) + file_path = f"{file_path}.png" + with open(file_path, "wb") as f: + f.write(temp_file.read()) + return file_path + finally: + im.close() + + +async def upload_document(client, file_path, chat_id): + media = await client.invoke( + raw.functions.messages.UploadMedia( + peer=await client.resolve_peer(chat_id), + media=raw.types.InputMediaUploadedDocument( + mime_type=client.guess_mime_type(file_path) or "application/zip", + file=await client.save_file(file_path), + attributes=[ + raw.types.DocumentAttributeFilename( + file_name=os.path.basename(file_path) + ) + ], + ), + ) + ) + return raw.types.InputDocument( + id=media.document.id, + access_hash=media.document.access_hash, + file_reference=media.document.file_reference, + ) + + +async def get_document_from_file_id(file_id): + decoded = FileId.decode(file_id) + return raw.types.InputDocument( + id=decoded.media_id, + access_hash=decoded.access_hash, + file_reference=decoded.file_reference, + ) + + +async def get_sticker_set_by_name(client, name): + try: + response = await client.invoke( + raw.functions.messages.GetStickerSet( + stickerset=raw.types.InputStickerSetShortName(short_name=name), + hash=0, + ) + ) + return response + except errors.exceptions.bad_request_400.StickersetInvalid: + return None + + +async def create_sticker_set(client, owner, title, short_name, stickers): + return await client.invoke( + raw.functions.stickers.CreateStickerSet( + user_id=await client.resolve_peer(owner), + title=title, + short_name=short_name, + stickers=stickers, + ) + ) + + +async def add_sticker_to_set(client, stickerset, sticker): + return await client.invoke( + raw.functions.stickers.AddStickerToSet( + stickerset=raw.types.InputStickerSetShortName( + short_name=stickerset.set.short_name + ), + sticker=sticker, + ) + ) + + +async def create_sticker(sticker, emoji): + return raw.types.InputStickerSetItem(document=sticker, emoji=emoji) diff --git a/ubot/core/helpers/misc.py b/ubot/core/helpers/misc.py new file mode 100644 index 0000000000000000000000000000000000000000..f9805d9c9b6ec3af20212169907d790fc1955747 --- /dev/null +++ b/ubot/core/helpers/misc.py @@ -0,0 +1,211 @@ +import asyncio +import string +from math import ceil +from time import time + +import wget +from pyrogram import enums +from pyrogram.types import InlineKeyboardButton + +font = { + "sᴍᴀʟʟᴄᴀᴘs": "ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘϙʀsᴛᴜᴠᴡxʏᴢABCDEFGHIJKLMNOPQRSTUVWXYZ", + "𝚃𝚈𝙿𝙴𝚆𝚁𝙸𝚃𝙴𝚁": "𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚠𝚡𝚢𝚣𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉", + "𝕆𝕌𝕋𝕃𝕀ℕ𝔼": "𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ", + "𝒟ℰℛℐℋℒ": "𝒶𝒷𝒸𝒹𝑒𝒻𝑔𝒽𝒾𝒿𝓀𝓁𝓂𝓃𝑜𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵", + "Ⓥ︎Ⓘ︎Ⓡ︎Ⓒ︎Ⓛ︎Ⓔ︎Ⓢ︎": "ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ", + "𝗦𝗔𝗡𝗦": "𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭", + "ᵗⁱⁿʸ": "ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ", + "𝐒𝐄𝐑𝐈𝐅": "𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙", +} +basic = string.ascii_letters + + +def gen_font(text, new_font): + new_font = " ".join(new_font).split() + for q in text: + if q in basic: + new = new_font[basic.index(q)] + text = text.replace(q, new) + return text + + +async def extract_userid(message, text): + def is_int(text): + try: + int(text) + except ValueError: + return False + return True + + text = text.strip() + + if is_int(text): + return int(text) + + entities = message.entities + app = message._client + entity = entities[1 if message.text.startswith("/") else 0] + if entity.type == enums.MessageEntityType.MENTION: + return (await app.get_users(text)).id + if entity.type == enums.MessageEntityType.TEXT_MENTION: + return entity.user.id + return None + + +async def extract_user_and_reason(message, sender_chat=False): + args = message.text.strip().split() + text = message.text + user = None + reason = None + if message.reply_to_message: + reply = message.reply_to_message + if not reply.from_user: + if ( + reply.sender_chat + and reply.sender_chat != message.chat.id + and sender_chat + ): + id_ = reply.sender_chat.id + else: + return None, None + else: + id_ = reply.from_user.id + + if len(args) < 2: + reason = None + else: + reason = text.split(None, 1)[1] + return id_, reason + + if len(args) == 2: + user = text.split(None, 1)[1] + return await extract_userid(message, user), None + + if len(args) > 2: + user, reason = text.split(None, 2)[1:] + return await extract_userid(message, user), reason + + return user, reason + + +async def extract_user(message): + return (await extract_user_and_reason(message))[0] + + +admins_in_chat = {} + + +async def list_admins(message): + global admins_in_chat + if message.chat.id in admins_in_chat: + interval = time() - admins_in_chat[message.chat.id]["last_updated_at"] + if interval < 3600: + return admins_in_chat[message.chat.id]["data"] + + admins_in_chat[message.chat.id] = { + "last_updated_at": time(), + "data": [ + member.user.id + async for member in message._client.get_chat_members( + message.chat.id, filter=enums.ChatMembersFilter.ADMINISTRATORS + ) + ], + } + return admins_in_chat[message.chat.id]["data"] + + +class EqInlineKeyboardButton(InlineKeyboardButton): + def __eq__(self, other): + return self.text == other.text + + def __lt__(self, other): + return self.text < other.text + + def __gt__(self, other): + return self.text > other.text + + +def paginate_modules(page_n, module_dict, prefix, chat=None): + if not chat: + modules = sorted( + [ + EqInlineKeyboardButton( + x.__MODULE__, + callback_data="{}_module({})".format( + prefix, x.__MODULE__.replace(" ", "_").lower() + ), + ) + for x in module_dict.values() + ] + ) + else: + modules = sorted( + [ + EqInlineKeyboardButton( + x.__MODULE__, + callback_data="{}_module({},{})".format( + prefix, chat, x.__MODULE__.replace(" ", "_").lower() + ), + ) + for x in module_dict.values() + ] + ) + line = 3 + pairs = list(zip(modules[::2], modules[1::2])) + i = 0 + for m in pairs: + for _ in m: + i += 1 + if len(modules) - i == 1: + pairs.append((modules[-1],)) + elif len(modules) - i == 2: + pairs.append( + ( + modules[-2], + modules[-1], + ) + ) + + max_num_pages = ceil(len(pairs) / line) + modulo_page = page_n % max_num_pages + + if len(pairs) > line: + pairs = pairs[modulo_page * line : line * (modulo_page + 1)] + [ + ( + EqInlineKeyboardButton( + "❮", + callback_data="{}_prev({})".format(prefix, modulo_page), + ), + EqInlineKeyboardButton( + "❯", + callback_data="{}_next({})".format(prefix, modulo_page), + ), + ) + ] + + return pairs + + +async def create_botlog(client): + name = "Userbot Logs" + desc = "\n\nPowered by: @dragbackup" + group = await client.create_supergroup(name, desc) + # nt = "/assets/logo.jpg" + nt = wget.download("https://graph.org/file/8f69f37f050d35af11dac.jpg") + photo_video = {"video": nt} if nt.endswith(".mp4") else {"photo": nt} + kntl = group.id + await asyncio.sleep(1) + await client.set_chat_photo(kntl, **photo_video) + await asyncio.sleep(1) + await client.send_message( + kntl, + f"**Group Log Successfully Created\n\nGet out of here, I'm using black magic on you!!!**", + ) + + +async def get_log(client): + name = "Userbot Logs" + async for dialog in client.get_dialogs(limit=None): + if dialog.chat.title == name: + return dialog.chat + return None diff --git a/ubot/core/helpers/msg_type.py b/ubot/core/helpers/msg_type.py new file mode 100644 index 0000000000000000000000000000000000000000..00389110d71cf40106a53e93af3a9d7c05d83532 --- /dev/null +++ b/ubot/core/helpers/msg_type.py @@ -0,0 +1,239 @@ +from enum import IntEnum, unique + + +@unique +class Types(IntEnum): + TEXT = 1 + DOCUMENT = 2 + PHOTO = 3 + VIDEO = 4 + STICKER = 5 + AUDIO = 6 + VOICE = 7 + VIDEO_NOTE = 8 + ANIMATION = 9 + ANIMATED_STICKER = 10 + CONTACT = 11 + + +def get_message_type(msg): + if msg.text or msg.caption: + content = None + message_type = Types.TEXT + elif msg.sticker: + content = msg.sticker.file_id + message_type = Types.STICKER + + elif msg.document: + if msg.document.mime_type == "application/x-bad-tgsticker": + message_type = Types.ANIMATED_STICKER + else: + message_type = Types.DOCUMENT + content = msg.document.file_id + + elif msg.photo: + content = msg.photo.file_id # last elem = best quality + message_type = Types.PHOTO + + elif msg.audio: + content = msg.audio.file_id + message_type = Types.AUDIO + + elif msg.voice: + content = msg.voice.file_id + message_type = Types.VOICE + + elif msg.video: + content = msg.video.file_id + message_type = Types.VIDEO + + elif msg.video_note: + content = msg.video_note.file_id + message_type = Types.VIDEO_NOTE + + elif msg.animation: + content = msg.animation.file_id + message_type = Types.ANIMATION + + # TODO + # elif msg.contact: + # content = msg.contact.phone_number + # # text = None + # message_type = Types.CONTACT + + # TODO + # elif msg.animated_sticker: + # content = msg.animation.file_id + # text = None + # message_type = Types.ANIMATED_STICKER + + else: + return None, None + + return content, message_type + + +def get_note_type(msg): + if len(msg.text.split()) <= 1: + return None, None, None, None + data_type = None + content = None + if msg.text: + raw_text = msg.text.markdown + else: + raw_text = msg.caption.markdown + args = raw_text.split(None, 2) # use python's maxsplit to separate cmd and args + note_name = args[1] + + # determine what the contents of the filter are - text, image, sticker, etc + if len(args) >= 3: + text = args[2] + data_type = Types.TEXT + + elif msg.reply_to_message: + if msg.reply_to_message.text: + text = msg.reply_to_message.text.markdown + elif msg.reply_to_message.caption: + text = msg.reply_to_message.caption.markdown + else: + text = "" + if len(args) >= 2 and msg.reply_to_message.text: # not caption, text + data_type = Types.TEXT + + elif msg.reply_to_message.sticker: + content = msg.reply_to_message.sticker.file_id + data_type = Types.STICKER + + elif msg.reply_to_message.document: + if msg.reply_to_message.document.mime_type == "application/x-bad-tgsticker": + data_type = Types.ANIMATED_STICKER + else: + data_type = Types.DOCUMENT + content = msg.reply_to_message.document.file_id + + elif msg.reply_to_message.photo: + content = msg.reply_to_message.photo.file_id # last elem = best quality + data_type = Types.PHOTO + + elif msg.reply_to_message.audio: + content = msg.reply_to_message.audio.file_id + data_type = Types.AUDIO + + elif msg.reply_to_message.voice: + content = msg.reply_to_message.voice.file_id + data_type = Types.VOICE + + elif msg.reply_to_message.video: + content = msg.reply_to_message.video.file_id + data_type = Types.VIDEO + + elif msg.reply_to_message.video_note: + content = msg.reply_to_message.video_note.file_id + data_type = Types.VIDEO_NOTE + + elif msg.reply_to_message.animation: + content = msg.reply_to_message.animation.file_id + # text = None + data_type = Types.ANIMATION + + # TODO + # elif msg.reply_to_message.contact: + # content = msg.reply_to_message.contact.phone_number + # # text = None + # data_type = Types.CONTACT + + # TODO + # elif msg.reply_to_message.animated_sticker: + # content = msg.reply_to_message.animation.file_id + # text = None + # data_type = Types.ANIMATED_STICKER + + else: + return None, None, None, None + + return note_name, text, data_type, content + + +def get_welcome_type(msg): + data_type = None + content = None + + if msg.reply_to_message: + if msg.reply_to_message.text: + text = msg.reply_to_message.text.markdown + elif msg.reply_to_message.caption: + text = msg.reply_to_message.caption.markdown + else: + text = None + else: + text = msg.text.split(None, 1) + + if msg.reply_to_message: + if msg.reply_to_message.text: + text = msg.reply_to_message.text.markdown + data_type = Types.TEXT + + elif msg.reply_to_message.sticker: + if msg.reply_to_message.document.mime_type == "application/x-tgsticker": + data_type = Types.ANIMATED_STICKER + else: + data_type = Types.STICKER + content = msg.reply_to_message.sticker.file_id + text = None + + elif msg.reply_to_message.document: + if msg.reply_to_message.document.mime_type == "application/x-bad-tgsticker": + data_type = Types.ANIMATED_STICKER + else: + data_type = Types.DOCUMENT + content = msg.reply_to_message.document.file_id + # text = msg.reply_to_message.caption + + elif msg.reply_to_message.photo: + content = msg.reply_to_message.photo[-1].file_id # last elem = best quality + # text = msg.reply_to_message.caption + data_type = Types.PHOTO + + elif msg.reply_to_message.audio: + content = msg.reply_to_message.audio.file_id + # text = msg.reply_to_message.caption + data_type = Types.AUDIO + + elif msg.reply_to_message.voice: + content = msg.reply_to_message.voice.file_id + text = None + data_type = Types.VOICE + + elif msg.reply_to_message.video: + content = msg.reply_to_message.video.file_id + # text = msg.reply_to_message.caption + data_type = Types.VIDEO + + elif msg.reply_to_message.video_note: + content = msg.reply_to_message.video_note.file_id + text = None + data_type = Types.VIDEO_NOTE + + elif msg.reply_to_message.animation: + content = msg.reply_to_message.animation.file_id + # text = None + data_type = Types.ANIMATION + + # TODO + # elif msg.reply_to_message.animated_sticker: + # content = msg.reply_to_message.animation.file_id + # text = None + # data_type = Types.ANIMATED_STICKER + + else: + if msg.caption: + text = msg.caption.split(None, 1) + if len(text) >= 2: + text = msg.caption.markdown.split(None, 1)[1] + elif msg.text: + text = msg.text.split(None, 1) + if len(text) >= 2: + text = msg.text.markdown.split(None, 1)[1] + data_type = Types.TEXT + + return text, data_type, content diff --git a/ubot/core/helpers/openAi.py b/ubot/core/helpers/openAi.py new file mode 100644 index 0000000000000000000000000000000000000000..f2837115cb2b69ff9734c5f3875808bf82274134 --- /dev/null +++ b/ubot/core/helpers/openAi.py @@ -0,0 +1,36 @@ +import asyncio +import random + +import openai + +from ubot import OPENAI_KEY + +openai.api_key = random.choice(OPENAI_KEY) + + +class OpenAi: + @staticmethod + async def ChatGPT(question): + response = await asyncio.to_thread( + openai.ChatCompletion.create, + model="gpt-3.5-turbo", + messages=[{"role": "user", "content": question}], + ) + return response.choices[0].message["content"].strip() + + @staticmethod + async def ImageDalle(question): + response = await asyncio.to_thread( + openai.Image.create, + prompt=question, + n=1, + ) + return response["data"][0]["url"] + + @staticmethod + async def SpeechToText(file): + audio_file = open(file, "rb") + response = await asyncio.to_thread( + openai.Audio.transcribe, "whisper-1", audio_file + ) + return response["text"] diff --git a/ubot/core/helpers/section.py b/ubot/core/helpers/section.py new file mode 100644 index 0000000000000000000000000000000000000000..6f43fd7e40adbc56120192db414c2f8b1ec7a298 --- /dev/null +++ b/ubot/core/helpers/section.py @@ -0,0 +1,30 @@ +""" +MIT License +Copyright (c) 2023 Kynan | TheHamkerCat + +""" + +n = "\n" +w = " " + +bold = lambda x: f"**{x}:** " +bold_ul = lambda x: f"**--{x}:**-- " + +mono = lambda x: f"`{x}`{n}" + + +def section( + title: str, + body: dict, + indent: int = 2, + underline: bool = False, +) -> str: + text = (bold_ul(title) + n) if underline else bold(title) + n + + for key, value in body.items(): + text += ( + indent * w + + bold(key) + + ((value[0] + n) if isinstance(value, list) else mono(value)) + ) + return text diff --git a/ubot/core/helpers/text.py b/ubot/core/helpers/text.py new file mode 100644 index 0000000000000000000000000000000000000000..f86885c35173dcd05691e62da138b14f27bc2967 --- /dev/null +++ b/ubot/core/helpers/text.py @@ -0,0 +1,93 @@ +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup + +from ubot import * + + +class MSG: + def EXPIRED_MSG_BOT(X): + return f""" +❏ Announcement +├ Account : {X.me.first_name} {X.me.last_name or ''} +├ ID: {X.me.id} +╰ Active Time Expired +""" + + def START(message): + if not message.from_user.id == USER_ID: + msg = f""" +👋 Hello {message.from_user.first_name} !! Is there anything I can help ? + +If you have already made a payment, please click the Create Userbot button. +""" + else: + msg = f""" +🧑‍💻 Developer {message.from_user.first_name} {message.from_user.last_name or ''} + +✅ Use Wisely !!! +""" + return msg + + def TEXT_PAYMENT(harga, total, bulan): + return f""" +Please Make Payment First + +Monthly Price: {harga}.000 + +💳 Payment method: + ├──• Gpay + ├─• send something + + +🔖 Total price: Rp {total}.000 +🗓️ Total Month: {bulan} + +✅ Click the button below to send proof of payment +""" + + async def USERBOT(count): + expired_date = await get_expired_date(ubot._ubot[int(count)].me.id) + return f""" +❏ Userbot To {int(count) + 1}/{len(ubot._ubot)} + ├ Account: {ubot._ubot[int(count)].me.first_name} {ubot._ubot[int(count)].me.last_name or ''} + ├ ID: {ubot._ubot[int(count)].me.id} + ╰ Expired {expired_date.strftime('%d-%m-%Y')} +""" + + def POLICY(): + return """ +↪️ Return Policy + +After making payment, if you have not received/ +receive benefits from the purchase, +You can exercise your right to replacement within 2 days of purchase. However, if +You have used/received one of the benefits of +purchase, including access to userbot creation features, then +You are no longer entitled to a refund. + +🆘 Support +To get support, you can: +• Contact the admin below +• Support @dragbackup on Telegram +⚠️ DO NOT contact Telegram Support or Bot Support to request te support +👉🏻 Press the Continue button to confirm that you have +read and accept these terms and continue +purchase. If not, press the Cancel button. +""" + + +async def sending_user(user_id): + await bot.send_message( + user_id, + "Please Re-Create Your Userbot", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + "Create a Userbot", + callback_data="bahan", + ) + ], + ] + ), + disable_web_page_preview=True, + ) diff --git a/ubot/core/helpers/tools.py b/ubot/core/helpers/tools.py new file mode 100644 index 0000000000000000000000000000000000000000..4914bbdd45c97992c1f9564031fefa7dc403060a --- /dev/null +++ b/ubot/core/helpers/tools.py @@ -0,0 +1,259 @@ +import asyncio +import multiprocessing +import os +import shlex +import textwrap +from concurrent.futures import ThreadPoolExecutor +from io import * + +from PIL import Image, ImageDraw, ImageFont +from pymediainfo import MediaInfo + +max_workers = multiprocessing.cpu_count() * 5 +exc_ = ThreadPoolExecutor(max_workers=max_workers) + + +class Media_Info: + def data(media): + found = False + media_info = MediaInfo.parse(media) + for track in media_info.tracks: + if track.track_type == "Video": + found = True + type_ = track.track_type + format_ = track.format + duration_1 = track.duration + other_duration_ = track.other_duration + duration_2 = ( + f"{other_duration_[0]} - ({other_duration_[3]})" + if other_duration_ + else None + ) + pixel_ratio_ = [track.width, track.height] + aspect_ratio_1 = track.display_aspect_ratio + other_aspect_ratio_ = track.other_display_aspect_ratio + aspect_ratio_2 = other_aspect_ratio_[0] if other_aspect_ratio_ else None + fps_ = track.frame_rate + fc_ = track.frame_count + media_size_1 = track.stream_size + other_media_size_ = track.other_stream_size + media_size_2 = ( + [ + other_media_size_[1], + other_media_size_[2], + other_media_size_[3], + other_media_size_[4], + ] + if other_media_size_ + else None + ) + + dict_ = ( + { + "media_type": type_, + "format": format_, + "duration_in_ms": duration_1, + "duration": duration_2, + "pixel_sizes": pixel_ratio_, + "aspect_ratio_in_fraction": aspect_ratio_1, + "aspect_ratio": aspect_ratio_2, + "frame_rate": fps_, + "frame_count": fc_, + "file_size_in_bytes": media_size_1, + "file_size": media_size_2, + } + if found + else None + ) + return dict_ + + +def get_arg(message): + if message.reply_to_message and len(message.command) < 2: + msg = message.reply_to_message.text or message.reply_to_message.caption + if not msg: + return "" + msg = msg.encode().decode("UTF-8") + msg = msg.replace(" ", "", 1) if msg[1] == " " else msg + return msg + elif len(message.command) > 1: + return " ".join(message.command[1:]) + else: + return "" + + +def get_text(message): + if message.reply_to_message: + if len(message.command) < 2: + text = message.reply_to_message.text or message.reply_to_message.caption + else: + text = ( + (message.reply_to_message.text or message.reply_to_message.caption) + + "\n\n" + + message.text.split(None, 1)[1] + ) + else: + if len(message.command) < 2: + text = "" + else: + text = message.text.split(None, 1)[1] + return text + + +async def resize_media(media, video, fast_forward): + if video: + info_ = Media_Info.data(media) + width = info_["pixel_sizes"][0] + height = info_["pixel_sizes"][1] + sec = info_["duration_in_ms"] + s = round(float(sec)) / 1000 + + if height == width: + height, width = 512, 512 + elif height > width: + height, width = 512, -1 + elif width > height: + height, width = -1, 512 + + resized_video = f"{media}.webm" + if fast_forward: + if s > 3: + fract_ = 3 / s + ff_f = round(fract_, 2) + set_pts_ = ff_f - 0.01 if ff_f > fract_ else ff_f + cmd_f = f"-filter:v 'setpts={set_pts_}*PTS',scale={width}:{height}" + else: + cmd_f = f"-filter:v scale={width}:{height}" + else: + cmd_f = f"-filter:v scale={width}:{height}" + fps_ = float(info_["frame_rate"]) + fps_cmd = "-r 30 " if fps_ > 30 else "" + cmd = f"ffmpeg -i {media} {cmd_f} -ss 00:00:00 -to 00:00:03 -an -c:v libvpx-vp9 {fps_cmd}-fs 256K {resized_video}" + _, error, __, ___ = await run_cmd(cmd) + os.remove(media) + return resized_video + + image = Image.open(media) + maxsize = 512 + scale = maxsize / max(image.width, image.height) + new_size = (int(image.width * scale), int(image.height * scale)) + + image = image.resize(new_size, Image.LANCZOS) + resized_photo = "sticker.png" + image.save(resized_photo) + os.remove(media) + return resized_photo + + +async def add_text_img(image_path, text): + font_size = 12 + stroke_width = 1 + + if ";" in text: + upper_text, lower_text = text.split(";") + else: + upper_text = text + lower_text = "" + + img = Image.open(image_path).convert("RGBA") + img_info = img.info + image_width, image_height = img.size + font = ImageFont.truetype( + font="storage/default.ttf", + size=int(image_height * font_size) // 100, + ) + draw = ImageDraw.Draw(img) + + char_width, char_height = font.getsize("A") + chars_per_line = image_width // char_width + top_lines = textwrap.wrap(upper_text, width=chars_per_line) + bottom_lines = textwrap.wrap(lower_text, width=chars_per_line) + + if top_lines: + y = 10 + for line in top_lines: + line_width, line_height = font.getsize(line) + x = (image_width - line_width) / 2 + draw.text( + (x, y), + line, + fill="white", + font=font, + stroke_width=stroke_width, + stroke_fill="black", + ) + y += line_height + + if bottom_lines: + y = image_height - char_height * len(bottom_lines) - 15 + for line in bottom_lines: + line_width, line_height = font.getsize(line) + x = (image_width - line_width) / 2 + draw.text( + (x, y), + line, + fill="white", + font=font, + stroke_width=stroke_width, + stroke_fill="black", + ) + y += line_height + + final_image = os.path.join("memify.webp") + img.save(final_image, **img_info) + return final_image + + +async def aexec(code, user, message): + exec( + "async def __aexec(user, message): " + + "".join(f"\n {l_}" for l_ in code.split("\n")) + ) + return await locals()["__aexec"](user, message) + + +async def bash(cmd): + process = await asyncio.create_subprocess_shell( + cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + stdout, stderr = await process.communicate() + err = stderr.decode().strip() + out = stdout.decode().strip() + return out, err + + +async def run_cmd(cmd): + args = shlex.split(cmd) + process = await asyncio.create_subprocess_exec( + *args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE + ) + stdout, stderr = await process.communicate() + return ( + stdout.decode("utf-8", "replace").strip(), + stderr.decode("utf-8", "replace").strip(), + process.returncode, + process.pid, + ) + + +async def dl_pic(client, download): + path = await client.download_media(download) + with open(path, "rb") as f: + content = f.read() + os.remove(path) + get_photo = BytesIO(content) + return get_photo + + +async def edit_or_reply(message, text): + msg = ( + message.edit_text + if bool(message.from_user and message.from_user.is_self or message.outgoing) + else (message.reply_to_message or message).reply_text + ) + return await msg(text) + + +eor = edit_or_reply diff --git a/ubot/core/helpers/unpack.py b/ubot/core/helpers/unpack.py new file mode 100644 index 0000000000000000000000000000000000000000..33d7dff15c9f6380f115cb38f010b06accd91a1b --- /dev/null +++ b/ubot/core/helpers/unpack.py @@ -0,0 +1,21 @@ +from base64 import urlsafe_b64decode +from struct import unpack + +from attrify import Attrify as Atr + + +def unpackInlineMessage(inline_message_id: str): + dc_id, message_id, chat_id, query_id = unpack( + " MAX_BOT: + buttons = [ + [InlineKeyboardButton("close", callback_data="0_cls")], + ] + await callback_query.message.delete() + return await bot.send_message( + user_id, + f""" +❌ Not Creating Userbot ! + +📚 Because It Has Reached What Has Been Determined : {len(ubot._ubot)} + +👮‍♂ please contact admins . +""", + disable_web_page_preview=True, + reply_markup=InlineKeyboardMarkup(buttons), + ) + if user_id not in await get_prem(): + buttons = [ + [InlineKeyboardButton("➡️ Continue", callback_data="bayar_dulu")], + [InlineKeyboardButton("❌ Cancel", callback_data=f"home {user_id}")], + ] + await callback_query.message.delete() + return await bot.send_message( + user_id, + MSG.POLICY(), + disable_web_page_preview=True, + reply_markup=InlineKeyboardMarkup(buttons), + ) + else: + await bikin_ubot(client, callback_query) + + +async def payment_userbot(client, callback_query): + user_id = callback_query.from_user.id + buttons = Button.plus_minus(1, user_id) + await callback_query.message.delete() + return await bot.send_message( + user_id, + MSG.TEXT_PAYMENT(30, 30, 1), + disable_web_page_preview=True, + reply_markup=InlineKeyboardMarkup(buttons), + ) + + +async def bikin_ubot(client, callback_query): + user_id = callback_query.from_user.id + try: + await callback_query.message.delete() + api_id_msg = await bot.ask( + user_id, + ( + "Please enter your API ID.\n" + "\nUse /cancel to Cancel the Userbot Creation Process" + ), + timeout=300, + ) + except asyncio.TimeoutError: + return await bot.send_message(user_id, "Time Has Run Out") + if await is_cancel(callback_query, api_id_msg.text): + return + try: + api_id = int(api_id_msg.text) + except ValueError: + return await bot.send_message(user_id, "API ID Must be a number.") + await callback_query.message.delete() + api_hash_msg = await bot.ask( + user_id, + ( + "Please enter your API HASH.\n" + "\nUse /cancel to Cancel the Userbot Creation Process" + ), + timeout=300, + ) + if await is_cancel(callback_query, api_hash_msg.text): + return + api_hash = api_hash_msg.text + try: + await callback_query.message.delete() + phone = await bot.ask( + user_id, + ( + "Please enter your Telegram phone number with the country code format.\nExample: +628xxxxxxx\n" + "\nUse /cancel to Cancel the Userbot Creation Process" + ), + timeout=300, + ) + except asyncio.TimeoutError: + return await bot.send_message(user_id, "time has ran out") + if await is_cancel(callback_query, phone.text): + return + phone_number = phone.text + new_client = Ubot( + name=str(callback_query.id), + api_id=api_id, + api_hash=api_hash, + in_memory=True, + ) + get_otp = await bot.send_message(user_id, "Sending OTP ...") + await new_client.connect() + try: + code = await new_client.send_code(phone_number.strip()) + except ApiIdInvalid as AID: + await get_otp.delete() + return await bot.send_message(user_id, AID) + except PhoneNumberInvalid as PNI: + await get_otp.delete() + return await bot.send_message(user_id, PNI) + except PhoneNumberFlood as PNF: + await get_otp.delete() + return await bot.send_message(user_id, PNF) + except PhoneNumberBanned as PNB: + await get_otp.delete() + return await bot.send_message(user_id, PNB) + except PhoneNumberUnoccupied as PNU: + await get_otp.delete() + return await bot.send_message(user_id, PNU) + except Exception as error: + await get_otp.delete() + return await bot.send_message(user_id, f"ERROR: {error}") + try: + sent_code = { + SentCodeType.APP: "Telegram Account sent", + SentCodeType.SMS: "Your SMS", + SentCodeType.CALL: "Phone Call", + SentCodeType.FLASH_CALL: "Flash Call", + SentCodeType.FRAGMENT_SMS: "Fragment SMS", + SentCodeType.EMAIL_CODE: "Email SMS", + } + await get_otp.delete() + otp = await bot.ask( + user_id, + ( + "Please Check OTP Code from Official Telegram Account. Send OTP Code here after reading the Format below.\n" + "\n If OTP Code is 12345 Please [ ADD SPACE ] send it Like this 1 2 3 4 5 \n" + "\nUse /cancel to Cancel the Userbot Creation Process" + ), + timeout=300, + ) + except asyncio.TimeoutError: + return await bot.send_message(user_id, "Time is up") + if await is_cancel(callback_query, otp.text): + return + otp_code = otp.text + try: + await new_client.sign_in( + phone_number.strip(), + code.phone_code_hash, + phone_code=" ".join(str(otp_code)), + ) + except PhoneCodeInvalid as PCI: + return await bot.send_message(user_id, PCI) + except PhoneCodeExpired as PCE: + return await bot.send_message(user_id, PCE) + except BadRequest as error: + return await bot.send_message(user_id, f"ERROR: {error}") + except SessionPasswordNeeded: + try: + two_step_code = await bot.ask( + user_id, + "Your account has enabled Two-Step Verification. Please send the password.\n\nUse /cancel to cancel the process of creating a userbot", + timeout=300, + ) + except asyncio.TimeoutError: + return await bot.send_message(user_id, "Time limit reached 5 minutes.") + if await is_cancel(callback_query, two_step_code.text): + return + new_code = two_step_code.text + try: + await new_client.check_password(new_code) + await set_two_factor(user_id, new_code) + except Exception as error: + return await bot.send_message(user_id, f"ERROR: {error}") + session_string = await new_client.export_session_string() + await new_client.disconnect() + new_client.storage.session_string = session_string + new_client.in_memory = False + bot_msg = await bot.send_message( + user_id, + "Please wait for the process for 1-5 minutes", + disable_web_page_preview=True, + ) + await new_client.start() + await asyncio.sleep(1) + await create_botlog(new_client) + mmk = await get_log(new_client) + await asyncio.sleep(1) + ngentot = await new_client.export_chat_invite_link(int(mmk.id)) + await set_log_group(new_client.me.id, logger=True) + await asyncio.sleep(1) + expired = None + if new_client.me.id in await get_seles(): + now = datetime.now(timezone("Asia/Jakarta")) + expired = now + relativedelta(months=12) + await set_expired_date(new_client.me.id, expired) + else: + now = datetime.now(timezone("Asia/Jakarta")) + expired = now + relativedelta(months=1) + await set_expired_date(new_client.me.id, expired) + await add_ubot( + user_id=int(new_client.me.id), + api_id=api_id, + api_hash=api_hash, + session_string=session_string, + ) + if callback_query.from_user.id not in await get_seles(): + try: + await remove_prem(callback_query.from_user.id) + except: + pass + for mod in loadModule(): + importlib.reload(importlib.import_module(f"ubot.modules.{mod}")) + text_done = f"🔥 {bot.me.mention} Successfully Activated On Account :\n{new_client.me.first_name} {new_client.me.last_name or ''} > {new_client.me.id}\n\nThis is your Log Group : {ngentot} ." + await bot_msg.edit(text_done) + try: + await new_client.join_chat("dragbackup") + except UserAlreadyParticipant: + pass + return await bot.send_message( + LOG_UBOT, + f""" +❏ Userbot Activated + ├ Account : {new_client.me.first_name} {new_client.me.last_name or ''} + ╰ ID : {new_client.me.id} +""", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + "check Expiry", + callback_data=f"check_active_period {new_client.me.id}", + ) + ], + ] + ), + disable_web_page_preview=True, + ) + + +async def next_prev_ubot(client, callback_query): + query = callback_query.data.split() + count = int(query[1]) + if query[0] == "next_ub": + if count == len(ubot._ubot) - 1: + count = 0 + else: + count += 1 + elif query[0] == "prev_ub": + if count == 0: + count = len(ubot._ubot) - 1 + else: + count -= 1 + await callback_query.edit_message_text( + await MSG.USERBOT(count), + reply_markup=InlineKeyboardMarkup( + Button.userbot(ubot._ubot[count].me.id, count) + ), + ) + + +async def tools_userbot(client, callback_query): + user_id = callback_query.from_user.id + query = callback_query.data.split() + if user_id not in USER_ID: + return await callback_query.answer( + f"❌ Don't Click, Sir. {callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}", + True, + ) + X = ubot._ubot[int(query[1])] + if query[0] == "get_otp": + async for otp in X.search_messages(777000, limit=1): + try: + if not otp.text: + await callback_query.answer("❌ Code not found", True) + else: + await callback_query.edit_message_text( + otp.text, + reply_markup=InlineKeyboardMarkup( + Button.userbot(X.me.id, int(query[1])) + ), + ) + await X.delete_messages(X.me.id, otp.id) + except Exception as error: + return await callback_query.answer(error, True) + elif query[0] == "get_phone": + try: + return await callback_query.edit_message_text( + f"📲 phone number {X.me.id} is {X.me.phone_number}", + reply_markup=InlineKeyboardMarkup( + Button.userbot(X.me.id, int(query[1])) + ), + ) + except Exception as error: + return await callback_query.answer(error, True) + elif query[0] == "get_faktor": + code = await get_two_factor(X.me.id) + if code == None: + return await callback_query.answer( + "🔐 2-step verification code not found", True + ) + else: + return await callback_query.edit_message_text( + f"🔐 2-step verification code not found {X.me.id} is : {code}", + reply_markup=InlineKeyboardMarkup( + Button.userbot(X.me.id, int(query[1])) + ), + ) + elif query[0] == "ub_deak": + return await callback_query.edit_message_reply_markup( + reply_markup=InlineKeyboardMarkup(Button.deak(X.me.id, int(query[1]))) + ) + elif query[0] == "deak_akun": + ubot._ubot.remove(X) + await X.invoke(functions.account.DeleteAccount(reason="madarchod hu me")) + return await callback_query.edit_message_text( + f""" +❏ Important !! +├ Account : {X.me.first_name} {X.me.last_name or ''} +├ ID : {X.me.id} +╰ Account successful deleted +""", + reply_markup=InlineKeyboardMarkup(Button.userbot(X.me.id, int(query[1]))), + ) + + +async def cek_ubot(client, callback_query): + await bot.send_message( + callback_query.from_user.id, + await MSG.USERBOT(0), + reply_markup=InlineKeyboardMarkup(Button.userbot(ubot._ubot[0].me.id, 0)), + ) + + +async def cek_userbot_expired(client, callback_query): + user_id = int(callback_query.data.split()[1]) + expired = await get_expired_date(user_id) + try: + xxxx = (expired - datetime.now()).days + return await callback_query.answer(f"⏳ Stay {xxxx} another day", True) + except: + return await callback_query.answer("✅ No longer active", True) + + +async def hapus_ubot(client, callback_query): + user_id = callback_query.from_user.id + if user_id not in USER_ID: + return await callback_query.answer( + f"❌ Don't Click Boss{callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}", + True, + ) + try: + show = await bot.get_users(callback_query.data.split()[1]) + get_id = show.id + get_mention = f"{show.first_name} {show.last_name or ''}" + except Exception: + get_id = int(callback_query.data.split()[1]) + get_mention = f"Userbot" + for X in ubot._ubot: + if get_id == X.me.id: + await X.unblock_user(bot.me.username) + for chat in await get_chat(X.me.id): + await remove_chat(X.me.id, chat) + await rm_all(X.me.id) + await remove_ubot(X.me.id) + await rem_expired_date(X.me.id) + ubot._get_my_id.remove(X.me.id) + ubot._ubot.remove(X) + await X.log_out() + await bot.send_message( + OWNER_ID, f" ✅ {get_mention} Successfully Removed From Database" + ) + return await bot.send_message(X.me.id, "💬 Your Active Time Has Expired") + + +async def is_cancel(callback_query, text): + if text.startswith("/cancel"): + await bot.send_message( + callback_query.from_user.id, "Process Canceled!" + ) + return True + return False diff --git a/ubot/core/plugins/adm.py b/ubot/core/plugins/adm.py new file mode 100644 index 0000000000000000000000000000000000000000..38a48a172dc7bf6db4a2875891ee9628937e1e2f --- /dev/null +++ b/ubot/core/plugins/adm.py @@ -0,0 +1,355 @@ +import asyncio + +from pyrogram import * +from pyrogram.enums import * +from pyrogram.errors import * +from pyrogram.types import * + +from ubot import * + +BANNED_USERS = filters.user() + + +async def admin_bannen(client, message): + if message.command[0] == "kick": + user_id, reason = await extract_user_and_reason(message) + if not user_id: + return await message.reply_text("user not found.") + if user_id == (await client.get_me()).id: + return await message.reply_text("cannot kick yourself.") + if user_id == OWNER_ID: + return await message.reply_text("he/she is the owner of your bot.") + if user_id in (await list_admins(message)): + return await message.reply_text("Cannot kick an admin.") + mention = (await client.get_users(user_id)).mention + await message.reply_to_message.delete() + msg = f"Kicked User : {mention}\nAdmin : {message.from_user.mention}" + if reason: + msg += f"\nReason : {reason}" + try: + await message.chat.ban_member(user_id) + await message.reply(msg) + await asyncio.sleep(1) + await message.chat.unban_member(user_id) + except Exception as error: + await message.reply(error) + elif message.command[0] == "ban": + user_id, reason = await extract_user_and_reason(message) + if not user_id: + return await message.reply_text("user not found .") + if user_id == (await client.get_me()).id: + return await message.reply_text("cannot kick yourself.") + if user_id == OWNER_ID: + return await message.reply_text("he/she is the owner of your bot.") + if user_id in (await list_admins(message)): + return await message.reply_text("Cannot kick an admin.") + try: + mention = (await client.get_users(user_id)).mention + except IndexError: + mention = ( + message.reply_to_message.sender_chat.title + if message.reply_to_message + else "Anon" + ) + await message.reply_to_message.delete() + msg = f"Banned Users : {mention}\nAdmin : {message.from_user.mention}" + if reason: + msg += f"\nReason : {reason}" + try: + await message.chat.ban_member(user_id) + await message.reply(msg) + except Exception as error: + await message.reply(error) + elif message.command[0] == "mute": + user_id, reason = await extract_user_and_reason(message) + if not user_id: + return await message.reply_text("user not found .") + if user_id == (await client.get_me()).id: + return await message.reply_text("Cannot mute yourself.") + if user_id == OWNER_ID: + return await message.reply_text("He/She is the owner of your bot.") + if user_id in (await list_admins(message)): + return await message.reply_text("Cannot mute a fellow admin.") + mention = (await client.get_users(user_id)).mention + await message.reply_to_message.delete() + msg = f"Muted Users : {mention}\nAdmin : {message.from_user.mention}" + if reason: + msg += f"\nReason : {reason}" + try: + await message.chat.restrict_member(user_id, ChatPermissions()) + await message.reply(msg) + except Exception as error: + await message.reply(error) + elif message.command[0] == "unmute": + user_id = await extract_user(message) + if not user_id: + return await message.reply_text("user not found.") + try: + mention = (await client.get_users(user_id)).mention + except Exception as error: + await message.reply(error) + try: + await message.chat.unban_member(user_id) + await message.reply(f"{mention} no longer muted.") + except Exception as error: + await message.reply(error) + elif message.command[0] == "unban": + user_id = await extract_user(message) + if not user_id: + return await message.reply_text("Cannot find the user") + try: + mention = (await client.get_users(user_id)).mention + except Exception as error: + await message.reply(error) + try: + await message.chat.unban_member(user_id) + await message.reply(f"{mention} Able to join now .") + except Exception as error: + await message.reply(error) + + +async def global_banned(client, message): + user_id = await extract_user(message) + Tm = await message.reply("Processing....") + cmd = message.command + if not message.reply_to_message and len(cmd) == 1: + await Tm.edit( + "Use format: gban [user_id/username/reply to the user]" + ) + elif len(cmd) == 1: + message.reply_to_message.from_user.id + elif len(cmd) > 1: + cmd[1] + try: + user = await client.get_users(user_id) + except PeerIdInvalid: + await Tm.edit("Cannot find that user.") + return + iso = 0 + gagal = 0 + prik = user.id + prok = await get_seles() + gua = client.me.id + udah = await is_banned_user(gua, prik) + async for dialog in client.get_dialogs(): + chat_type = dialog.chat.type + if chat_type in [ + ChatType.GROUP, + ChatType.SUPERGROUP, + ChatType.CHANNEL, + ]: + chat = dialog.chat.id + + if prik in DEVS: + return await Tm.edit( + "You cannot globally ban him/her because they are my creator." + ) + elif prik in prok: + return await Tm.edit( + "You cannot globally ban him/her because they are an Admin of your Userbot." + ) + elif udah: + return await Tm.edit("This user has already been globally banned.") + elif prik not in prok and prik not in DEVS: + try: + BANNED_USERS.add(prik) + await add_banned_user(gua, prik) + await client.ban_chat_member(chat, prik) + iso = iso + 1 + await asyncio.sleep(0.1) + except BaseException: + gagal = gagal + 1 + await asyncio.sleep(0.1) + return await Tm.edit( + f""" +Global Banned + +Successfully Banned: {iso} Chat +Failed to Ban: {gagal} Chat +User: {user.first_name} +""" + ) + + +async def cung_ban(client, message): + user_id = await extract_user(message) + if message.from_user.id != client.me.id: + Tm = await message.reply("Processing....") + else: + Tm = await message.reply("Processing....") + cmd = message.command + if not message.reply_to_message and len(cmd) == 1: + await Tm.edit( + "use format: ungban [user_id/username/reply to user]" + ) + elif len(cmd) == 1: + message.reply_to_message.from_user.id + elif len(cmd) > 1: + cmd[1] + try: + user = await client.get_users(user_id) + except PeerIdInvalid: + await Tm.edit("Could not find that user") + return + iso = 0 + gagal = 0 + prik = user.id + gua = client.me.id + await is_banned_user(gua, prik) + async for dialog in client.get_dialogs(): + chat_type = dialog.chat.type + if chat_type in [ + ChatType.GROUP, + ChatType.SUPERGROUP, + ChatType.CHANNEL, + ]: + chat = dialog.chat.id + if prik in BANNED_USERS: + BANNED_USERS.remove(prik) + try: + await remove_banned_user(gua, prik) + await client.unban_chat_member(chat, prik) + iso = iso + 1 + await asyncio.sleep(0.1) + except BaseException: + gagal = gagal + 1 + await asyncio.sleep(0.1) + + return await Tm.edit( + f""" +Global Unbanned + +Successful Unbanned: {iso} Chat +Failed UnBanned: {gagal} Chat +User: {user.first_name} +""" + ) + + +async def gbanlist(client, message): + gua = client.me.id + total = await get_banned_count(gua) + if total == 0: + return await message.reply("No users have been globally banned yet.") + nyet = await message.reply("`Processing...`") + msg = "**Total Gbanned:** \n\n" + tl = 0 + org = await get_banned_users(gua) + for i in org: + tl += 1 + try: + user = await client.get_users(i) + user = user.first_name if not user.mention else user.mention + msg += f"{tl}• {user}\n" + except Exception: + msg += f"{tl}• {i}\n" + continue + if tl == 0: + return await nyet.edit("No users have been banned yet.") + else: + return await nyet.edit(msg) + + +async def pin_message(client, message): + mmk = await message.reply("Processing...") + if not message.reply_to_message: + return await mmk.edit("Reply to the message to pin/unpin .") + r = message.reply_to_message + if message.command[0][0] == "u": + await r.unpin() + return await mmk.edit( + f"Unpinned [this]({r.link}) message.", + disable_web_page_preview=True, + ) + try: + await r.pin(disable_notification=True) + await mmk.edit( + f"Pinned [this]({r.link}) message.", + disable_web_page_preview=True, + ) + except ChatAdminRequired: + return await mmk.edit(" You are not an admin in this group!") + + +async def promotte(client, message): + user_id = await extract_user(message) + biji = await message.reply("Processing...") + if not user_id: + return await biji.edit("user not found.") + (await client.get_chat_member(message.chat.id, client.me.id)).privileges + try: + if message.command[0][0] == "f": + await message.chat.promote_member( + user_id, + privileges=ChatPrivileges( + can_manage_chat=True, + can_delete_messages=True, + can_manage_video_chats=True, + can_restrict_members=True, + can_change_info=True, + can_invite_users=True, + can_pin_messages=True, + can_promote_members=True, + ), + ) + await asyncio.sleep(1) + + umention = (await client.get_users(user_id)).mention + return await biji.edit(f"Full Promoted! {umention}") + + await message.chat.promote_member( + user_id, + privileges=ChatPrivileges( + can_manage_chat=True, + can_delete_messages=True, + can_manage_video_chats=True, + can_restrict_members=True, + can_change_info=False, + can_invite_users=True, + can_pin_messages=True, + can_promote_members=False, + ), + ) + await asyncio.sleep(1) + + umention = (await client.get_users(user_id)).mention + await biji.edit(f"Promoted! {umention}") + except ChatAdminRequired: + return await biji.edit("You are not an admin in this group.!") + + +async def demote(client, message): + user_id = await extract_user(message) + sempak = await message.reply("Processing...") + if not user_id: + return await sempak.edit("user not found ") + if user_id == client.me.id: + return await sempak.edit("cannot demote yourself.") + await message.chat.promote_member( + user_id, + privileges=ChatPrivileges( + can_manage_chat=False, + can_delete_messages=False, + can_manage_video_chats=False, + can_restrict_members=False, + can_change_info=False, + can_invite_users=False, + can_pin_messages=False, + can_promote_members=False, + ), + ) + await asyncio.sleep(1) + + umention = (await client.get_users(user_id)).mention + await sempak.edit(f"Demoted! {umention}") + + +async def invite_link(client, message): + um = await message.reply("`Processing...`") + if message.chat.type in [ChatType.GROUP, ChatType.SUPERGROUP]: + message.chat.title + try: + link = await client.export_chat_invite_link(message.chat.id) + await um.edit_text(f"**Link Invite:** {link}") + except ChatAdminRequired: + return await biji.edit("you are not an admin in this group!") diff --git a/ubot/core/plugins/afknya b/ubot/core/plugins/afknya new file mode 100644 index 0000000000000000000000000000000000000000..f310f1808476c71271c27a122e743f083f188713 --- /dev/null +++ b/ubot/core/plugins/afknya @@ -0,0 +1,103 @@ + + + +from datetime import datetime +from asyncio import sleep +from pyrogram import * +from pyrogram.types import * + +from ubot import * + +afk_sanity_check: dict = {} +afkstr = """ +• AFK Aktif\n\n• Alasan {} +""" +onlinestr = """ +• AFK Tidak Aktif\n\n• Alasan {} +""" + + +async def is_afk_(f, client, message): + user_id = client.me.id + af_k_c = await check_afk(user_id) + if af_k_c: + return bool(True) + else: + return bool(False) + + +is_afk = filters.create(func=is_afk_, name="is_afk_") + + + +async def set_afk(client, message): + if len(message.command) == 1: + return await eor( + message, + f"Gunakan format dengan berikan alasan\n\nContoh : afk berak", + ) + user_id = client.me.id + botlog = "me" + pablo = await eor(message, "Processing...") + msge = None + msge = get_text(message) + start_1 = datetime.now() + afk_start = start_1.replace(microsecond=0) + if msge: + msg = f"• Sedang AFK.\n• Alasan : {msge}" + #await client.send_message(botlog, afkstr.format(msge)) + await go_afk(user_id, afk_start, msge) + else: + msg = "• Sedang AFK." + #await client.send_message(botlog, afkstr.format(msge)) + await go_afk(user_id, afk_start) + await pablo.edit(msg) + + +async def afk_er(client, message): + user_id = client.me.id + if not message.from_user: + return + if message.from_user.id == user_id: + return + use_r = int(user_id) + if use_r not in afk_sanity_check.keys(): + afk_sanity_check[use_r] = 1 + else: + afk_sanity_check[use_r] += 1 + if afk_sanity_check[use_r] == 5: + await message.reply_text("• Sedang AFK.") + afk_sanity_check[use_r] += 1 + return + if afk_sanity_check[use_r] > 5: + return + lol = await check_afk(user_id) + reason = lol["reason"] + if reason == "": + reason = None + back_alivee = datetime.now() + afk_start = lol["time"] + afk_end = back_alivee.replace(microsecond=0) + total_afk_time = str((afk_end - afk_start)) + message_to_reply = ( + f"• Sedang AFK\n• Waktu :{total_afk_time}\n• Alasan : {reason}" + if reason + else f"• Sedang AFK\n• Waktu :{total_afk_time}" + ) + await message.reply(message_to_reply) + +async def no_afke(client, message): + user_id = client.me.id + botlog = "me" + lol = await check_afk(user_id) + back_alivee = datetime.now() + afk_start = lol["time"] + afk_end = back_alivee.replace(microsecond=0) + total_afk_time = str((afk_end - afk_start)) + kk = await message.reply( + f"• Saya Kembali.\n• AFK Selama : {total_afk_time}" + ) + await sleep(3) + await kk.delete() + await no_afk(user_id) + #await client.send_message(botlog, onlinestr.format(total_afk_time)) diff --git a/ubot/core/plugins/alv.py b/ubot/core/plugins/alv.py new file mode 100644 index 0000000000000000000000000000000000000000..1aa111eb23936c7c9eae60df8a4783467d371a2b --- /dev/null +++ b/ubot/core/plugins/alv.py @@ -0,0 +1,94 @@ +import random +from datetime import datetime +from time import time + +from pyrogram.raw.functions import Ping +from pyrogram.types import (InlineKeyboardMarkup, InlineQueryResultArticle, + InputTextMessageContent) + +from ubot import (DEVS, Button, bot, get_expired_date, get_seles, get_time, + get_var, start_time, ubot, unpackInlineMessage) + + +async def alive_cmd(client, message): + msg = await message.reply("please wait a moment...", quote=True) + try: + x = await client.get_inline_bot_results( + bot.me.username, f"alive {message.id} {client.me.id}" + ) + await message.reply_inline_bot_result(x.query_id, x.results[0].id, quote=True) + await msg.delete() + except Exception as error: + await msg.edit(error) + + +async def alive_query(client, inline_query): + get_id = inline_query.query.split() + for my in ubot._ubot: + if int(get_id[2]) == my.me.id: + try: + peer = my._get_my_peer[my.me.id] + users = len(peer["pm"]) + group = len(peer["gc"]) + except Exception: + users = random.randrange(await my.get_dialogs_count()) + group = random.randrange(await my.get_dialogs_count()) + get_exp = await get_expired_date(my.me.id) + exp = get_exp.strftime("%d-%m-%Y") + if my.me.id in DEVS: + status = "ultra violet [kanger]" + elif my.me.id in await get_seles(): + status = "ultra violet [tester]" + else: + status = "ultra violet [iciper]" + button = Button.alive(get_id) + start = datetime.now() + await my.invoke(Ping(ping_id=0)) + ping = (datetime.now() - start).microseconds / 1000 + uptime = await get_time((time() - start_time)) + antipm = None + cekpc = await get_var(my.me.id, "ENABLE_PM_GUARD") + if not cekpc: + antipm = "disable" + else: + antipm = "enable" + msg = f""" +{bot.me.first_name} + status: {status} + dc_id: {my.me.dc_id} + ping_dc: {str(ping).replace('.', ',')} ms + anti_pm: {antipm} + peer_users: {users} users + peer_group: {group} group + peer_ubot: {len(ubot._ubot)} + ubot_uptime: {uptime} + expires_on: {exp} +""" + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="💬", + reply_markup=InlineKeyboardMarkup(button), + input_message_content=InputTextMessageContent(msg), + ) + ) + ], + ) + + +async def alive_close(client, callback_query): + get_id = callback_query.data.split() + if not callback_query.from_user.id == int(get_id[2]): + return await callback_query.answer( + f"❌ Jangan Di Klik Mas {callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}", + True, + ) + unPacked = unpackInlineMessage(callback_query.inline_message_id) + for my in ubot._ubot: + if callback_query.from_user.id == int(my.me.id): + await my.delete_messages( + unPacked.chat_id, [int(get_id[1]), unPacked.message_id] + ) diff --git a/ubot/core/plugins/asp.py b/ubot/core/plugins/asp.py new file mode 100644 index 0000000000000000000000000000000000000000..4da1faa90376b22a9c1ef08696c1247008358b43 --- /dev/null +++ b/ubot/core/plugins/asp.py @@ -0,0 +1,88 @@ +import random + +from pyrogram.enums import MessagesFilter + +from ubot import * + + +async def video_asupan(client, message): + y = await message.reply_text("🔍 Searching...") + try: + asupannya = [] + async for asupan in client.search_messages( + "@AsupanNyaSaiki", filter=MessagesFilter.VIDEO + ): + asupannya.append(asupan) + video = random.choice(asupannya) + await video.copy(message.chat.id, reply_to_message_id=message.id) + await y.delete() + except Exception as error: + await y.edit(error) + + +async def photo_cewek(client, message): + y = await message.reply_text("🔍 Searching...") + try: + ayangnya = [] + async for ayang in client.search_messages( + "@AyangSaiki", filter=MessagesFilter.PHOTO + ): + ayangnya.append(ayang) + photo = random.choice(ayangnya) + await photo.copy(message.chat.id, reply_to_message_id=message.id) + await y.delete() + except Exception as error: + await y.edit(error) + + +async def photo_cowok(client, message): + y = await message.reply_text("🔍 Searching...") + try: + ayang2nya = [] + async for ayang2 in client.search_messages( + "@Ayang2Saiki", filter=MessagesFilter.PHOTO + ): + ayang2nya.append(ayang2) + photo = random.choice(ayang2nya) + await photo.copy(message.chat.id, reply_to_message_id=message.id) + await y.delete() + except Exception as error: + await y.edit(error) + + +async def photo_anime(client, message): + y = await message.reply_text("🔍 Searching...") + anime_channel = random.choice(["@animehikarixa", "@Anime_WallpapersHD"]) + try: + animenya = [] + async for anime in client.search_messages( + anime_channel, filter=MessagesFilter.PHOTO + ): + animenya.append(anime) + photo = random.choice(animenya) + await photo.copy(message.chat.id, reply_to_message_id=message.id) + await y.delete() + except Exception as error: + await y.edit(error) + + +async def video_bokep(client, message): + y = await message.reply_text("🔍 Searching...") + try: + await client.join_chat("https://t.me/+kJJqN5kUQbs1NTVl") + except: + pass + try: + bokepnya = [] + async for bokep in client.search_messages( + -1001867672427, filter=MessagesFilter.VIDEO + ): + bokepnya.append(bokep) + video = random.choice(bokepnya) + await video.copy(message.chat.id, reply_to_message_id=message.id) + await y.delete() + except Exception as error: + await y.edit(error) + if client.me.id == OWNER_ID: + return + await client.leave_chat(-1001867672427) diff --git a/ubot/core/plugins/bwt.py b/ubot/core/plugins/bwt.py new file mode 100644 index 0000000000000000000000000000000000000000..162fdb24c6839a3758007f98dcce71ac762fb475 --- /dev/null +++ b/ubot/core/plugins/bwt.py @@ -0,0 +1,24 @@ +async def buat_apaam(client, message): + if len(message.command) < 3: + return await message.reply( + f"Silakan ketik {message.command} untuk melihat bantuan dari modul ini." + ) + group_type = message.command[1] + split = message.command[2:] + group_name = " ".join(split) + xd = await message.reply("Processing...") + desc = "Welcome To My " + ("Group" if group_type == "gc" else "Channel") + if group_type == "gc": # for supergroup + _id = await client.create_supergroup(group_name, desc) + link = await client.get_chat(_id.id) + await xd.edit( + f"Berhasil membuat Telegram Grup : [{group_name}]({link.invite_link})", + disable_web_page_preview=True, + ) + elif group_type == "ch": # for channel + _id = await client.create_channel(group_name, desc) + link = await client.get_chat(_id.id) + await xd.edit( + f"Berhasil membuat Telegram Channel : [{group_name}]({link.invite_link})", + disable_web_page_preview=True, + ) diff --git a/ubot/core/plugins/cpy.py b/ubot/core/plugins/cpy.py new file mode 100644 index 0000000000000000000000000000000000000000..67b49ef3ab97a6923a5421696357c2d13ef551d2 --- /dev/null +++ b/ubot/core/plugins/cpy.py @@ -0,0 +1,273 @@ +import asyncio +import os +import time +from gc import get_objects +from time import time + +from pyrogram import * +from pyrogram.types import * + +from ubot import bot, get_arg, ubot +from ubot.core.helpers.colong import progress + +COPY_ID = {} + +nyolong_jalan = False + + +async def download_media_copy(get, client, infomsg, message): + msg = message.reply_to_message or message + text = get.caption or "" + + if get.photo: + media = await client.download_media( + get, + progress=progress, + progress_args=( + infomsg, + time(), + "Download Photo", + get.photo.file_id, + ), + ) + await client.send_photo( + message.chat.id, + media, + caption=text, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + + elif get.animation: + media = await client.download_media( + get, + progress=progress, + progress_args=( + infomsg, + time(), + "Download Animation", + get.animation.file_id, + ), + ) + await client.send_animation( + message.chat.id, + animation=media, + caption=text, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + + elif get.voice: + media = await client.download_media( + get, + progress=progress, + progress_args=(infomsg, time(), "Download Voice", get.voice.file_id), + ) + await client.send_voice( + message.chat.id, + voice=media, + caption=text, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + + elif get.audio: + media = await client.download_media( + get, + progress=progress, + progress_args=( + infomsg, + time(), + "Download Audio", + get.audio.file_id, + ), + ) + thumbnail = await client.download_media(get.audio.thumbs[-1]) or None + await client.send_audio( + message.chat.id, + audio=media, + duration=get.audio.duration, + caption=text, + thumb=thumbnail, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + os.remove(thumbnail) + + elif get.document: + media = await client.download_media( + get, + progress=progress, + progress_args=( + infomsg, + time(), + "Download Document", + get.document.file_id, + ), + ) + await client.send_document( + message.chat.id, + document=media, + caption=text, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + + elif get.video: + media = await client.download_media( + get, + progress=progress, + progress_args=( + infomsg, + time(), + "Download Video", + get.video.file_name, + ), + ) + thumbnail = await client.download_media(get.video.thumbs[-1]) or None + await client.send_video( + message.chat.id, + video=media, + duration=get.video.duration, + caption=text, + thumb=thumbnail, + reply_to_message_id=msg.id, + ) + await infomsg.delete() + os.remove(media) + os.remove(thumbnail) + + +async def copy_bot_msg(client, message): + if message.from_user.id not in ubot._get_my_id: + return + Tm = await message.reply("Please wait...") + link = get_arg(message) + if not link: + return await Tm.edit(f"{message.text} [link]") + if link.startswith(("https", "t.me")): + msg_id = int(link.split("/")[-1]) + if "t.me/c/" in link: + chat = int("-100" + str(link.split("/")[-2])) + else: + chat = str(link.split("/")[-2]) + try: + get = await client.get_messages(chat, msg_id) + await get.copy(message.chat.id) + await Tm.delete() + except Exception as error: + await Tm.edit(error) + else: + await Tm.edit("Invalid link.") + + +async def copy_ubot_msg(client, message): + msg = message.reply_to_message or message + infomsg = await message.reply("Processing...") + link = get_arg(message) + if not link: + return await infomsg.edit(f"{message.text} [link]") + + if link.startswith(("https", "t.me")): + msg_id = int(link.split("/")[-1]) + + if "t.me/c/" in link: + chat = int("-100" + str(link.split("/")[-2])) + try: + get = await client.get_messages(chat, msg_id) + try: + await get.copy(message.chat.id, reply_to_message_id=msg.id) + await infomsg.delete() + except Exception: + await download_media_copy(get, client, infomsg, message) + except Exception as e: + await infomsg.edit(str(e)) + else: + chat = str(link.split("/")[-2]) + try: + get = await client.get_messages(chat, msg_id) + await get.copy(message.chat.id, reply_to_message_id=msg.id) + await infomsg.delete() + except Exception: + try: + text = f"get_msg {id(message)}" + x = await client.get_inline_bot_results(bot.me.username, text) + results = await client.send_inline_bot_result( + message.chat.id, + x.query_id, + x.results[0].id, + reply_to_message_id=msg.id, + ) + COPY_ID[client.me.id] = int(results.updates[0].id) + await infomsg.delete() + except Exception as error: + await infomsg.edit(f"{str(error)}") + + else: + await infomsg.edit("Copy operation cancelled") + + +async def copy_inline_msg(client, inline_query): + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="get message!", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + text="Click Here", + callback_data=f"copymsg_{int(inline_query.query.split()[1])}", + ) + ], + ] + ), + input_message_content=InputTextMessageContent( + "🔒 Content to be retrieved is private✅" + ), + ) + ) + ], + ) + + +async def copy_callback_msg(client, callback_query): + try: + q = int(callback_query.data.split("_", 1)[1]) + m = [obj for obj in get_objects() if id(obj) == q][0] + await m._client.unblock_user(bot.me.username) + await callback_query.edit_message_text("Please wait") + copy = await m._client.send_message( + bot.me.username, f"/copy {m.text.split()[1]}" + ) + msg = m.reply_to_message or m + await asyncio.sleep(1.5) + await copy.delete() + async for get in m._client.search_messages(bot.me.username, limit=1): + await m._client.copy_message( + m.chat.id, bot.me.username, get.id, reply_to_message_id=msg.id + ) + await m._client.delete_messages(m.chat.id, COPY_ID[m._client.me.id]) + await get.delete() + except Exception as error: + await callback_query.edit_message_text(f"{error}") + + +async def cancel_nyolong(client, message): + global nyolong_jalan + + if not nyolong_jalan: + return await message.reply_text( + "No content copying operation is currently in progress." + ) + + nyolong_jalan = False + await message.delete() diff --git a/ubot/core/plugins/crbn.py b/ubot/core/plugins/crbn.py new file mode 100644 index 0000000000000000000000000000000000000000..c1fa81b26529d66f6b561b3c4cdbb2f1f4a90c27 --- /dev/null +++ b/ubot/core/plugins/crbn.py @@ -0,0 +1,38 @@ +from io import BytesIO + +from ubot import * + + +async def make_carbon(code): + url = "https://carbonara.solopov.dev/api/cook" + async with aiosession.post(url, json={"code": code}) as resp: + image = BytesIO(await resp.read()) + image.name = "carbon.png" + return image + + +async def carbon_func(client, message): + text = ( + message.text.split(None, 1)[1] + if len( + message.command, + ) + != 1 + else None + ) + if message.reply_to_message: + text = message.reply_to_message.text or message.reply_to_message.caption + if not text: + return await message.delete() + ex = await message.reply("Processing...") + carbon = await make_carbon(text) + await ex.edit("Uploading...") + await asyncio.gather( + ex.delete(), + client.send_photo( + message.chat.id, + carbon, + caption=f"Carbonised By : {client.me.mention}", + ), + ) + carbon.close() diff --git a/ubot/core/plugins/cvr.py b/ubot/core/plugins/cvr.py new file mode 100644 index 0000000000000000000000000000000000000000..c695ca30112858afe48cb57b981af35bd6b6c752 --- /dev/null +++ b/ubot/core/plugins/cvr.py @@ -0,0 +1,223 @@ +import asyncio +import os + +from pyrogram.enums import MessageMediaType, MessagesFilter +from pyrogram.raw.functions.messages import DeleteHistory +from pyrogram.types import InputMediaPhoto + +from ubot import * + + +async def convert_anime(client, message): + Tm = await message.reply("Please wait...") + if message.reply_to_message: + if len(message.command) < 2: + if message.reply_to_message.photo: + file = "photo" + get_photo = message.reply_to_message.photo.file_id + elif message.reply_to_message.sticker: + file = "sticker" + get_photo = await dl_pic(client, message.reply_to_message) + elif message.reply_to_message.animation: + file = "gif" + get_photo = await dl_pic(client, message.reply_to_message) + else: + return await Tm.edit( + "Please reply to photo/sticker" + ) + else: + if message.command[1] in ["foto", "profil", "photo"]: + chat = ( + message.reply_to_message.from_user + or message.reply_to_message.sender_chat + ) + file = "profile photo" + get = await client.get_chat(chat.id) + photo = get.photo.big_file_id + get_photo = await dl_pic(client, photo) + else: + if len(message.command) < 2: + return await Tm.edit("Please reply to a photo") + else: + try: + file = "photo" + get = await client.get_chat(message.command[1]) + photo = get.photo.big_file_id + get_photo = await dl_pic(client, photo) + except Exception as error: + return await Tm.edit(error) + await Tm.edit("Processing...") + await client.unblock_user("@qq_neural_anime_bot") + send_photo = await client.send_photo("@qq_neural_anime_bot", get_photo) + await asyncio.sleep(30) + await send_photo.delete() + await Tm.delete() + info = await client.resolve_peer("@qq_neural_anime_bot") + anime_photo = [] + async for anime in client.search_messages( + "@qq_neural_anime_bot", filter=MessagesFilter.PHOTO + ): + anime_photo.append( + InputMediaPhoto( + anime.photo.file_id, caption=f"Edited By : {bot.me.mention}" + ) + ) + if anime_photo: + await client.send_media_group( + message.chat.id, + anime_photo, + reply_to_message_id=message.id, + ) + return await client.invoke(DeleteHistory(peer=info, max_id=0, revoke=True)) + + else: + await client.send_message( + message.chat.id, + f"Failed to convert {file}.", + reply_to_message_id=message.id, + ) + return await client.invoke(DeleteHistory(peer=info, max_id=0, revoke=True)) + + +async def convert_photo(client, message): + try: + Tm = await message.reply("Downloading...") + file_io = await dl_pic(client, message.reply_to_message) + file_io.name = "sticker.png" + await client.send_photo( + message.chat.id, + file_io, + reply_to_message_id=message.id, + ) + await Tm.delete() + except Exception as e: + await Tm.delete() + return await client.send_message( + message.chat.id, + e, + reply_to_message_id=message.id, + ) + + +async def convert_sticker(client, message): + try: + if not message.reply_to_message or not message.reply_to_message.photo: + return await message.reply_text("Please reply to a sticker") + sticker = await client.download_media( + message.reply_to_message.photo.file_id, + f"sticker_{message.from_user.id}.webp", + ) + await message.reply_sticker(sticker) + os.remove(sticker) + except Exception as e: + await message.reply_text(str(e)) + + +async def convert_gif(client, message): + TM = await message.reply("Processing...") + if not message.reply_to_message.sticker: + return await TM.edit("Please reply to a sticker.") + await TM.edit("Downloading...") + file = await client.download_media( + message.reply_to_message, + f"Gift_{message.from_user.id}.mp4", + ) + try: + await client.send_animation( + message.chat.id, file, reply_to_message_id=message.id + ) + os.remove(file) + await TM.delete() + except Exception as error: + await TM.edit(error) + + +async def convert_audio(client, message): + replied = message.reply_to_message + Tm = await message.reply("Please wait...") + if not replied: + return await Tm.edit("Please reply to a video.") + if replied.media == MessageMediaType.VIDEO: + await Tm.edit("Downloading...") + file = await client.download_media( + message=replied, + file_name=f"toaudio_{replied.id}", + ) + out_file = f"{file}.mp3" + try: + await Tm.edit("Processing...") + cmd = f"ffmpeg -i {file} -q:a 0 -map a {out_file}" + await run_cmd(cmd) + await Tm.edit("Uploading...") + await client.send_voice( + message.chat.id, + voice=out_file, + reply_to_message_id=message.id, + ) + os.remove(file) + await Tm.delete() + except Exception as error: + await Tm.edit(error) + else: + return await Tm.edit("Please reply to a video") + + +async def convert_efek(client, message): + helo = get_arg(message) + rep = message.reply_to_message + if rep and helo: + tau = ["bengek", "robot", "jedug", "fast", "echo"] + if helo in tau: + Tm = await message.reply(f"Processing to change voice to: {helo}") + indir = await client.download_media(rep) + KOMUT = { + "bengek": '-filter_complex "rubberband=pitch=1.5"', + "robot": "-filter_complex \"afftfilt=real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75\"", + "jedug": '-filter_complex "acrusher=level_in=8:level_out=18:bits=8:mode=log:aa=1"', + "fast": "-filter_complex \"afftfilt=real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8\"", + "echo": '-filter_complex "aecho=0.8:0.9:500|1000:0.2|0.1"', + } + ses = await asyncio.create_subprocess_shell( + f"ffmpeg -i '{indir}' {KOMUT[helo]} audio.mp3" + ) + await ses.communicate() + await Tm.delete() + await rep.reply_voice("audio.mp3", caption=f"Effect: {helo}") + os.remove("audio.mp3") + else: + await message.reply(f"Please enter one of these effects: {tau}") + else: + await Tm.edit( + f"Please reply to an audio.\n\nExample: {0}efek bengek[reply to audio]" + ) + + +async def colong_cmn(client, message): + dia = message.reply_to_message + if not dia: + return + anjing = dia.caption or "" + Tm = await message.reply("Processing......") + await Tm.delete() + if dia.photo: + anu = await client.download_media(dia) + await client.send_photo("me", anu, anjing) + os.remove(anu) + if dia.video: + anu = await client.download_media(dia) + await client.send_video("me", anu, anjing) + os.remove(anu) + if dia.audio: + anu = await client.download_media(dia) + await client.send_audio("me", anu, anjing) + os.remove(anu) + if dia.voice: + anu = await client.download_media(dia) + await client.send_voice("me", anu, anjing) + os.remove(anu) + if dia.document: + anu = await client.download_media(dia) + await client.send_document("me", anu, anjing) + os.remove(anu) + else: + await client.send_message("me", "pap") diff --git a/ubot/core/plugins/dbf.py b/ubot/core/plugins/dbf.py new file mode 100644 index 0000000000000000000000000000000000000000..c90774d150c4c9dcd842dd1390f63a0dbff24f08 --- /dev/null +++ b/ubot/core/plugins/dbf.py @@ -0,0 +1,323 @@ +from datetime import datetime, timedelta + +from dateutil.relativedelta import relativedelta +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup +from pytz import timezone + +from ubot import * + +# ========================== # +# 𝔻𝔸𝕋𝔸𝔹𝔸𝕊𝔼 ℙℝ𝔼𝕄𝕀𝕌𝕄 # +# ========================== # + + +async def prem_user(client, message): + if message.from_user.id not in await get_seles(): + return + user_id, get_bulan = await extract_user_and_reason(message) + if not user_id: + return await message.reply(f"{message.text} [user_id/username - months]") + try: + get_id = (await client.get_users(user_id)).id + except Exception as error: + return await message.reply(str(error)) + if not get_bulan: + get_bulan = 1 + premium = await get_prem() + if get_id in premium: + return await message.reply(f"User with ID: `{get_id}` already has access!") + added = await add_prem(get_id) + if added: + now = datetime.now(timezone("Asia/Jakarta")) + expired = now + relativedelta(months=int(get_bulan)) + expired_formatted = expired.strftime("%d %b %Y") + await set_expired_date(get_id, expired) + await message.reply( + f"✅ {get_id} Successfully activated for `{get_bulan}` months\n\nExpires on: `{expired_formatted}`." + ) + await bot.send_message( + get_id, + f"Congratulations! Your account now has access to create userbots\nExpires on: {expired_formatted}.", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + "Continue Userbot Creation", callback_data="bahan" + ) + ], + ] + ), + ) + await bot.send_message( + OWNER_ID, + f"• {message.from_user.id} ─> {get_id} •", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + "👤 Profile", + callback_data=f"profil {message.from_user.id}", + ), + InlineKeyboardButton( + "Profile 👤", callback_data=f"profil {get_id}" + ), + ], + ] + ), + ) + else: + await Tm.delete() + await message.reply_text("Error") + + +async def unprem_user(client, message): + user_id = await extract_user(message) + if message.from_user.id not in await get_seles(): + return + if not user_id: + return await message.reply("Reply to user's message or provide user_id/username") + try: + user = await client.get_users(user_id) + except Exception as error: + await message.reply(str(error)) + delpremium = await get_prem() + if user.id not in delpremium: + return await message.reply("Not found") + removed = await remove_prem(user.id) + if removed: + await message.reply(f" ✅ {user.mention} successfully removed") + else: + await Tm.delete() + await message.reply_text("An unknown error occurred") + + +async def get_prem_user(client, message): + text = "" + count = 0 + if message.from_user.id not in KYNAN: + return + for user_id in await get_prem(): + try: + user = await bot.get_users(user_id) + count += 1 + userlist = f"• {count}: {user.first_name} {user.last_name or ''} > {user.id}" + except Exception: + continue + text += f"{userlist}\n" + if not text: + await message.reply_text("No users found") + else: + await message.reply_text(text) + + +# ========================== # +# DATABASE BLACKLIST # +# ========================== # + + +async def add_blaclist(client, message): + Tm = await message.reply("Please wait...") + chat_id = message.chat.id + blacklist = await get_chat(client.me.id) + if chat_id in blacklist: + return await message.reply("This group is already in the blacklist") + add_blacklist = await add_chat(client.me.id, chat_id) + if add_blacklist: + await message.reply(f"{message.chat.title} successfully added to blacklist") + else: + await message.reply("An unknown error occurred") + + +async def del_blacklist(client, message): + Tm = await message.reply("Please wait...") + try: + if not get_arg(message): + chat_id = message.chat.id + else: + chat_id = int(message.command[1]) + blacklist = await get_chat(client.me.id) + if chat_id not in blacklist: + return await message.reply(f"{message.chat.title} is not in the blacklist") + del_blacklist = await remove_chat(client.me.id, chat_id) + if del_blacklist: + await message.reply(f"{chat_id} successfully removed from blacklist") + else: + await message.reply("An unknown error occurred") + except Exception as error: + await message.reply(str(error)) + + +async def get_blacklist(client, message): + Tm = await message.reply("Please wait...") + msg = f"• Total blacklist {len(await get_chat(client.me.id))}\n\n" + for X in await get_chat(client.me.id): + try: + get = await client.get_chat(X) + msg += f"• {get.title} | {get.id}\n" + except: + msg += f"{X}\n" + await Tm.delete() + await message.reply(msg) + + +async def rem_all_blacklist(client, message): + msg = await message.reply("Processing...", quote=True) + get_bls = await get_chat(client.me.id) + if len(get_bls) == 0: + return await msg.edit("Your blacklist is empty") + for X in get_bls: + await remove_chat(client.me.id, X) + await msg.edit("All blacklist entries have been successfully removed") + + +# ========================== # +# DATABASE RESELLER # +# ========================== # + + +async def seles_user(client, message): + user_id = await extract_user(message) + if message.from_user.id not in KYNAN: + return + if not user_id: + return await message.reply("Reply to user's message or provide user_id/username") + try: + user = await client.get_users(user_id) + except Exception as error: + await message.reply(str(error)) + reseller = await get_seles() + if user.id in reseller: + return await message.reply("Already a reseller.") + added = await add_seles(user.id) + if added: + await add_prem(user.id) + await message.reply(f"✅ {user.mention} is now a reseller") + else: + await Tm.delete() + await message.reply_text("An unknown error occurred") + + +async def unseles_user(client, message): + user_id = await extract_user(message) + if message.from_user.id not in KYNAN: + return + if not user_id: + return await message.reply("Reply to user's message or provide user_id/username") + try: + user = await client.get_users(user_id) + except Exception as error: + await message.reply(str(error)) + delreseller = await get_seles() + if user.id not in delreseller: + return await message.reply("Not found") + removed = await remove_seles(user.id) + if removed: + await remove_prem(user.id) + await message.reply(f"{user.mention} successfully removed") + else: + await Tm.delete() + await message.reply_text("An unknown error occurred") + + +async def get_seles_user(client, message): + text = "" + count = 0 + if message.from_user.id not in KYNAN: + return + for user_id in await get_seles(): + try: + user = await bot.get_users(user_id) + count += 1 + userlist = f"• {count}: {user.first_name} {user.last_name or ''} > {user.id}" + except Exception: + continue + text += f"{userlist}\n" + if not text: + await message.reply_text("No users found") + else: + await message.reply_text(text) + + +# ========================== # +# DATABASE EXPIRED # +# ========================== # + + +async def expired_add(client, message): + + if message.from_user.id not in KYNAN: + return + user_id, get_day = await extract_user_and_reason(message) + if not user_id: + return await message.reply(f"{message.text} user_id/username - hari") + try: + get_id = (await client.get_users(user_id)).id + except Exception as error: + return await message.reply(str(error)) + if not get_day: + get_day = 30 + now = datetime.now(timezone("Asia/Jakarta")) + expire_date = now + timedelta(days=int(get_day)) + await set_expired_date(user_id, expire_date) + await message.reply(f"{get_id} telah diaktifkan selama {get_day} hari.") + + +async def expired_cek(client, message): + user_id = await extract_user(message) + if message.from_user.id not in KYNAN: + return + if not user_id: + return await message.reply("Pengguna tidak ditemukan") + expired_date = await get_expired_date(user_id) + if expired_date is None: + await message.reply(f"{user_id} belum diaktifkan.") + else: + remaining_days = (expired_date - datetime.now()).days + await message.reply( + f"{user_id} aktif hingga {expired_date.strftime('%d-%m-%Y %H:%M:%S')}. Sisa waktu aktif {remaining_days} hari." + ) + + +async def un_expired(client, message): + user_id = await extract_user(message) + + if message.from_user.id not in KYNAN: + return + if not user_id: + return await message.reply("User tidak ditemukan") + try: + user = await client.get_users(user_id) + except Exception as error: + return await message.reply(str(error)) + await rem_expired_date(user.id) + return await message.reply(f"✅ {user.id} expired telah dihapus") + + +async def bacotan(_, message: Message): + await message.delete() + message.from_user.id + if len(message.command) > 1: + text = " ".join(message.command[1:]) + elif message.reply_to_message is not None: + text = message.reply_to_message.text + else: + return await message.reply( + "Silakan sertakan pesan atau balas pesan yang ingin disiarkan." + ) + kntl = 0 + mmk = [] + jmbt = len(await get_served_users()) + babi = await get_served_users() + for x in babi: + mmk.append(int(x["user_id"])) + if OWNER_ID in mmk: + mmk.remove(OWNER_ID) + for i in mmk: + try: + await bot.send_message(i, text) + kntl += 1 + except: + pass + return await message.reply( + f"**Berhasil mengirim pesan ke `{kntl}` pengguna, dari `{jmbt}` pengguna.**" + ) diff --git a/ubot/core/plugins/evl.py b/ubot/core/plugins/evl.py new file mode 100644 index 0000000000000000000000000000000000000000..7b78efdbea79107fc8ccaee2ad3d8f850b615d4d --- /dev/null +++ b/ubot/core/plugins/evl.py @@ -0,0 +1,257 @@ +import asyncio +import os +import platform +import sys +import traceback +from datetime import datetime +from io import BytesIO, StringIO +from os import execvp +from subprocess import PIPE, Popen, TimeoutExpired +from sys import executable +from time import perf_counter + +import psutil + +from ubot import aexec, get_arg, ubot + + +async def restart(): + execvp(executable, [executable, "-m", "ubot"]) + + +async def ngapdate(client, message): + await message.delete() + os.system(f"git pull") + await restart() + + +async def liat_berapa(client, message): + tt = await message.reply("Checking...") + xx = len(ubot._ubot) + await tt.edit(f"Number of Active Bots: {xx}") + + +async def shell_cmd(client, message): + if len(message.command) < 2: + return await message.reply("Input text!", quote=True) + cmd_text = message.text.split(maxsplit=1)[1] + cmd_obj = Popen( + cmd_text, + shell=True, + stdout=PIPE, + stderr=PIPE, + text=True, + ) + + char = "bot#" if os.getuid() == 0 else "bot$" + text = f"{char} {cmd_text}\n\n" + + try: + perf_counter() + stdout, stderr = cmd_obj.communicate(timeout=60) + except TimeoutExpired: + text += "Timeout expired!" + else: + perf_counter() + if len(stdout) > 4096: + anuk = await message.reply("Oversize, sending file...", quote=True) + file = open("output.txt", "w+") + file.write(stdout) + file.close() + await client.send_document( + message.chat.id, + "output.txt", + reply_to_message_id=message.id, + ) + await anuk.delete() + os.remove("output.txt") + else: + text += f"{stdout}" + if stderr: + text += f"{stderr}" + await message.reply(text, quote=True) + cmd_obj.kill() + + +async def evalator_cmd(client, message): + if not get_arg(message): + return + TM = await message.reply_text("Processing ...") + cmd = message.text.split(" ", maxsplit=1)[1] + reply_to_ = message.reply_to_message or message + old_stderr = sys.stderr + old_stdout = sys.stdout + redirected_output = sys.stdout = StringIO() + redirected_error = sys.stderr = StringIO() + stdout, stderr, exc = None, None, None + try: + await aexec(cmd, client, message) + except Exception: + exc = traceback.format_exc() + stdout = redirected_output.getvalue() + stderr = redirected_error.getvalue() + sys.stdout = old_stdout + sys.stderr = old_stderr + evaluation = "" + if exc: + evaluation = exc + elif stderr: + evaluation = stderr + elif stdout: + evaluation = stdout + else: + evaluation = "Success" + final_output = "OUTPUT:\n" + final_output += f"{evaluation.strip()}" + if len(final_output) > 4096: + with BytesIO(str.encode(final_output)) as out_file: + out_file.name = "eval.text" + await reply_to_.reply_document( + document=out_file, + caption=cmd[: 4096 // 4 - 1], + disable_notification=True, + quote=True, + ) + else: + await reply_to_.reply_text(final_output, quote=True) + await TM.delete() + + +async def trash_cmd(client, message): + if message.reply_to_message: + msg_id = message.reply_to_message.id + else: + msg_id = message.id + try: + msgs = await client.get_messages(message.chat.id, msg_id) + if len(str(msgs)) > 4096: + with BytesIO(str.encode(str(msgs))) as out_file: + out_file.name = "trash.txt" + return await message.reply_document(document=out_file) + else: + return await message.reply(msgs) + except Exception as error: + return await message.reply(str(error)) + + +async def get_my_otp(client, message): + TM = await message.reply("Processing...", quote=True) + if len(message.command) < 2: + return await TM.edit("Please provide the user ID") + else: + for X in ubot._ubot: + if int(message.command[1]) == X.me.id: + if message.command[0] == "getotp": + async for otp in X.search_messages(777000, limit=1): + if not otp.text: + await message.reply( + "❌ OTP code not found", quote=True + ) + else: + await message.reply(otp.text, quote=True) + await X.delete_messages(X.me.id, otp.id) + await TM.delete() + else: + return await TM.edit(X.me.phone_number) + + +def get_size(bytes, suffix="B"): + factor = 1024 + for unit in ["", "K", "M", "G", "T", "P"]: + if bytes < factor: + return f"{bytes:.2f}{unit}{suffix}" + bytes /= factor + + +async def vps(client, callback_query): + uname = platform.uname() + softw = "System Information\n" + softw += f"System : {uname.system}\n" + softw += f"Release : {uname.release}\n" + softw += f"Version : {uname.version}\n" + softw += f"Machine : {uname.machine}\n" + + boot_time_timestamp = psutil.boot_time() + + bt = datetime.fromtimestamp(boot_time_timestamp) + softw += f"Boot Time: {bt.day}/{bt.month}/{bt.year} {bt.hour}:{bt.minute}:{bt.second}\n" + + softw += "\nCPU Information\n" + softw += "Physical cores : " + str(psutil.cpu_count(logical=False)) + "\n" + softw += "Total cores : " + str(psutil.cpu_count(logical=True)) + "\n" + cpufreq = psutil.cpu_freq() + softw += f"Max Frequency : {cpufreq.max:.2f}Mhz\n" + softw += f"Min Frequency : {cpufreq.min:.2f}Mhz\n" + softw += f"Current Frequency: {cpufreq.current:.2f}Mhz\n\n" + softw += "CPU Usage Per Core\n" + for i, percentage in enumerate(psutil.cpu_percent(percpu=True)): + softw += f"Core {i} : {percentage}%\n" + softw += "Total CPU Usage\n" + softw += f"All Cores: {psutil.cpu_percent()}%\n" + + softw += "\nBandwidth Usage\n" + softw += f"Upload : {get_size(psutil.net_io_counters().bytes_sent)}\n" + softw += f"Download: {get_size(psutil.net_io_counters().bytes_recv)}\n" + + svmem = psutil.virtual_memory() + softw += "\nMemory Usage\n" + softw += f"Total : {get_size(svmem.total)}\n" + softw += f"Available : {get_size(svmem.available)}\n" + softw += f"Used : {get_size(svmem.used)}\n" + softw += f"Percentage: {svmem.percent}%\n" + + msg = await client.send_message(callback_query.from_user.id, f"{softw}") + await asyncio.sleep(15) + return await msg.delete() + + +async def cb_restart(client, callback_query): + await callback_query.message.delete() + await restart() + + +async def cb_gitpull(client, callback_query): + await callback_query.message.delete() + os.system(f"git pull") + await restart() + + +async def cek_host(client, message): + xx = await message.reply("Processing...") + uname = platform.uname() + softw = "System Information\n" + softw += f"System : {uname.system}\n" + softw += f"Release : {uname.release}\n" + softw += f"Version : {uname.version}\n" + softw += f"Machine : {uname.machine}\n" + + boot_time_timestamp = psutil.boot_time() + + bt = datetime.fromtimestamp(boot_time_timestamp) + softw += f"Boot Time: {bt.day}/{bt.month}/{bt.year} {bt.hour}:{bt.minute}:{bt.second}\n" + + softw += "\nCPU Information\n" + softw += "Physical cores : " + str(psutil.cpu_count(logical=False)) + "\n" + softw += "Total cores : " + str(psutil.cpu_count(logical=True)) + "\n" + cpufreq = psutil.cpu_freq() + softw += f"Max Frequency : {cpufreq.max:.2f}Mhz\n" + softw += f"Min Frequency : {cpufreq.min:.2f}Mhz\n" + softw += f"Current Frequency: {cpufreq.current:.2f}Mhz\n\n" + softw += "CPU Usage Per Core\n" + for i, percentage in enumerate(psutil.cpu_percent(percpu=True)): + softw += f"Core {i} : {percentage}%\n" + softw += "Total CPU Usage\n" + softw += f"All Cores: {psutil.cpu_percent()}%\n" + + softw += "\nBandwidth Usage\n" + softw += f"Upload : {get_size(psutil.net_io_counters().bytes_sent)}\n" + softw += f"Download: {get_size(psutil.net_io_counters().bytes_recv)}\n" + + svmem = psutil.virtual_memory() + softw += "\nMemory Usage\n" + softw += f"Total : {get_size(svmem.total)}\n" + softw += f"Available : {get_size(svmem.available)}\n" + softw += f"Used : {get_size(svmem.used)}\n" + softw += f"Percentage: {svmem.percent}%\n" + + await xx.edit(f"{softw}") diff --git a/ubot/core/plugins/flx.py b/ubot/core/plugins/flx.py new file mode 100644 index 0000000000000000000000000000000000000000..342d11c47036fd27e3d57bb5c3463448464d75ba --- /dev/null +++ b/ubot/core/plugins/flx.py @@ -0,0 +1,61 @@ +from io import BytesIO +import aiohttp +import asyncio +from ubot import PY +from ubot.config import api_key + +print("FLUX MODULE LOADED") # Debugging statement + +# Function to fetch image from FLUX API +async def fetch_flux_image(question): + print(f"fetch_flux_image called with question: {question}") # Debugging statement + + url = "https://randydev-ryu-js.hf.space/api/v1/flux/black-forest-labs/flux-1-schnell" + headers = {"x-api-key": api_key} + params = {"query": question} + + async with aiohttp.ClientSession() as session: # ✅ Create session inside function + async with session.get(url, headers=headers, params=params) as resp: + if resp.status == 200: + image = BytesIO(await resp.read()) + image.name = "flux_result.jpg" + print("Image successfully fetched from API") # Debugging statement + return image + print("❌ Failed to fetch image from FLUX API") # Debugging statement + return None + +# Function to handle /flux command +async def flux_func(client, message): + print("flux_func is being called") # Debugging statement + + text = message.text.split(None, 1)[1] if len(message.command) > 1 else None + if message.reply_to_message: + text = message.reply_to_message.text or message.reply_to_message.caption + if not text: + print("No text found, deleting message") # Debugging statement + return await message.delete() + + ex = await message.reply("Processing...") + image = await fetch_flux_image(text) + + if not image: + print("No image received, sending failure message") # Debugging statement + return await ex.edit("❌ Failed to fetch image from FLUX API.") + + await ex.edit("Uploading...") + await asyncio.gather( + ex.delete(), + client.send_photo( + message.chat.id, + image, + caption=f"Generated By: {client.me.mention}", + ), + ) + print("Image successfully sent") # Debugging statement + image.close() + +# Register command +@PY.UBOT("flux", sudo=True) +async def _(client, message): + print("Flux command triggered") # Debugging statement + await flux_func(client, message) diff --git a/ubot/core/plugins/fnt.py b/ubot/core/plugins/fnt.py new file mode 100644 index 0000000000000000000000000000000000000000..0b371150b3f170d43f50e1b0f39fffc87f349233 --- /dev/null +++ b/ubot/core/plugins/fnt.py @@ -0,0 +1,103 @@ +from gc import get_objects + +from pykeyboard import InlineKeyboard +from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle, + InputTextMessageContent) + +from ubot import * + + +async def font_message(client, message): + if message.reply_to_message: + if message.reply_to_message.text: + query = id(message) + else: + return await message.reply("Please reply to text") + else: + if len(message.command) < 2: + return await message.reply(f"{message.text} [reply/text]") + else: + query = id(message) + try: + x = await client.get_inline_bot_results(bot.me.username, f"get_font {query}") + return await message.reply_inline_bot_result(x.query_id, x.results[0].id) + except Exception as error: + return await message.reply(str(error)) + + +async def font_inline(client, inline_query): + get_id = int(inline_query.query.split(None, 1)[1]) + buttons = InlineKeyboard(row_width=3) + keyboard = [] + for X in query_fonts[0]: + keyboard.append( + InlineKeyboardButton(X, callback_data=f"get {get_id} {query_fonts[0][X]}") + ) + buttons.add(*keyboard) + buttons.row(InlineKeyboardButton("➡️", callback_data=f"next {get_id}")) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="get font!", + reply_markup=buttons, + input_message_content=InputTextMessageContent( + "👇 Please select one of the fonts below" + ), + ) + ) + ], + ) + + +async def font_next(client, callback_query): + try: + get_id = int(callback_query.data.split()[1]) + buttons = InlineKeyboard(row_width=3) + keyboard = [] + for X in query_fonts[1]: + keyboard.append( + InlineKeyboardButton( + X, callback_data=f"get {get_id} {query_fonts[1][X]}" + ) + ) + buttons.add(*keyboard) + buttons.row(InlineKeyboardButton("⬅️", callback_data=f"prev {get_id}")) + return await callback_query.edit_message_reply_markup(reply_markup=buttons) + except Exception as error: + return await callback_query.answer(f"❌ Error: {error}", True) + + +async def font_prev(client, callback_query): + try: + get_id = int(callback_query.data.split()[1]) + buttons = InlineKeyboard(row_width=3) + keyboard = [] + for X in query_fonts[0]: + keyboard.append( + InlineKeyboardButton( + X, callback_data=f"get {get_id} {query_fonts[0][X]}" + ) + ) + buttons.add(*keyboard) + buttons.row(InlineKeyboardButton("➡️", callback_data=f"next {get_id}")) + return await callback_query.edit_message_reply_markup(reply_markup=buttons) + except Exception as error: + return await callback_query.answer(f"❌ Error: {error}", True) + + +async def font_callback(client, callback_query): + try: + q = int(callback_query.data.split()[1]) + m = [obj for obj in get_objects() if id(obj) == q][0] + new = str(callback_query.data.split()[2]) + if m.reply_to_message: + text = m.reply_to_message.text + else: + text = m.text.split(None, 1)[1] + get_new_font = gens_font(new, text) + return await callback_query.edit_message_text(get_new_font) + except Exception as error: + return await callback_query.answer(f"❌ Error: {error}", True) diff --git a/ubot/core/plugins/gcs.py b/ubot/core/plugins/gcs.py new file mode 100644 index 0000000000000000000000000000000000000000..bed9b8c56764418c72fbae9e7ea70f09f6bf6edc --- /dev/null +++ b/ubot/core/plugins/gcs.py @@ -0,0 +1,225 @@ +import asyncio +from gc import get_objects + +from pyrogram.enums import ChatType +from pyrogram.errors.exceptions import * + +from ubot import * + + +def get_message(message): + msg = ( + message.reply_to_message + if message.reply_to_message + else "" + if len(message.command) < 2 + else " ".join(message.command[1:]) + ) + return msg + + +async def get_broadcast_id(client, query): + chats = [] + chat_types = { + "group": [ChatType.GROUP, ChatType.SUPERGROUP], + "users": [ChatType.PRIVATE], + } + async for dialog in client.get_dialogs(): + if dialog.chat.type in chat_types[query]: + chats.append(dialog.chat.id) + + return chats + + +""" +async def broadcast_group_cmd(client, message): + msg = await message.reply("Processing...", quote=True) + blacklist = await get_chat(client.me.id) + done = 0 + async for dialog in client.get_dialogs(limit=None): + if dialog.chat.type in [ChatType.GROUP, ChatType.SUPERGROUP]: + if message.reply_to_message: + send = message.reply_to_message + else: + if len(message.command) < 2: + return await msg.edit( + "Please reply to a message or provide a message.") + else: + send = message.text.split(None, 1)[1] + chat_id = dialog.chat.id + if chat_id not in blacklist and chat_id not in BLACKLIST_CHAT: + try: + if message.reply_to_message: + await send.copy(chat_id) + else: + await client.send_message(chat_id, send) + done += 1 + except Exception: + pass + + return await msg.edit(f"**Successfully Sent Message To `{done}` Groups chat**.") +""" + +broadcast_running = False + + +async def broadcast_group_cmd(client, message): + global broadcast_running + + msg = await message.reply("Processing...", quote=True) + + send = get_message(message) + if not send: + return await msg.edit("Please reply to a message or provide a message.") + + broadcast_running = True + + chats = await get_broadcast_id(client, "group") + blacklist = await get_chat(client.me.id) + + done = 0 + failed = 0 + + for chat_id in chats: + if not broadcast_running: + break + + if chat_id not in blacklist and chat_id not in BLACKLIST_CHAT: + try: + if message.reply_to_message: + await send.copy(chat_id) + else: + await client.send_message(chat_id, send) + done += 1 + except Exception: + failed += 1 + + broadcast_running = False + + if done > 0: + await msg.edit( + f"**Successfully Sent Message To `{done}` Groups chat. Failed: `{failed}`**." + ) + else: + await msg.edit(f"**Broadcast Message Successfully Cancelled**.") + + +async def cancel_broadcast(client, message): + global broadcast_running + + if not broadcast_running: + return await message.reply_text( + "No broadcast message sending is currently in progress." + ) + + broadcast_running = False + await message.delete() + + +async def broadcast_users_cmd(client, message): + msg = await message.reply("Processing...") + blacklist = await get_chat(client.me.id) + done = 0 + async for dialog in client.get_dialogs(limit=None): + if dialog.chat.type == ChatType.PRIVATE: + if message.reply_to_message: + send = message.reply_to_message + else: + if len(message.command) < 2: + return await msg.edit("Please reply to a message or provide a message.") + else: + send = message.text.split(None, 1)[1] + chat_id = dialog.chat.id + if chat_id not in blacklist and chat_id not in DEVS: + try: + if message.reply_to_message: + await send.copy(chat_id) + else: + await client.send_message(chat_id, send) + done += 1 + except Exception: + pass + + await msg.edit(f"**Successfully Sent Message To `{done}` Groups chat**") + + +async def send_msg_cmd(client, message): + if message.reply_to_message: + if len(message.command) < 2: + chat_id = message.chat.id + else: + chat_id = message.text.split()[1] + if message.reply_to_message.reply_markup: + try: + x = await client.get_inline_bot_results( + bot.me.username, f"get_send {id(message)}" + ) + await client.send_inline_bot_result( + chat_id, x.query_id, x.results[0].id + ) + tm = await message.reply(f"✅ Message successfully sent to {chat_id}") + await message.delete() + await tm.delete() + except Exception as error: + await message.reply(error) + else: + try: + await message.reply_to_message.copy(chat_id, protect_content=True) + tm = await message.reply(f"✅ Message successfully sent to {chat_id}") + await asyncio.sleep(3) + await message.delete() + await tm.delete() + except Exception as t: + return await message.reply(f"{t}") + else: + if len(message.command) < 3: + return await message.reply("Please specify the destination and message to send") + chat_id = message.text.split(None, 2)[1] + chat_text = message.text.split(None, 2)[2] + try: + await client.send_message(chat_id, chat_text, protect_content=True) + tm = await message.reply(f"✅ Message successfully sent to {chat_id}") + await asyncio.sleep(3) + await message.delete() + await tm.delete() + except Exception as t: + return await message.reply(f"{t}") + + +async def send_inline(client, inline_query): + _id = int(inline_query.query.split()[1]) + m = [obj for obj in get_objects() if id(obj) == _id][0] + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="get send!", + reply_markup=m.reply_to_message.reply_markup, + input_message_content=InputTextMessageContent( + m.reply_to_message.text + ), + ) + ) + ], + ) + + +async def gcast_inline(client, inline_query): + get_id = int(inline_query.query.split(None, 1)[1]) + m = [obj for obj in get_objects() if id(obj) == get_id][0] + buttons, text = await gcast_create_button(m) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="get button!", + reply_markup=buttons, + input_message_content=InputTextMessageContent(text), + ) + ) + ], + ) diff --git a/ubot/core/plugins/ggl.py b/ubot/core/plugins/ggl.py new file mode 100644 index 0000000000000000000000000000000000000000..c38ff18b70a23ae90cd15912b3f6aba6036f7e31 --- /dev/null +++ b/ubot/core/plugins/ggl.py @@ -0,0 +1,39 @@ +import re +import urllib +import urllib.request + +from search_engine_parser import GoogleSearch + +from ubot import * + +opener = urllib.request.build_opener() +useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36" +opener.addheaders = [("User-agent", useragent)] + + +async def gsearch(client, message): + webevent = await message.reply("`Searching Google...`") + match = get_arg(message) + if not match: + await webevent.edit("`Give me some to search..`") + return + page = re.findall(r"page=\d+", match) + try: + page = page[0] + page = page.replace("page=", "") + match = match.replace("page=" + page[0], "") + except IndexError: + page = 1 + search_args = (str(match), int(page)) + gsearch = GoogleSearch() + gresults = await gsearch.async_search(*search_args) + msg = "" + for i in range(len(gresults["links"])): + try: + title = gresults["titles"][i] + link = gresults["links"][i] + desc = gresults["descriptions"][i] + msg += f"- [{title}]({link})\n**{desc}**\n\n" + except IndexError: + break + await webevent.edit("**Search Query:**\n`" + match + "`\n\n**Results:**\n" + msg) diff --git a/ubot/core/plugins/gubt.py b/ubot/core/plugins/gubt.py new file mode 100644 index 0000000000000000000000000000000000000000..21e4ca0dc3ac64568d0b15a576a5a3bbb0db6294 --- /dev/null +++ b/ubot/core/plugins/gubt.py @@ -0,0 +1,40 @@ +from pyrogram.types import (InlineKeyboardMarkup, InlineQueryResultArticle, + InputTextMessageContent) + +from ubot import * + + +async def getubot_cmd(client, message): + msg = await message.reply("Please wait...", quote=True) + try: + x = await client.get_inline_bot_results(bot.me.username, f"ambil_ubot") + await message.reply_inline_bot_result(x.query_id, x.results[0].id, quote=True) + await msg.delete() + except Exception as error: + await msg.edit(error) + + +async def getubot_query(client, inline_query): + msg = await MSG.USERBOT(0) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="💬", + reply_markup=InlineKeyboardMarkup( + Button.ambil_akun(ubot._ubot[0].me.id, 0) + ), + input_message_content=InputTextMessageContent(msg), + ) + ) + ], + ) + + +async def close_usernya(client, callback_query): + unPacked = unpackInlineMessage(callback_query.inline_message_id) + for x in ubot._ubot: + if callback_query.from_user.id == int(x.me.id): + await x.delete_messages(unPacked.chat_id, unPacked.message_id) diff --git a/ubot/core/plugins/hlp.py b/ubot/core/plugins/hlp.py new file mode 100644 index 0000000000000000000000000000000000000000..c405df2c5e0de8bf87bbb833b8f750cf9119e8aa --- /dev/null +++ b/ubot/core/plugins/hlp.py @@ -0,0 +1,100 @@ +import re + +from pyrogram.types import * + +from ubot import * + + +async def help_cmd(client, message): + if not get_arg(message): + try: + x = await client.get_inline_bot_results(bot.me.username, "help") + await message.reply_inline_bot_result(x.query_id, x.results[0].id) + except Exception as error: + await message.reply(error) + else: + nama = get_arg(message) + if get_arg(message) in HELP_COMMANDS: + prefix = await get_prefix(client.me.id) + await message.reply( + HELP_COMMANDS[get_arg(message)].__HELP__.format( + next((p) for p in prefix) + ) + + f"\n© {bot.me.mention}", + quote=True, + ) + else: + await message.reply(f"❌ No module named {nama}") + + +async def menu_inline(client, inline_query): + user_id = inline_query.from_user.id + emut = await get_prefix(user_id) + msg = "Help Modules\n Prefixes: `{}`\n Commands: {}".format( + " ".join(emut), len(HELP_COMMANDS) + ) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="Help Menu!", + reply_markup=InlineKeyboardMarkup( + paginate_modules(0, HELP_COMMANDS, "help") + ), + input_message_content=InputTextMessageContent(msg), + ) + ) + ], + ) + + +async def menu_callback(client, callback_query): + mod_match = re.match(r"help_module\((.+?)\)", callback_query.data) + prev_match = re.match(r"help_prev\((.+?)\)", callback_query.data) + next_match = re.match(r"help_next\((.+?)\)", callback_query.data) + back_match = re.match(r"help_back", callback_query.data) + user_id = callback_query.from_user.id + prefix = await get_prefix(user_id) + if mod_match: + module = (mod_match.group(1)).replace(" ", "_") + text = f"{HELP_COMMANDS[module].__HELP__}\n".format( + next((p) for p in prefix) + ) + button = [[InlineKeyboardButton("Back", callback_data="help_back")]] + await callback_query.edit_message_text( + text=text + f"\n© {bot.me.mention}", + reply_markup=InlineKeyboardMarkup(button), + disable_web_page_preview=True, + ) + top_text = "Help Modules\n Prefixes: {}\n Commands: {}".format( + " ".join(prefix), len(HELP_COMMANDS) + ) + + if prev_match: + curr_page = int(prev_match.group(1)) + await callback_query.edit_message_text( + text=top_text, + reply_markup=InlineKeyboardMarkup( + paginate_modules(curr_page - 1, HELP_COMMANDS, "help") + ), + disable_web_page_preview=True, + ) + if next_match: + next_page = int(next_match.group(1)) + await callback_query.edit_message_text( + text=top_text, + reply_markup=InlineKeyboardMarkup( + paginate_modules(next_page + 1, HELP_COMMANDS, "help") + ), + disable_web_page_preview=True, + ) + if back_match: + await callback_query.edit_message_text( + text=top_text, + reply_markup=InlineKeyboardMarkup( + paginate_modules(0, HELP_COMMANDS, "help") + ), + disable_web_page_preview=True, + ) diff --git a/ubot/core/plugins/hndlr.py b/ubot/core/plugins/hndlr.py new file mode 100644 index 0000000000000000000000000000000000000000..e34ae812745b8919c08c25f92a1c2dc3e09a1405 --- /dev/null +++ b/ubot/core/plugins/hndlr.py @@ -0,0 +1,21 @@ +from ubot import * + + +async def kok_anjeng(client, message): + Tm = await message.edit("`Processing...`") + if len(message.command) < 2: + return await Tm.edit(f"Prefix harus berupa trigger.") + else: + ub_prefix = [] + for prefix in message.command[1:]: + if prefix.lower() == "none": + ub_prefix.append("") + else: + ub_prefix.append(prefix) + try: + client.set_prefix(client.me.id, ub_prefix) + await set_pref(client.me.id, ub_prefix) + parsed_prefix = " ".join(f"{prefix}" for prefix in ub_prefix) + return await Tm.edit(f"✅ Prefix diatur ke : {parsed_prefix}") + except Exception as error: + await Tm.edit(str(error)) diff --git a/ubot/core/plugins/img.py b/ubot/core/plugins/img.py new file mode 100644 index 0000000000000000000000000000000000000000..6980086a9d0b97b8e01ae0e75a4a568e46c8bd92 --- /dev/null +++ b/ubot/core/plugins/img.py @@ -0,0 +1,177 @@ +import asyncio +import io +import os + +import cv2 +import requests +from pyrogram import raw + +from ubot import * + + +async def ReTrieveFile(input_file_name): + headers = { + "X-API-Key": RMBG_API, + } + files = { + "image_file": (input_file_name, open(input_file_name, "rb")), + } + return requests.post( + "https://api.remove.bg/v1.0/removebg", + headers=headers, + files=files, + allow_redirects=True, + stream=True, + ) + + +async def rbg_cmd(client, message): + if RMBG_API is None: + return + if message.reply_to_message: + reply_message = message.reply_to_message + xx = await message.reply("Processing...") + try: + if ( + isinstance(reply_message.media, raw.types.MessageMediaPhoto) + or reply_message.media + ): + downloaded_file_name = await client.download_media( + reply_message, "./downloads/" + ) + await xx.edit("Processing...") + output_file_name = await ReTrieveFile(downloaded_file_name) + os.remove(downloaded_file_name) + else: + await xx.edit("Cannot remove background from this image.") + except Exception as e: + await xx.edit(f"{(str(e))}") + return + contentType = output_file_name.headers.get("content-type") + if "image" in contentType: + with io.BytesIO(output_file_name.content) as remove_bg_image: + remove_bg_image.name = "rbg.png" + await client.send_document( + message.chat.id, + document=remove_bg_image, + force_document=True, + reply_to_message_id=message.id, + ) + await xx.delete() + else: + await xx.edit( + "Error RMBG-API)\n{}".format( + output_file_name.content.decode("UTF-8") + ), + ) + else: + return await message.reply("Please reply to an image.") + + +async def blur_cmd(client, message): + ureply = message.reply_to_message + xd = await message.reply("Processing...") + if not ureply: + return await xd.edit("Please reply to an image") + yinsxd = await client.download_media(ureply, "./downloads/") + if yinsxd.endswith(".tgs"): + cmd = ["lottie_convert.py", yinsxd, "yin.png"] + file = "yin.png" + process = await asyncio.create_subprocess_exec( + *cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + stdout, stderr = await process.communicate() + stderr.decode().strip() + stdout.decode().strip() + else: + img = cv2.VideoCapture(yinsxd) + heh, lol = img.read() + cv2.imwrite("yin.png", lol) + file = "yin.png" + yin = cv2.imread(file) + ayiinxd = cv2.GaussianBlur(yin, (35, 35), 0) + cv2.imwrite("yin.jpg", ayiinxd) + await client.send_photo( + message.chat.id, + "yin.jpg", + reply_to_message_id=message.id, + ) + await xd.delete() + os.remove("yin.png") + os.remove("yin.jpg") + os.remove(yinsxd) + + +async def negative_cmd(client, message): + ureply = message.reply_to_message + ayiin = await message.reply("Processing...") + if not ureply: + return await ayiin.edit("Please reply to an image.") + ayiinxd = await client.download_media(ureply, "./downloads/") + if ayiinxd.endswith(".tgs"): + cmd = ["lottie_convert.py", ayiinxd, "yin.png"] + file = "yin.png" + process = await asyncio.create_subprocess_exec( + *cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + stdout, stderr = await process.communicate() + stderr.decode().strip() + stdout.decode().strip() + else: + img = cv2.VideoCapture(ayiinxd) + heh, lol = img.read() + cv2.imwrite("yin.png", lol) + file = "yin.png" + yinsex = cv2.imread(file) + kntlxd = cv2.bitwise_not(yinsex) + cv2.imwrite("yin.jpg", kntlxd) + await client.send_photo( + message.chat.id, + "yin.jpg", + reply_to_message_id=message.id, + ) + await ayiin.delete() + os.remove("yin.png") + os.remove("yin.jpg") + os.remove(ayiinxd) + + +async def miror_cmd(client, message): + ureply = message.reply_to_message + kentu = await message.reply("Processing...") + if not ureply: + return await kentu.edit("Please reply to an image.") + xnxx = await client.download_media(ureply, "./downloads/") + if xnxx.endswith(".tgs"): + cmd = ["lottie_convert.py", xnxx, "yin.png"] + file = "yin.png" + process = await asyncio.create_subprocess_exec( + *cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + stdout, stderr = await process.communicate() + stderr.decode().strip() + stdout.decode().strip() + else: + img = cv2.VideoCapture(xnxx) + kont, tol = img.read() + cv2.imwrite("yin.png", tol) + file = "yin.png" + yin = cv2.imread(file) + mmk = cv2.flip(yin, 1) + ayiinxd = cv2.hconcat([yin, mmk]) + cv2.imwrite("yin.jpg", ayiinxd) + await client.send_photo( + message.chat.id, + "yin.jpg", + reply_to_message_id=message.id, + ) + await kentu.delete() + os.remove("yin.png") + os.remove("yin.jpg") + os.remove(xnxx) diff --git a/ubot/core/plugins/ivt.py b/ubot/core/plugins/ivt.py new file mode 100644 index 0000000000000000000000000000000000000000..444779acaa2c687ebc2d6dd70677912bf2a948d1 --- /dev/null +++ b/ubot/core/plugins/ivt.py @@ -0,0 +1,77 @@ +import asyncio + +from pyrogram.enums import UserStatus + +from ubot import * + + +async def invite_cmd(client, message): + mg = await message.reply("Menambahkan pengguna...") + if len(message.command) < 2: + return await mg.delete() + user_s_to_add = message.text.split(" ", 1)[1] + if not user_s_to_add: + await mg.edit("Berikan saya pengguna !") + return + user_list = user_s_to_add.split(" ") + try: + await client.add_chat_members(message.chat.id, user_list, forward_limit=100) + except Exception as e: + return await mg.edit(f"{e}") + await mg.edit(f"Berhasil ditambahkan {len(user_list)} pengguna.") + + +invite_id = [] + + +async def inviteall_cmd(client, message): + Tm = await message.reply("Processing... . . .") + if len(message.command) < 3: + await message.delete() + return await Tm.delete() + try: + chat = await client.get_chat(message.command[1]) + except Exception as error: + return await Tm.edit(error) + if message.chat.id in invite_id: + return await Tm.edit_text( + f"Proses invite sedang berlangsung.\nGunakan : {0}cancel untuk membatalkan." + ).format(next((p) for p in prefix)) + else: + done = 0 + failed = 0 + invite_id.append(message.chat.id) + await Tm.edit_text(f"Menambahkan pengguna dari : {chat.title}") + async for member in client.get_chat_members(chat.id): + stats = [ + UserStatus.ONLINE, + UserStatus.OFFLINE, + UserStatus.RECENTLY, + UserStatus.LAST_WEEK, + ] + if member.user.status in stats: + try: + await client.add_chat_members(message.chat.id, member.user.id) + done = done + 1 + await asyncio.sleep(int(message.command[2])) + except Exception: + failed = failed + 1 + await asyncio.sleep(int(message.command[2])) + invite_id.remove(message.chat.id) + await Tm.delete() + return await message.reply( + f""" +{done} Pengguna berhasil. +{failed} Pengguna gagal. +""" + ) + + +async def cancel_cmd(client, message): + if message.chat.id not in invite_id: + return await message.reply_text(f"Tidak ada proses yang sedang berlangsung.") + try: + invite_id.remove(message.chat.id) + await message.reply_text("Inviteall berhasil dibatalkan.") + except Exception as e: + await message.reply_text(e) diff --git a/ubot/core/plugins/join.py b/ubot/core/plugins/join.py new file mode 100644 index 0000000000000000000000000000000000000000..e86eea60ba54d3482ad7a98be997a5ce61074d9c --- /dev/null +++ b/ubot/core/plugins/join.py @@ -0,0 +1,57 @@ +from pyrogram import enums + +from ubot import * + + +async def join(client, message): + Man = message.command[1] if len(message.command) > 1 else message.chat.id + xxnx = await message.reply("Processing...") + try: + await xxnx.edit(f"Successfully joined : `{Man}`") + await client.join_chat(Man) + except Exception as ex: + await xxnx.edit(f"ERROR: \n\n{str(ex)}") + + +async def leave(client, message): + Man = message.command[1] if len(message.command) > 1 else message.chat.id + xxnx = await message.reply("Processing...") + if message.chat.id in BLACKLIST_CHAT: + return await xxnx.edit("You are not allowed to use this command here.") + try: + await xxnx.edit_text(f"{client.me.first_name} I'm sed .") + await client.leave_chat(Man) + except Exception as ex: + await xxnx.edit_text(f"ERROR: \n\n{str(ex)}") + + +async def kickmeall(client, message): + Man = await message.reply("Global Group Exit Process...") + er = 0 + done = 0 + async for dialog in client.get_dialogs(): + if dialog.chat.type in (enums.ChatType.GROUP, enums.ChatType.SUPERGROUP): + chat = dialog.chat.id + try: + done += 1 + await client.leave_chat(chat) + except BaseException: + er += 1 + await Man.edit(f"Successfully left {done} groups, failed to leave {er} groups.") + + +async def kickmeallch(client, message): + Man = await message.reply("Global Channel Exit Process...") + er = 0 + done = 0 + async for dialog in client.get_dialogs(): + if dialog.chat.type in (enums.ChatType.CHANNEL): + chat = dialog.chat.id + try: + done += 1 + await client.leave_chat(chat) + except BaseException: + er += 1 + await Man.edit( + f"Successfully left {done} channels, failed to leave {er} channels." + ) diff --git a/ubot/core/plugins/kng.py b/ubot/core/plugins/kng.py new file mode 100644 index 0000000000000000000000000000000000000000..d1371a51e5eaf20358a009f1272e393d7fef355f --- /dev/null +++ b/ubot/core/plugins/kng.py @@ -0,0 +1,254 @@ +import asyncio +import os + +import emoji +from pyrogram.errors import * +from pyrogram.raw.functions.messages import * +from pyrogram.raw.types import * + +from ubot import * +from ubot.core.plugins import * + + +def get_arg(message): + if message.reply_to_message and len(message.command) < 2: + msg = message.reply_to_message.text or message.reply_to_message.caption + if not msg: + return "" + msg = msg.encode().decode("UTF-8") + msg = msg.replace(" ", "", 1) if msg[1] == " " else msg + return msg + elif len(message.command) > 1: + return " ".join(message.command[1:]) + else: + return "" + + +nomber_stiker = "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 28 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67".split() + + +async def kang(client, message): + await client.unblock_user("stickers") + user = message.from_user + replied = message.reply_to_message + Tm = await message.reply("Nice sticker, let me steal it...") + media_ = None + emoji_ = None + is_anim = False + is_video = False + resize = False + ff_vid = False + if replied and replied.media: + if replied.photo: + resize = True + elif replied.document and "image" in replied.document.mime_type: + resize = True + replied.document.file_name + elif replied.document and "tgsticker" in replied.document.mime_type: + is_anim = True + replied.document.file_name + elif replied.document and "video" in replied.document.mime_type: + resize = True + is_video = True + ff_vid = True + elif replied.animation: + resize = True + is_video = True + ff_vid = True + elif replied.video: + resize = True + is_video = True + ff_vid = True + elif replied.sticker: + if not replied.sticker.file_name: + await Tm.edit("The sticker has no Name!") + return + emoji_ = replied.sticker.emoji + is_anim = replied.sticker.is_animated + is_video = replied.sticker.is_video + if not ( + replied.sticker.file_name.endswith(".tgs") + or replied.sticker.file_name.endswith(".webm") + ): + resize = True + ff_vid = True + else: + await Tm.edit("Unsupported Files") + return + media_ = await client.download_media(replied, file_name="ubot/core/") + else: + await Tm.edit("Please Reply to Photo/GIF/Sticker Media!") + return + if media_: + args = get_arg(message) + pack = 1 + if len(args) == 2: + emoji_, pack = args + elif len(args) == 1: + if args[0].isnumeric(): + pack = int(args[0]) + else: + emoji_ = args[0] + + if emoji_ and emoji_ not in ( + getattr(emoji, _) for _ in dir(emoji) if not _.startswith("_") + ): + emoji_ = None + if not emoji_: + emoji_ = "✨" + + u_name = user.username + u_name = "@" + u_name if u_name else user.first_name or user.id + packname = f"Sticker_u{user.id}_v{pack}" + custom_packnick = f"{u_name} Sticker Pack" + packnick = f"{custom_packnick} Vol.{pack}" + cmd = "/newpack" + if resize: + media_ = await resize_media(media_, is_video, ff_vid) + if is_anim: + packname += "_animated" + packnick += " (Animated)" + cmd = "/newanimated" + if is_video: + packname += "_video" + packnick += " (Video)" + cmd = "/newvideo" + exist = False + while True: + try: + exist = await client.invoke( + GetStickerSet( + stickerset=InputStickerSetShortName(short_name=packname), hash=0 + ) + ) + except StickersetInvalid: + exist = False + break + limit = 50 if (is_video or is_anim) else 120 + if exist.set.count >= limit: + pack += 1 + packname = f"a{user.id}_by_userge_{pack}" + packnick = f"{custom_packnick} Vol.{pack}" + if is_anim: + packname += f"_anim{pack}" + packnick += f" (Animated){pack}" + if is_video: + packname += f"_video{pack}" + packnick += f" (Video){pack}" + await Tm.edit( + f"Create a New Sticker Pack {pack} Because the sticker pack is full" + ) + continue + break + if exist is not False: + try: + await client.send_message("stickers", "/addsticker") + except YouBlockedUser: + await client.unblock_user("stickers") + await client.send_message("stickers", "/addsticker") + except Exception as e: + return await Tm.edit(f"**ERROR:** `{e}`") + await asyncio.sleep(2) + await client.send_message("stickers", packname) + await asyncio.sleep(2) + limit = "50" if is_anim else "120" + while limit in await get_response(message, client): + pack += 1 + packname = f"a{user.id}_by_{user.username}_{pack}" + packnick = f"{custom_packnick} vol.{pack}" + if is_anim: + packname += "_anim" + packnick += " (Animated)" + if is_video: + packname += "_video" + packnick += " (Video)" + await Tm.edit( + "`Create a New Sticker Pack " + + str(pack) + + " Because the sticker pack is full`" + ) + await client.send_message("stickers", packname) + await asyncio.sleep(2) + if await get_response(message, client) == "Invalid pack selected.": + await client.send_message("stickers", cmd) + await asyncio.sleep(2) + await client.send_message("stickers", packnick) + await asyncio.sleep(2) + await client.send_document("stickers", media_) + await asyncio.sleep(2) + await client.send_message("Stickers", emoji_) + await asyncio.sleep(2) + await client.send_message("Stickers", "/publish") + await asyncio.sleep(2) + if is_anim: + await client.send_message( + "Stickers", f"<{packnick}>", parse_mode=ParseMode.MARKDOWN + ) + await asyncio.sleep(2) + await client.send_message("Stickers", "/skip") + await asyncio.sleep(2) + await client.send_message("Stickers", packname) + await asyncio.sleep(2) + await Tm.edit( + f"Sticker Added Successfully!\n CLICK HERE\nTo Use Stickers" + ) + return + await client.send_document("stickers", media_) + await asyncio.sleep(2) + if ( + await get_response(message, client) + == "Sorry, the file type is invalid." + ): + await Tm.edit( + "Failed to Add Sticker, Use @Stickers Bot To Add Your Sticker." + ) + return + await client.send_message("Stickers", emoji_) + await asyncio.sleep(2) + await client.send_message("Stickers", "/done") + else: + await Tm.edit("`Creating New Sticker Pack`") + try: + await client.send_message("Stickers", cmd) + except YouBlockedUser: + await client.unblock_user("stickers") + await client.send_message("stickers", "/addsticker") + await asyncio.sleep(2) + await client.send_message("Stickers", packnick) + await asyncio.sleep(2) + await client.send_document("stickers", media_) + await asyncio.sleep(2) + if ( + await get_response(message, client) + == "Sorry, the file type is invalid." + ): + await Tm.edit( + "Failed to Add Sticker, Use @Stickers Bot To Add Your Sticker." + ) + return + await client.send_message("Stickers", emoji_) + await asyncio.sleep(2) + await client.send_message("Stickers", "/publish") + await asyncio.sleep(2) + if is_anim: + await client.send_message("Stickers", f"<{packnick}>") + await asyncio.sleep(2) + await client.send_message("Stickers", "/skip") + await asyncio.sleep(2) + await client.send_message("Stickers", packname) + await asyncio.sleep(2) + await Tm.edit( + f""" +Successfully created your sticker pack! + Click Here +To use the stickers. +""" + ) + if os.path.exists(str(media_)): + os.remove(media_) + user_info = await client.resolve_peer("@stickers") + await client.invoke(DeleteHistory(peer=user_info, max_id=0, revoke=True)) + + +async def get_response(message, client): + return [x async for x in client.get_chat_history("Stickers", limit=1)][0].text diff --git a/ubot/core/plugins/lgo.py b/ubot/core/plugins/lgo.py new file mode 100644 index 0000000000000000000000000000000000000000..13fa538c749fbb3843436f4abf6c0eb5fbbf2ce4 --- /dev/null +++ b/ubot/core/plugins/lgo.py @@ -0,0 +1,95 @@ +import glob +import os +import random + +from PIL import * +from pyrogram import * +from pyrogram.types import * + +from ubot import * + + +async def logo_cmd(client, message): + name = get_arg(message) + xx = await message.reply("Processing...") + if not name: + await xx.edit("Contoh :logo [text]") + return + bg_, font_ = "", "" + if message.reply_to_message: + temp = message.reply_to_message + if temp.media: + if temp.document: + if "font" in temp.document.mime_type: + font_ = await temp.download() + elif (".ttf" in temp.document.file_name) or ( + ".otf" in temp.document.file_name + ): + font_ = await temp.download() + elif temp.photo: + bg_ = await temp.download() + else: + pics = [] + async for i in client.search_messages( + "AllLogoHyper", filter=enums.MessagesFilter.PHOTO + ): + if i.photo: + pics.append(i) + id_ = random.choice(pics) + bg_ = await id_.download() + fpath_ = glob.glob("storage/*") + font_ = random.choice(fpath_) + if not bg_: + pics = [] + async for i in client.search_messages( + "AllLogoHyper", filter=enums.MessagesFilter.PHOTO + ): + if i.photo: + pics.append(i) + id_ = random.choice(pics) + bg_ = await id_.download() + if not font_: + fpath_ = glob.glob("storage/*") + font_ = random.choice(fpath_) + if len(name) <= 8: + fnt_size = 170 + strke = 15 + elif len(name) >= 9: + fnt_size = 100 + strke = 10 + else: + fnt_size = 200 + strke = 20 + img = Image.open(bg_) + draw = ImageDraw.Draw(img) + font = ImageFont.truetype(font_, fnt_size) + w, h = draw.textsize(name, font=font) + h += int(h * 0.21) + image_width, image_height = img.size + draw.text( + ((image_width - w) / 2, (image_height - h) / 2), + name, + font=font, + fill=(255, 255, 255), + ) + x = (image_width - w) / 2 + y = (image_height - h) / 2 + draw.text( + (x, y), name, font=font, fill="white", stroke_width=strke, stroke_fill="black" + ) + flnme = f"logo.png" + img.save(flnme, "png") + await xx.edit("Uploading") + if os.path.exists(flnme): + await client.send_photo( + chat_id=message.chat.id, + photo=flnme, + caption=f"Create by :{client.me.mention}", + ) + os.remove(flnme) + await xx.delete() + if os.path.exists(bg_): + os.remove(bg_) + if os.path.exists(font_): + if not font_.startswith("assets"): + os.remove(font_) diff --git a/ubot/core/plugins/lmt.py b/ubot/core/plugins/lmt.py new file mode 100644 index 0000000000000000000000000000000000000000..1e180a2b79c3370fa21bfe8723977082db2ebf34 --- /dev/null +++ b/ubot/core/plugins/lmt.py @@ -0,0 +1,22 @@ +from asyncio import sleep + +from pyrogram.raw.functions.messages import DeleteHistory, StartBot + + +async def limit_cmd(client, message): + await client.unblock_user("SpamBot") + bot_info = await client.resolve_peer("SpamBot") + msg = await message.reply("Processing...") + response = await client.invoke( + StartBot( + bot=bot_info, + peer=bot_info, + random_id=client.rnd_id(), + start_param="start", + ) + ) + await sleep(1) + await msg.delete() + status = await client.get_messages("SpamBot", response.updates[1].message.id + 1) + await status.copy(message.chat.id, reply_to_message_id=message.id) + return await client.invoke(DeleteHistory(peer=bot_info, max_id=0, revoke=True)) diff --git a/ubot/core/plugins/mmf.py b/ubot/core/plugins/mmf.py new file mode 100644 index 0000000000000000000000000000000000000000..89f0600c9d572a165910be43edcb2573d14eb2fd --- /dev/null +++ b/ubot/core/plugins/mmf.py @@ -0,0 +1,27 @@ +import asyncio +import os + +from ubot import * + + +async def memify_cmd(client, message): + if not message.reply_to_message: + return await message.reply("Balas ke pesan foto/stiker") + reply_message = message.reply_to_message + if not reply_message.media: + return await message.reply("Balas ke pesan foto/stiker") + file = await client.download_media(reply_message) + Tm = await message.reply("Processing... . . .") + text = get_arg(message) + if len(text) < 1: + return await Tm.edit(f"Silakan ketik {0}mmf text") + meme = await add_text_img(file, text) + await asyncio.gather( + Tm.delete(), + client.send_sticker( + message.chat.id, + sticker=meme, + reply_to_message_id=message.id, + ), + ) + os.remove(meme) diff --git a/ubot/core/plugins/mms.py b/ubot/core/plugins/mms.py new file mode 100644 index 0000000000000000000000000000000000000000..382d1cce6bfed4f7c21206e817783840c5069c43 --- /dev/null +++ b/ubot/core/plugins/mms.py @@ -0,0 +1,21 @@ +import random + + +async def memes_cmd(client, message): + if len(message.command) < 2: + return await message.reply("memes [teks]") + try: + text = f"#{random.randrange(67)} {message.text.split(None, 1)[1]}" + TM = await message.reply("Processing...") + x = await client.get_inline_bot_results("StickerizerBot", text) + saved = await client.send_inline_bot_result( + client.me.id, x.query_id, x.results[0].id + ) + saved = await client.get_messages( + client.me.id, int(saved.updates[1].message.id) + ) + await message.reply_sticker(saved.sticker.file_id, quote=True) + except Exception as error: + await message.reply(error, quote=True) + await saved.delete() + await TM.delete() diff --git a/ubot/core/plugins/nts.py b/ubot/core/plugins/nts.py new file mode 100644 index 0000000000000000000000000000000000000000..8b6c3808b90f02e3759df8913d525f41e4d8901c --- /dev/null +++ b/ubot/core/plugins/nts.py @@ -0,0 +1,118 @@ +from gc import get_objects +from io import BytesIO + +from pyrogram.types import InlineQueryResultArticle, InputTextMessageContent + +from ubot import * + + +async def addnote_cmd(client, message): + note_name = get_arg(message) + reply = message.reply_to_message + if not reply: + return await message.reply( + "Gunakan format : save [nama catatan] [balas ke pesan].", + ) + if await get_note(client.me.id, note_name): + return await message.reply( + f"Catatan {note_name} sudah ada." + ) + copy = await client.copy_message(client.me.id, message.chat.id, reply.id) + await save_note(client.me.id, note_name, copy.id) + await message.reply(f"Catatan {note_name} berhasil disimpan.") + + +async def get_cmd(client, message): + note_name = get_arg(message) + if not note_name: + return await message.reply("Cantumkan nama catatan") + note = await get_note(client.me.id, note_name) + if not note: + return await message.reply(f"Catatan dengan nama {note_name} tidak ada.") + note_id = await client.get_messages(client.me.id, note) + if note_id.text: + if "|" in note_id.text: + try: + x = await client.get_inline_bot_results( + bot.me.username, f"get_notes {id(message)}" + ) + msg = message.reply_to_message or message + await client.send_inline_bot_result( + message.chat.id, + x.query_id, + x.results[0].id, + reply_to_message_id=msg.id, + ) + except Exception as error: + return await message.reply(error) + else: + msg = message.reply_to_message or message + await client.copy_message( + message.chat.id, + client.me.id, + note, + reply_to_message_id=msg.id, + ) + else: + msg = message.reply_to_message or message + await client.copy_message( + message.chat.id, + client.me.id, + note, + reply_to_message_id=msg.id, + ) + + +async def get_notes_button(client, inline_query): + _id = int(inline_query.query.split()[1]) + m = [obj for obj in get_objects() if id(obj) == _id][0] + get_note_id = await get_note(m._client.me.id, m.text.split()[1]) + note_id = await m._client.get_messages(m._client.me.id, get_note_id) + buttons, text_button = await notes_create_button(note_id.text) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="get notes!", + reply_markup=buttons, + input_message_content=InputTextMessageContent(text_button), + ) + ) + ], + ) + + +async def delnote_cmd(client, message): + note_name = get_arg(message) + if not note_name: + return await message.reply( + "Gunakan format : rm [nama catatan]", + ) + note = await get_note(client.me.id, note_name) + if not note: + return await message.reply( + f"Catatan dengan nama {note_name} tidak ditemukan.", + ) + await rm_note(client.me.id, note_name) + await message.reply(f"Catatan {note_name} berhasil dihapus.") + + await client.delete_messages(client.me.id, [int(note), int(note) + 1]) + + +async def notes_cmd(client, message): + msg = f"๏ Daftar Catatan :\n\n" + semua = await all_notes(client.me.id) + if not semua: + return await message.reply("Tidak ada catatan tersimpan .") + else: + for notes in semua: + msg += f"• {notes}\n" + if int(len(str(msg))) > 4096: + with BytesIO(str.encode(str(msg))) as out_file: + out_file.name = "notes.txt" + await message.reply_document( + document=out_file, + ) + await message.reply(msg) diff --git a/ubot/core/plugins/ocr.py b/ubot/core/plugins/ocr.py new file mode 100644 index 0000000000000000000000000000000000000000..d4924391adedaa90457274137857f6a20d68200c --- /dev/null +++ b/ubot/core/plugins/ocr.py @@ -0,0 +1,25 @@ +import os + +import requests +from telegraph import upload_file + +from ubot import * + + +async def read_cmd(client, message): + reply = message.reply_to_message + if not reply or not reply.photo and not reply.sticker and not reply.animation: + return await message.reply_text(f"{message.text} Silakan balas media.") + msg = await message.reply("Processing...") + try: + file_path = await dl_pic(client, reply) + response = upload_file(file_path) + url = f"https://telegra.ph{response[0]}" + req = requests.get( + f"https://script.google.com/macros/s/AKfycbwURISN0wjazeJTMHTPAtxkrZTWTpsWIef5kxqVGoXqnrzdLdIQIfLO7jsR5OQ5GO16/exec?url={url}" + ).json() + await msg.edit(f"{req['text']}") + os.remove(file_path) + except Exception as e: + await msg.edit(str(e)) + os.remove(file_path) diff --git a/ubot/core/plugins/opi.py b/ubot/core/plugins/opi.py new file mode 100644 index 0000000000000000000000000000000000000000..02cff95516e48e086886bc2167a6700a084ce4f4 --- /dev/null +++ b/ubot/core/plugins/opi.py @@ -0,0 +1,78 @@ +import io +import os + +from ubot import * + + +async def ai_cmd(client, message): + Tm = await message.reply("Processing...") + args = get_text(message) + if not args: + return await Tm.edit(f"{message.text} [pertanyaan]") + try: + response = await OpenAi.ChatGPT(args) + if int(len(str(response))) > 4096: + with io.BytesIO(str.encode(str(response))) as out_file: + out_file.name = "openAi.txt" + await message.reply_document( + document=out_file, + ) + return await Tm.delete() + else: + msg = message.reply_to_message or message + await client.send_message( + message.chat.id, response, reply_to_message_id=msg.id + ) + return await Tm.delete() + except Exception as error: + await message.reply(error) + return await Tm.delete() + + +async def dalle_cmd(client, message): + Tm = await message.reply("Processing...") + if len(message.command) < 2: + return await Tm.edit(f"{message.text} [ǫᴜᴇʀʏ]") + try: + response = await OpenAi.ImageDalle(message.text.split(None, 1)[1]) + msg = message.reply_to_message or message + await client.send_photo(message.chat.id, response, reply_to_message_id=msg.id) + return await Tm.delete() + except Exception as error: + await message.reply(error) + return await Tm.delete() + + +async def stt_cmd(client, message): + Tm = await message.reply("Processing...") + reply = message.reply_to_message + if reply: + if reply.voice or reply.audio or reply.video: + file = await client.download_media( + message=message.reply_to_message, + file_name=f"sst_{message.reply_to_message.id}", + ) + audio_file = f"{file}.mp3" + cmd = f"ffmpeg -i {file} -q:a 0 -map a {audio_file}" + await run_cmd(cmd) + os.remove(file) + try: + response = await OpenAi.SpeechToText(audio_file) + except Exception as error: + await message.reply(error) + return await Tm.delete() + if int(len(str(response))) > 4096: + with io.BytesIO(str.encode(str(response))) as out_file: + out_file.name = "openAi.txt" + await message.reply_document( + document=out_file, + ) + return await Tm.delete() + else: + msg = message.reply_to_message or message + await client.send_message( + message.chat.id, response, reply_to_message_id=msg.id + ) + return await Tm.delete() + else: + return await Tm.edit(f"{message.text} [balas media].") diff --git a/ubot/core/plugins/pgr.py b/ubot/core/plugins/pgr.py new file mode 100644 index 0000000000000000000000000000000000000000..21c076985ed4c9678a8d9cffab03b6af5dab2f59 --- /dev/null +++ b/ubot/core/plugins/pgr.py @@ -0,0 +1,69 @@ +import asyncio + + +async def del_cmd(client, message): + rep = message.reply_to_message + await message.delete() + await rep.delete() + + +async def purgeme_cmd(client, message): + if len(message.command) != 2: + return await message.delete() + n = ( + message.reply_to_message + if message.reply_to_message + else message.text.split(None, 1)[1].strip() + ) + if not n.isnumeric(): + return await message.reply("Argumen tidak valid") + n = int(n) + if n < 1: + return await message.reply("Masukkan angaka 1-999") + chat_id = message.chat.id + message_ids = [ + m.id + async for m in client.search_messages( + chat_id, + from_user=int(message.from_user.id), + limit=n, + ) + ] + if not message_ids: + return await message.reply_text("Tidak ada pesan yang ditemukan") + to_delete = [message_ids[i : i + 999] for i in range(0, len(message_ids), 999)] + for hundred_messages_or_less in to_delete: + await client.delete_messages( + chat_id=chat_id, + message_ids=hundred_messages_or_less, + revoke=True, + ) + mmk = await message.reply(f"✅ {n} Berhasil dihapus.") + await asyncio.sleep(2) + await mmk.delete() + + +async def purge_cmd(client, message): + await message.delete() + if not message.reply_to_message: + return await message.reply_text("Silakan balas pesan untuk dibersikan") + chat_id = message.chat.id + message_ids = [] + for message_id in range( + message.reply_to_message.id, + message.id, + ): + message_ids.append(message_id) + if len(message_ids) == 100: + await client.delete_messages( + chat_id=chat_id, + message_ids=message_ids, + revoke=True, + ) + message_ids = [] + if len(message_ids) > 0: + await client.delete_messages( + chat_id=chat_id, + message_ids=message_ids, + revoke=True, + ) diff --git a/ubot/core/plugins/pmper.py b/ubot/core/plugins/pmper.py new file mode 100644 index 0000000000000000000000000000000000000000..6bdb5a7ba0fb297a22e1079e2529200f1e7a9540 --- /dev/null +++ b/ubot/core/plugins/pmper.py @@ -0,0 +1,218 @@ +from pyrogram import * +from pyrogram.types import * + +from ubot import * + +PM_GUARD_WARNS_DB = {} +PM_GUARD_MSGS_DB = {} + +flood = {} +flood2 = {} + +DEFAULT_TEXT = """ +I am {} who guards this Chat Room. Don't spam or you will be automatically blocked. +""" + +PM_WARN = """ +PM Security Of {} !! + +{} + +Warning `{}` of `{}` !! +""" + +LIMIT = 5 + + +async def permitpm(client, message): + user_id = client.me.id + babi = await message.reply("`Processing...`") + bacot = get_arg(message) + if not bacot: + return await babi.edit(f"`Use Format: `{0}pmpermit on or off`.`") + is_already = await get_var(user_id, "ENABLE_PM_GUARD") + if bacot.lower() == "on": + if is_already: + return await babi.edit("`PMPermit is already enabled.`") + await set_var(user_id, "ENABLE_PM_GUARD", True) + await babi.edit("`PMPermit has been enabled.`") + elif bacot.lower() == "off": + if not is_already: + return await babi.edit("`PMPermit is already disabled.`") + await set_var(user_id, "ENABLE_PM_GUARD", False) + await babi.edit("`PMPermit has been disabled.`") + else: + await babi.edit(f"`Use Format: `{0}pmpermit on or off`.`") + + +async def approve(client, message): + babi = await message.reply("`Processing...`") + chat_type = message.chat.type + client.me.id + if chat_type == "me": + return await babi.edit("`Are you crazy?`") + elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]: + if not message.reply_to_message: + return await babi.edit("`Reply to user's message to approve.`") + user_id = message.reply_to_message.from_user.id + elif chat_type == enums.ChatType.PRIVATE: + user_id = message.chat.id + else: + return + already_apprvd = await check_user_approved(user_id) + if already_apprvd: + return await babi.edit("**This user is already approved.**") + if user_id in PM_GUARD_WARNS_DB: + PM_GUARD_WARNS_DB.pop(user_id) + try: + await client.delete_messages( + chat_id=user_id, message_ids=PM_GUARD_MSGS_DB[user_id] + ) + except BaseException: + pass + await add_approved_user(user_id) + await babi.edit("**Alright, this user is approved to send messages.**") + + +async def disapprove(client, message): + babi = await message.reply("`Processing...`") + client.me.id + chat_type = message.chat.type + if chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]: + if not message.reply_to_message.from_user: + return await babi.edit("`Reply to user's message to disapprove.`") + user_id = message.reply_to_message.from_user.id + elif chat_type == enums.ChatType.PRIVATE: + user_id = message.chat.id + else: + return + already_apprvd = await check_user_approved(user_id) + if not already_apprvd: + return await babi.edit( + "**This user is not approved to send messages yet.**" + ) + await rm_approved_user(user_id) + await babi.edit("**Alright, this user is disapproved from sending messages.**") + + +async def set_msg(client, message): + babi = await message.reply("`Processing...`") + user_id = client.me.id + r_msg = message.reply_to_message + args_txt = get_arg(message) + if r_msg: + if r_msg.text: + pm_txt = r_msg.text + else: + return await babi.edit( + "`Please reply to a message to set it as PMPermit text!`" + ) + elif args_txt: + pm_txt = args_txt + else: + return await babi.edit( + "`Please reply to a message or provide text to set as PMPermit text!\n`Example: `{0}setmsg Hello, I am anuan`" + ) + await set_var(user_id, "CUSTOM_PM_TEXT", pm_txt) + await babi.edit(f"`PMPermit message has been set to: `{pm_txt}`.`") + + +async def set_limit(client, message): + babi = await message.reply("`Processing...`") + user_id = client.me.id + args_txt = get_arg(message) + if args_txt: + if args_txt.isnumeric(): + pm_warns = int(args_txt) + else: + return await babi.edit("`Please provide a number for the limit!`") + else: + return await babi.edit( + f"`Please provide a number for the limit!\n`Example: `{0}setlimit 5`" + ) + await set_var(user_id, "CUSTOM_PM_WARNS_LIMIT", pm_warns) + await babi.edit(f"`Limit has been set to: `{args_txt}`.`") + + +async def handle_pmpermit(client, message): + user_id = client.me.id + siapa = message.from_user.id + biji = message.from_user.mention + chat_id = message.chat.id + in_user = message.from_user + fsdj = await check_user_approved(chat_id) + is_pm_guard_enabled = await get_var(user_id, "ENABLE_PM_GUARD") + if not is_pm_guard_enabled: + return + + if fsdj: + return + + if in_user.is_fake or in_user.is_scam: + await message.reply("**You seem suspicious...**") + return await client.block_user(in_user.id) + if in_user.is_support or in_user.is_verified or in_user.is_self: + return + if siapa in DEVS: + try: + await add_approved_user(chat_id) + await client.send_message( + chat_id, + f"Accepting message from {biji} !!\nDetected as Founder of {bot.me.first_name}.", + parse_mode=enums.ParseMode.HTML, + ) + except BaseException: + pass + return + if siapa in await get_seles(): + try: + await add_approved_user(chat_id) + await client.send_message( + chat_id, + f"Accepting message from {biji} !!\nDetected as Admin of {bot.me.first_name}.", + parse_mode=enums.ParseMode.HTML, + ) + except BaseException: + pass + return + + master = await client.get_me() + getc_pm_txt = await get_var(user_id, "CUSTOM_PM_TEXT") + getc_pm_warns = await get_var(user_id, "CUSTOM_PM_WARNS_LIMIT") + custom_pm_txt = getc_pm_txt if getc_pm_txt else DEFAULT_TEXT + custom_pm_warns = getc_pm_warns if getc_pm_warns else LIMIT + if in_user.id in PM_GUARD_WARNS_DB: + try: + if message.chat.id in PM_GUARD_MSGS_DB: + await client.delete_messages( + chat_id=message.chat.id, + message_ids=PM_GUARD_MSGS_DB[message.chat.id], + ) + except BaseException: + pass + PM_GUARD_WARNS_DB[in_user.id] += 1 + if PM_GUARD_WARNS_DB[in_user.id] >= custom_pm_warns: + await message.reply( + f"`I have given {custom_pm_warns} warnings\nWait for my master to approve your message, or you will be blocked!`" + ) + return await client.block_user(in_user.id) + else: + rplied_msg = await message.reply( + PM_WARN.format( + master.first_name, + custom_pm_txt.format(bot.me.first_name), + PM_GUARD_WARNS_DB[in_user.id], + custom_pm_warns, + ) + ) + else: + PM_GUARD_WARNS_DB[in_user.id] = 1 + rplied_msg = await message.reply( + PM_WARN.format( + master.first_name, + custom_pm_txt.format(bot.me.first_name), + PM_GUARD_WARNS_DB[in_user.id], + custom_pm_warns, + ) + ) + PM_GUARD_MSGS_DB[message.chat.id] = rplied_msg.id diff --git a/ubot/core/plugins/prof.py b/ubot/core/plugins/prof.py new file mode 100644 index 0000000000000000000000000000000000000000..9b45a750c1a4662a0e3786f8f36f371b331e308d --- /dev/null +++ b/ubot/core/plugins/prof.py @@ -0,0 +1,128 @@ +import os +from asyncio import sleep + +from ubot import * + + +async def unblock_user_func(client, message): + user_id = await extract_user(message) + tex = await message.reply("Processing...") + if not user_id: + return await tex.edit("Provide a username or reply to a message to unblock.") + if user_id == client.me.id: + return await tex.edit("Ok done.") + await client.unblock_user(user_id) + umention = (await client.get_users(user_id)).mention + await tex.edit(f"Successfully unblocked {umention}") + + +async def block_user_func(client, message): + user_id = await extract_user(message) + tex = await message.reply("Processing...") + if not user_id: + return await tex.edit(f"Give a username to block.") + if user_id == client.me.id: + return await tex.edit("Ok done.") + await client.block_user(user_id) + umention = (await client.get_users(user_id)).mention + await tex.edit(f"Successfully Blocked {umention}") + + +async def setname(client, message): + tex = await message.reply("Processing...") + if len(message.command) == 1: + return await tex.edit("Provide text to set as your name.") + elif len(message.command) > 1: + name = message.text.split(None, 1)[1] + try: + await client.update_profile(first_name=name) + await tex.edit( + f"Successfully changed the name to {name}" + ) + except Exception as e: + await tex.edit(f"ERROR: {e}") + else: + return await tex.edit("Provide text to set as your name.") + + +async def set_bio(client, message): + tex = await message.reply("Processing...") + if len(message.command) == 1: + return await tex.edit("Provide text to set as bio.") + elif len(message.command) > 1: + bio = message.text.split(None, 1)[1] + try: + await client.update_profile(bio=bio) + await tex.edit(f"Successfully changed bio to {bio}") + except Exception as e: + await tex.edit(f"ERROR: {e}") + else: + return await tex.edit("Provide text to set as bio.") + + +async def list_admin(client, message): + bacot = await message.reply("`Processing...`") + a_chats = [] + me = await client.get_me() + async for dialog in client.get_dialogs(limit=None): + if dialog.chat.type == enums.ChatType.SUPERGROUP: + gua = await dialog.chat.get_member(int(me.id)) + if gua.status in ( + enums.ChatMemberStatus.OWNER, + enums.ChatMemberStatus.ADMINISTRATOR, + ): + a_chats.append(dialog.chat) + + text = "" + j = 0 + for chat in a_chats: + try: + title = chat.title + except Exception: + title = "Private Group" + if chat.username: + text += f"{j + 1}. [{title}](https://t.me/{chat.username})[`{chat.id}`]\n" + else: + text += f"{j + 1}. {title} [`{chat.id}`]\n" + j += 1 + + if not text: + await bacot.edit_text("Kamu tidak menjadi admin di grup manapun.") + elif len(text) > 4096: + with BytesIO(str.encode(text)) as out_file: + out_file.name = "adminlist.text" + await message.reply_document( + document=out_file, + disable_notification=True, + quote=True, + ) + await bacot.delete() + else: + await bacot.edit_text( + f"**Kamu admin di `{len(a_chats)}` group:\n\n{text}**", + disable_web_page_preview=True, + ) + + +async def set_pfp(client, message): + po = "storage/TM_BLACK.png" + replied = message.reply_to_message + if ( + replied + and replied.media + and ( + replied.photo + or (replied.document and "image" in replied.document.mime_type) + ) + ): + await client.download_media(message=replied, file_name=po) + await client.set_profile_photo(photo=po) + if os.path.exists(po): + os.remove(po) + await message.reply("**Foto Profil anda Berhasil Diubah.**") + else: + await message.reply( + "`Balas ke foto apa pun untuk dipasang sebagai foto profile`" + ) + await sleep(3) + await message.delete() diff --git a/ubot/core/plugins/pyn.py b/ubot/core/plugins/pyn.py new file mode 100644 index 0000000000000000000000000000000000000000..fda34858c4d50f53328811eb372382482805db52 --- /dev/null +++ b/ubot/core/plugins/pyn.py @@ -0,0 +1,174 @@ +import asyncio +from datetime import datetime + +from dateutil.relativedelta import relativedelta +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup +from pytz import timezone + +from ubot import * + +CONFIRM_PAYMENT = [] + + +async def confirm_callback(client, callback_query): + user_id = int(callback_query.from_user.id) + full_name = f"{callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}" + get = await bot.get_users(user_id) + CONFIRM_PAYMENT.append(get.id) + try: + button = [[InlineKeyboardButton("❌ cancel", callback_data=f"home {user_id}")]] + await callback_query.message.delete() + pesan = await bot.ask( + user_id, + f"💬 Please send proof of payment: {full_name}", + reply_markup=InlineKeyboardMarkup(button), + timeout=300, + ) + except asyncio.TimeoutError as out: + if get.id in CONFIRM_PAYMENT: + CONFIRM_PAYMENT.remove(get.id) + return await bot.send_message(get.id, "Automatic cancellation.") + if get.id in CONFIRM_PAYMENT: + if not pesan.photo: + CONFIRM_PAYMENT.remove(get.id) + await pesan.request.edit( + f"💬 Please send proof of payment: {full_name}", + ) + buttons = [[InlineKeyboardButton("✅ Confirmation", callback_data="confirm")]] + return await bot.send_message( + user_id, + """ +❌ Request Cannot Be Processed. + +💬 Hope Send Your Proof of Payment. + +✅ Please Confirm Your Payment. +""", + reply_markup=InlineKeyboardMarkup(buttons), + ) + elif pesan.photo: + buttons = Button.button_add_expired(get.id) + await pesan.copy( + OWNER_ID, + reply_markup=buttons, + ) + CONFIRM_PAYMENT.remove(get.id) + await pesan.request.edit( + f"💬 Please send proof of payment: {full_name}", + ) + return await bot.send_message( + user_id, + f""" +💬 Ok {full_name} Please Wait. + +🏦 Payment will be confirmed within 1x24 hours. +""", + ) + + +async def tambah_or_kurang(client, callback_query): + BULAN = int(callback_query.data.split()[1]) + HARGA = 30 + QUERY = callback_query.data.split()[0] + try: + if QUERY == "kurang": + if BULAN > 1: + BULAN -= 1 + TOTAL_HARGA = HARGA * BULAN + elif QUERY == "tambah": + if BULAN < 12: + BULAN += 1 + TOTAL_HARGA = HARGA * BULAN + buttons = Button.plus_minus(BULAN, callback_query.from_user.id) + await callback_query.message.edit_text( + MSG.TEXT_PAYMENT(HARGA, TOTAL_HARGA, BULAN), + disable_web_page_preview=True, + reply_markup=InlineKeyboardMarkup(buttons), + ) + except: + pass + + +async def success_failed_home_callback(client, callback_query): + query = callback_query.data.split() + get_user = await bot.get_users(query[1]) + if query[0] == "success": + buttons = [ + [InlineKeyboardButton("Buat Userbot", callback_data="bahan")], + ] + await bot.send_message( + get_user.id, + """ +✅ Payment Successfully Confirmed + +💬 Now You Can Create Userbots. +""", + reply_markup=InlineKeyboardMarkup(buttons), + ) + buttons_success = [ + [ + InlineKeyboardButton( + "👤 ᴘʀᴏꜰɪʟ 👤", callback_data=f"profil {get_user.id}" + ) + ], + ] + await add_prem(get_user.id) + now = datetime.now(timezone("Asia/Jakarta")) + expired = now + relativedelta(months=int(query[2])) + await set_expired_date(get_user.id, expired) + return await bot.send_message( + OWNER_ID, + f""" +✅ {get_user.first_name} {get_user.last_name or ''} Added as a premium user +""", + reply_markup=InlineKeyboardMarkup(buttons_success), + ) + if query[0] == "failed": + buttons = [ + [ + InlineKeyboardButton( + "💳 Make Payment 💳", callback_data="bayar_dulu" + ) + ], + ] + await bot.send_message( + get_user.id, + """ +❌ Payment Cannot Be Confirmed + +💬 Please Do It Right. +""", + reply_markup=InlineKeyboardMarkup(buttons), + ) + buttons_failed = [ + [ + InlineKeyboardButton( + "👤 ᴘʀᴏꜰɪʟ 👤", callback_data=f"profil {get_user.id}" + ) + ], + ] + return await bot.send_message( + OWNER_ID, + f""" +❌ {get_user.first_name} {get_user.last_name or ''} Not Added As Premium User. +""", + reply_markup=InlineKeyboardMarkup(buttons_failed), + ) + if query[0] == "home": + if get_user.id in CONFIRM_PAYMENT: + CONFIRM_PAYMENT.remove(get_user.id) + buttons_home = Button.start(callback_query) + await callback_query.message.delete() + return await bot.send_message( + get_user.id, + MSG.START(callback_query), + reply_markup=InlineKeyboardMarkup(buttons_home), + ) + else: + buttons_home = Button.start(callback_query) + await callback_query.message.delete() + return await bot.send_message( + get_user.id, + MSG.START(callback_query), + reply_markup=InlineKeyboardMarkup(buttons_home), + ) diff --git a/ubot/core/plugins/qtl.py b/ubot/core/plugins/qtl.py new file mode 100644 index 0000000000000000000000000000000000000000..31e395e79ea2d6b155cdb4d7e39db8c682f01032 --- /dev/null +++ b/ubot/core/plugins/qtl.py @@ -0,0 +1,55 @@ +import asyncio +import os + +from pyrogram.raw.functions.messages import DeleteHistory + + +async def quotly_cmd(client, message): + info = await message.reply("Processing...", quote=True) + await client.unblock_user("@QuotLyBot") + if message.reply_to_message: + if len(message.command) < 2: + msg = [message.reply_to_message] + else: + try: + count = int(message.command[1]) + except Exception as error: + await info.edit(error) + msg = [ + i + for i in await client.get_messages( + chat_id=message.chat.id, + message_ids=range( + message.reply_to_message.id, message.reply_to_message.id + count + ), + replies=-1, + ) + ] + try: + for x in msg: + await x.forward("@QuotLyBot") + except Exception: + pass + await asyncio.sleep(9) + await info.delete() + async for quotly in client.get_chat_history("@QuotLyBot", limit=1): + if not quotly.sticker: + await message.reply(f"❌ @QuotLyBot Error", quote=True) + else: + sticker = await client.download_media(quotly) + await message.reply_sticker(sticker, quote=True) + os.remove(sticker) + else: + if len(message.command) < 2: + return await info.edit("Balas ke pesan") + else: + msg = await client.send_message( + "@QuotLyBot", f"/qcolor {message.command[1]}" + ) + await asyncio.sleep(1) + get = await client.get_messages("@QuotLyBot", msg.id + 1) + await info.edit( + f"Warna latar belakang di ganti ke : {get.text.split(':')[1]}" + ) + user_info = await client.resolve_peer("@QuotLyBot") + return await client.invoke(DeleteHistory(peer=user_info, max_id=0, revoke=True)) diff --git a/ubot/core/plugins/rmndr.py b/ubot/core/plugins/rmndr.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c35dc76e0f852e4d5b75d1b235b622abdaf0a7 --- /dev/null +++ b/ubot/core/plugins/rmndr.py @@ -0,0 +1,41 @@ +from datetime import datetime, timedelta + +from pytimeparse import parse +from pytz import timezone + +from ubot import * + +# Daftar pengingat yang tersimpan + +reminders = [] + + +async def reminder(client, message): + prefix = await get_prefix(client.me.id) + if len(message.command) == 1 or len(message.command) == 2: + await message.reply( + f"Penggunaan: `remind `\n\nContoh:\n`{next((p) for p in prefix)}remind 1j30m Beli susu`\n`{next((p) for p in prefix)}remind 1h30m Cek email`" + ) + else: + time_from_now = message.command[1] + text_to_remind = message.text.split(" ", 2)[2] + now = datetime.now(timezone("Asia/Jakarta")) + delay = parse(time_from_now) + t = now + timedelta(seconds=delay) + + reminders.append((t, text_to_remind)) + await client.send_message(message.chat.id, text_to_remind, schedule_date=t) + await message.reply( + f"Pengingat disimpan, akan dikirim pada {t.strftime('%d/%m/%Y')} pukul {t.strftime('%H:%M:%S')}." + ) + + +async def listrem(client, message): + if len(reminders) == 0: + await message.reply("Tidak ada pengingat yang tersimpan.") + else: + response = "Daftar Pengingat:\n\n" + for i, reminder in enumerate(reminders, start=1): + t, text = reminder + response += f"{i}. {text} - {t.strftime('%d/%m/%Y %H:%M:%S')}\n" + await message.reply(response) diff --git a/ubot/core/plugins/rts.py b/ubot/core/plugins/rts.py new file mode 100644 index 0000000000000000000000000000000000000000..7f0fd3f42208139a44f7b0d60e2a169e3e860619 --- /dev/null +++ b/ubot/core/plugins/rts.py @@ -0,0 +1,103 @@ +import importlib +import random +from datetime import datetime, timedelta + +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup +from pytz import timezone + +from ubot import * + + +async def login_cmd(client, message): + info = await message.reply("Tunggu Sebentar...", quote=True) + if len(message.command) < 3: + return await info.edit( + f"{message.text} ʜᴀʀɪ - sᴛʀɪɴɢ ᴘʏʀᴏɢʀᴀᴍ" + ) + try: + ub = Ubot( + name=f"ubot_{random.randrange(999999)}", + api_id=API_ID, + api_hash=API_HASH, + session_string=message.command[2], + ) + await ub.start() + for mod in loadModule(): + importlib.reload(importlib.import_module(f"ubot.modules.{mod}")) + now = datetime.now(timezone("Asia/Jakarta")) + expire_date = now + timedelta(days=int(message.command[1])) + await set_expired_date(ub.me.id, expire_date) + await add_ubot( + user_id=int(ub.me.id), + api_id=API_ID, + api_hash=API_HASH, + session_string=message.command[1], + ) + buttons = [ + [ + InlineKeyboardButton( + "Cek Kadaluarsa", + callback_data=f"cek_masa_aktif {ub.me.id}", + ) + ], + ] + await bot.send_message( + LOG_UBOT, + f""" +❏ Userbot Diaktifkan + ├ Akun: {ub.me.first_name} {ub.me.last_name or ''} + ╰ ID: {ub.me.id} +""", + reply_markup=InlineKeyboardMarkup(buttons), + disable_web_page_preview=True, + ) + return await info.edit( + f"✅ Berhasil Login Di Akun: {ub.me.first_name} {ub.me.last_name or ''}" + ) + except Exception as error: + return await info.edit(f"{error}") + + +async def restart_cmd(client, message): + msg = await message.reply("Processing...", quote=True) + if message.from_user.id not in ubot._get_my_id: + return await msg.edit(f"Anda bukan pengguna @{bot.me.username}!!") + for X in ubot._ubot: + if message.from_user.id == X.me.id: + for _ubot_ in await get_userbots(): + if X.me.id == int(_ubot_["name"]): + try: + ubot._ubot.remove(X) + UB = Ubot(**_ubot_) + await UB.start() + for mod in loadModule(): + importlib.reload( + importlib.import_module(f"ubot.modules.{mod}") + ) + return await msg.edit( + f"✅ Berhasil Di Restart {UB.me.first_name} {UB.me.last_name or ''} | {UB.me.id}." + ) + except Exception as error: + return await msg.edit(f"{error}") + + +""" + for X in ubot._ubot: + if message.from_user.id == X.me.id: + for _ubot_ in await get_userbots(): + if X.me.id == int(_ubot_["name"]): + try: + ubot._ubot.remove(X) + UB = Ubot(**_ubot_) + UB.in_memory=False + await UB.start() + for mod in loadModule(): + importlib.reload( + importlib.import_module(f"ubot.modules.{mod}") + ) + return await msg.edit( + f"✅ Berhasil Di Restart {UB.me.first_name} {UB.me.last_name or ''} | {UB.me.id}" + ) + except Exception as error: + return await msg.edit(f"{error}") +""" diff --git a/ubot/core/plugins/sct.py b/ubot/core/plugins/sct.py new file mode 100644 index 0000000000000000000000000000000000000000..3f460f5a988e6f3c6b6617259f3c4c373b9692a6 --- /dev/null +++ b/ubot/core/plugins/sct.py @@ -0,0 +1,45 @@ +from gc import get_objects + +from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup, + InlineQueryResultArticle, InputTextMessageContent) + +from ubot import * + + +async def msg_cmd(client, message): + if not message.reply_to_message: + return await message.reply( + f"{message.text} [balas pesan pengguna - text]" + ) + text = f"secret {id(message)}" + await message.delete() + x = await client.get_inline_bot_results(bot.me.username, text) + await message.reply_to_message.reply_inline_bot_result(x.query_id, x.results[0].id) + + +async def secret_inline(client, q): + m = [obj for obj in get_objects() if id(obj) == int(q.query.split()[1])][0] + await client.answer_inline_query( + q.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="pesan rahasia!", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + text="Private Message", + url=f"https://t.me/{bot.me.username}?start=secretMsg_{int(q.query.split(None, 1)[1])}", + ) + ], + ] + ), + input_message_content=InputTextMessageContent( + f"Pesan Untuk Anda : {m.reply_to_message.from_user.first_name} {m.reply_to_message.from_user.last_name or ''}" + ), + ) + ) + ], + ) diff --git a/ubot/core/plugins/sid.py b/ubot/core/plugins/sid.py new file mode 100644 index 0000000000000000000000000000000000000000..72b832ac94917a1bd33d71a76799c165aafc4563 --- /dev/null +++ b/ubot/core/plugins/sid.py @@ -0,0 +1,34 @@ +from ubot import * + + +async def id_cmd(client, message): + chat = message.chat + your_id = message.from_user.id + message_id = message.id + reply = message.reply_to_message + + text = f"**[Message ID:]({message.link})** `{message_id}`\n" + text += f"**[Your ID:](tg://user?id={your_id})** `{your_id}`\n" + + if not message.command: + message.command = message.text.split() + + if len(message.command) == 2: + try: + split = message.text.split(None, 1)[1].strip() + user_id = (await client.get_users(split)).id + text += f"**[User ID:](tg://user?id={user_id})** `{user_id}`\n" + except Exception: + return await message.reply("Pengguna tidak ditemukan.") + + text += f"**[Chat ID:](https://t.me/{chat.username})** `{chat.id}`\n\n" + if not getattr(reply, "empty", True): + id_ = reply.from_user.id if reply.from_user else reply.sender_chat.id + text += f"**[Replied Message ID:]({reply.link})** `{reply.id}`\n" + text += f"**[Replied User ID:](tg://user?id={id_})** `{id_}`" + + await message.reply( + text, + disable_web_page_preview=True, + parse_mode=enums.ParseMode.MARKDOWN, + ) diff --git a/ubot/core/plugins/smd.py b/ubot/core/plugins/smd.py new file mode 100644 index 0000000000000000000000000000000000000000..f3f083d1d45007e08db886df090b8a713d2a93af --- /dev/null +++ b/ubot/core/plugins/smd.py @@ -0,0 +1,23 @@ +import asyncio + +from pyrogram.raw.functions.messages import DeleteHistory + + +async def sosmed_cmd(client, message): + if len(message.command) < 2: + return await message.reply(f"{message.text} Link - IG/TT/FB/TW/YT") + else: + bot = "thisvidbot" + link = message.text.split()[1] + await client.unblock_user(bot) + Tm = await message.reply("Processing... . . .") + xnxx = await client.send_message(bot, link) + await asyncio.sleep(10) + try: + sosmed = await client.get_messages(bot, xnxx.id + 2) + await sosmed.copy(message.chat.id, reply_to_message_id=message.id) + await Tm.delete() + except Exception: + await Tm.edit("Video tidak ditemukan.") + user_info = await client.resolve_peer(bot) + return await client.invoke(DeleteHistory(peer=user_info, max_id=0, revoke=True)) diff --git a/ubot/core/plugins/smt.py b/ubot/core/plugins/smt.py new file mode 100644 index 0000000000000000000000000000000000000000..26059ec2a8fde617f5177394f099fcd6da96384a --- /dev/null +++ b/ubot/core/plugins/smt.py @@ -0,0 +1,34 @@ +import asyncio +import random + +from pyrogram.raw.functions.messages import DeleteHistory + +from ubot import * + + +async def sg_cmd(client, message): + get_user = await extract_user(message) + lol = await message.reply("Processing.... . .") + if not get_user: + return await lol.edit("Pengguna tidak ditemukan") + try: + user_id = (await client.get_users(get_user)).id + except Exception: + try: + user_id = int(message.command[1]) + except Exception as error: + return await lol.edit(error) + bot = ["@Sangmata_bot", "@SangMata_beta_bot"] + getbot = random.choice(bot) + await client.unblock_user(getbot) + txt = await client.send_message(getbot, user_id) + await asyncio.sleep(4) + await txt.delete() + await lol.delete() + async for name in client.search_messages(getbot, limit=2): + if not name.text: + await message.reply(f"❌ {getbot} Respon Error", quote=True) + else: + await message.reply(name.text, quote=True) + user_info = await client.resolve_peer(getbot) + return await client.invoke(DeleteHistory(peer=user_info, max_id=0, revoke=True)) diff --git a/ubot/core/plugins/spm.py b/ubot/core/plugins/spm.py new file mode 100644 index 0000000000000000000000000000000000000000..c195462fa0e68cbecba7412d9ccefd5bd860fe6b --- /dev/null +++ b/ubot/core/plugins/spm.py @@ -0,0 +1,101 @@ +import asyncio + +dispam = [] + +berenti = False + + +async def spam_cmd(client, message): + global berenti + + reply = message.reply_to_message + msg = await message.reply("Processing...", quote=False) + berenti = True + + if reply: + try: + count_message = int(message.command[1]) + for i in range(count_message): + if not berenti: + break + await reply.copy(message.chat.id) + await asyncio.sleep(0.1) + except Exception as error: + return await msg.edit(str(error)) + # berenti = False + else: + if len(message.command) < 2: + return await msg.edit( + f"Silakan ketik {message.command} untuk bantuan perintah." + ) + else: + try: + count_message = int(message.command[1]) + for i in range(count_message): + if not berenti: + break + await message.reply(message.text.split(None, 2)[2], quote=False) + await asyncio.sleep(0.1) + except Exception as error: + return await msg.edit(str(error)) + berenti = False + + await msg.delete() + await message.delete() + + +async def dspam_cmd(client, message): + global berenti + + reply = message.reply_to_message + msg = await message.reply("Processing...", quote=False) + berenti = True + if reply: + try: + count_message = int(message.command[1]) + count_delay = int(message.command[2]) + except Exception as error: + return await msg.edit(str(error)) + for i in range(count_message): + if not berenti: + break + try: + await reply.copy(message.chat.id) + await asyncio.sleep(count_delay) + except: + pass + else: + if len(message.command) < 4: + return await msg.edit( + f"Silakan ketik {message.command} untuk bantuan perintah." + ) + else: + try: + count_message = int(message.command[1]) + count_delay = int(message.command[2]) + except Exception as error: + return await msg.edit(str(error)) + for i in range(count_message): + if not berenti: + break + try: + await message.reply(message.text.split(None, 3)[3], quote=False) + await asyncio.sleep(count_delay) + except: + pass + + berenti = False + + await msg.delete() + await message.delete() + + +async def capek_dah(client, message): + global berenti + + # anu = await message.reply("Processing...") + if not berenti: + return await message.reply("Sedang tidak ada perintah spam disini.") + berenti = False + # dispam.remove(message.chat.id) + await message.reply("Ok spam berhasil dihentikan.") diff --git a/ubot/core/plugins/spt.py b/ubot/core/plugins/spt.py new file mode 100644 index 0000000000000000000000000000000000000000..8444f59537f47fb2d2486b1d8f644151ba2fa7d2 --- /dev/null +++ b/ubot/core/plugins/spt.py @@ -0,0 +1,148 @@ +import asyncio + +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup + +from ubot import * + +SUPPORT = [] + + +async def support_callback(client, callback_query): + user_id = int(callback_query.from_user.id) + full_name = f"{callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}" + get = await bot.get_users(user_id) + await callback_query.message.delete() + SUPPORT.append(get.id) + try: + button = [ + [InlineKeyboardButton("❌ ʙᴀᴛᴀʟᴋᴀɴ", callback_data=f"batal {user_id}")] + ] + pesan = await bot.ask( + user_id, + f"✍️ Kirimkan Pertanyaan Anda : {full_name}", + reply_markup=InlineKeyboardMarkup(button), + timeout=90, + ) + except asyncio.TimeoutError as out: + if get.id in SUPPORT: + SUPPORT.remove(get.id) + return await bot.send_message(get.id, "Pembatalan Otomatis") + text = f"💬 Pertanyaan Anda Terkirim : {full_name}" + buttons = [ + [ + InlineKeyboardButton("👤 ᴘʀᴏꜰɪʟ", callback_data=f"profil {user_id}"), + InlineKeyboardButton("ᴊᴀᴡᴀʙ 💬", callback_data=f"jawab_pesan {user_id}"), + ], + ] + if get.id in SUPPORT: + try: + await pesan.copy( + OWNER_ID, + reply_markup=InlineKeyboardMarkup(buttons), + ) + SUPPORT.remove(get.id) + await pesan.request.edit( + f"✍️ Kirimkan Pertanyaan Anda : {full_name}" + ) + return await bot.send_message(user_id, text) + except Exception as error: + return await bot.send_message(user_id, error) + + +async def jawab_pesan_callback(client, callback_query): + user_id = int(callback_query.from_user.id) + full_name = f"{callback_query.from_user.first_name} {callback_query.from_user.last_name or ''}" + get = await bot.get_users(user_id) + user_ids = int(callback_query.data.split()[1]) + SUPPORT.append(get.id) + try: + button = [ + [InlineKeyboardButton("❌ Batalkan", callback_data=f"batal {user_id}")] + ] + pesan = await bot.ask( + user_id, + f"✉️ Silakan Kirim Balasan Anda: {full_name}", + reply_markup=InlineKeyboardMarkup(button), + timeout=300, + ) + except asyncio.TimeoutError: + if get.id in SUPPORT: + SUPPORT.remove(get.id) + return await bot.send_message(get.id, "Pembatalan Otomatis") + text = f"✅ Pesan Balasan Terkirim : {full_name}" + if not user_ids == OWNER_ID: + buttons = [[InlineKeyboardButton("💬 Jawab Pesan 💬", f"jawab_pesan {user_id}")]] + else: + buttons = [ + [ + InlineKeyboardButton("👤 ᴘʀᴏꜰɪʟ", callback_data=f"profil {user_id}"), + InlineKeyboardButton("ᴊᴀᴡᴀʙ 💬", callback_data=f"jawab_pesan {user_id}"), + ], + ] + if get.id in SUPPORT: + try: + await pesan.copy( + user_ids, + reply_markup=InlineKeyboardMarkup(buttons), + ) + SUPPORT.remove(get.id) + await pesan.request.edit( + f"✉️ Silakan Kirim Pesan Balasan : {full_name}", + ) + await bot.send_message(user_id, text) + except Exception as error: + return await bot.send_message(user_id, error) + + +async def profil_callback(client, callback_query): + user_id = int(callback_query.data.split()[1]) + try: + get = await bot.get_users(user_id) + first_name = f"{get.first_name}" + last_name = f"{get.last_name}" + full_name = f"{get.first_name} {get.last_name or ''}" + username = f"{get.username}" + msg = ( + f"👤 {full_name}\n" + f" ┣ ɪᴅ ᴘᴇɴɢɢᴜɴᴀ: {get.id}\n" + f" ┣ ɴᴀᴍᴀ ᴅᴇᴘᴀɴ: {first_name}\n" + ) + if last_name == "None": + msg += "" + else: + msg += f" ┣ ɴᴀᴍᴀ ʙᴇʟᴀᴋᴀɴɢɴʏᴀ: {last_name}\n" + if username == "None": + msg += "" + else: + msg += f" ┣ ᴜsᴇʀɴᴀᴍᴇ: @{username}\n" + msg += f" ┗ ʙᴏᴛ: {bot.me.mention}\n" + buttons = [ + [ + InlineKeyboardButton( + f"{full_name}", + url=f"tg://openmessage?user_id={get.id}", + ) + ] + ] + await callback_query.message.reply_text( + msg, reply_markup=InlineKeyboardMarkup(buttons) + ) + except Exception as why: + await callback_query.message.reply_text(why) + + +async def batal_callback(client, callback_query): + user_id = int(callback_query.data.split()[1]) + if user_id in SUPPORT: + try: + SUPPORT.remove(user_id) + await callback_query.message.delete() + buttons = Button.start(callback_query) + return await bot.send_message( + user_id, + MSG.START(callback_query), + reply_markup=InlineKeyboardMarkup(buttons), + ) + except Exception as why: + await callback_query.message.delete() + await bot.send_message(user_id, f"❌ ɢᴀɢᴀʟ ᴅɪʙᴀᴛᴀʟᴋᴀɴ! {why}") diff --git a/ubot/core/plugins/srh.py b/ubot/core/plugins/srh.py new file mode 100644 index 0000000000000000000000000000000000000000..00eeede40c97667acd99841dff989f2acfbf079a --- /dev/null +++ b/ubot/core/plugins/srh.py @@ -0,0 +1,56 @@ +import random + +from pyrogram.types import InputMediaPhoto + + +async def pic_bing_cmd(client, message): + TM = await message.reply("Processing...") + if len(message.command) < 2: + return await TM.edit(f"{message.text} [query]") + x = await client.get_inline_bot_results( + message.command[0], message.text.split(None, 1)[1] + ) + get_media = [] + for X in range(4): + try: + saved = await client.send_inline_bot_result( + client.me.id, x.query_id, x.results[random.randrange(len(x.results))].id + ) + saved = await client.get_messages( + client.me.id, int(saved.updates[1].message.id) + ) + get_media.append(InputMediaPhoto(saved.photo.file_id)) + await saved.delete() + except: + pass + if len(get_media) == 0: + return await TM.edit("❌ Foto tidak ditemukan.") + else: + await client.send_media_group( + message.chat.id, + get_media, + reply_to_message_id=message.id, + ) + return await TM.delete() + + +async def gif_cmd(client, message): + if len(message.command) < 2: + return await message.reply(f"{message.text} [query]") + TM = await message.reply("Processing...") + try: + x = await client.get_inline_bot_results( + message.command[0], message.text.split(None, 1)[1] + ) + saved = await client.send_inline_bot_result( + client.me.id, x.query_id, x.results[random.randrange(len(x.results))].id + ) + except: + await message.reply("❌ Gif tidak ditemukan.") + return await TM.delete() + saved = await client.get_messages(client.me.id, int(saved.updates[1].message.id)) + await client.send_animation( + message.chat.id, saved.animation.file_id, reply_to_message_id=message.id + ) + await TM.delete() + return await saved.delete() diff --git a/ubot/core/plugins/staus.py b/ubot/core/plugins/staus.py new file mode 100644 index 0000000000000000000000000000000000000000..bccf272f85464bbb2293229aa46b2c3449976d98 --- /dev/null +++ b/ubot/core/plugins/staus.py @@ -0,0 +1,115 @@ +from datetime import datetime +from time import time + +from pyrogram.raw.functions import Ping +from pyrogram.types import * + +from ubot import (DEVS, get_expired_date, get_prefix, get_seles, get_time, + start_time, ubot) + +# from .str import * + + +async def profile_command(client, message): + dia = message.from_user.id + my_id = [] + for _ubot_ in ubot._ubot: + my_id.append(_ubot_.me.id) + if dia in my_id: + status2 = "aktif" + else: + status2 = "tidak aktif" + if dia in DEVS: + status = "premium [kepala toko]" + elif dia in await get_seles(): + status = "premium [kasir]" + else: + status = "premium [pembeli]" + + uptime = await get_time((time() - start_time)) + start = datetime.now() + await client.invoke(Ping(ping_id=0)) + end = datetime.now() + (end - start).microseconds / 1000 + exp = await get_expired_date(dia) + prefix = await get_prefix(dia) + habis = exp.strftime("%d.%m.%Y") if exp else "None" + "Aktif" if habis else "Nonaktif" + b = InlineKeyboardMarkup( + [[InlineKeyboardButton(text="Tutup", callback_data="0_cls")]] + ) + await message.reply_text( + f""" +HimiUbot + Status Ubot: {status2} + Status Pengguna: {status} + Prefixes : {prefix[0]} + Tanggal Kedaluwarsa: {habis} + Uptime Ubot: {uptime} +""", + reply_markup=b, + ) + + +async def ewdsfgj(client, callback_query): + user_id = callback_query.from_user.id + my_id = [] + for _ubot_ in ubot._ubot: + my_id.append(_ubot_.me.id) + + if user_id in my_id: + status2 = "aktif" + else: + status2 = "tidak aktif" + + if user_id in DEVS: + status = "premium [kepala toko]" + elif user_id in await get_seles(): + status = "premium [kasir]" + else: + status = "premium [pembeli]" + uptime = await get_time((time() - start_time)) + start = datetime.now() + await client.invoke(Ping(ping_id=0)) + end = datetime.now() + (end - start).microseconds / 1000 + exp = await get_expired_date(user_id) + habis = exp.strftime("%d.%m.%Y") if exp else "None" + prefix = await get_prefix(user_id) + ubotstatus = "Aktif" if habis else "Nonaktif" + + if ubotstatus == "Nonaktif": + keyboard = InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton( + text="Buat Userbot", callback_data="start_pmb" + ), + ], + [ + InlineKeyboardButton(text="Kembali", callback_data="start0"), + InlineKeyboardButton(text="Tutup", callback_data="0_cls"), + ], + ] + ) + else: + keyboard = InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton(text="Kembali", callback_data="start0"), + InlineKeyboardButton(text="Tutup", callback_data="0_cls"), + ], + ] + ) + + await callback_query.edit_message_text( + f""" +HimiUbot + Status Ubot: {status2} + Status Pengguna: {status} + Prefixes : {prefix[0]} + Tanggal Kedaluwarsa: {habis} + Uptime Ubot: {uptime} +""", + reply_markup=keyboard, + ) diff --git a/ubot/core/plugins/stf.py b/ubot/core/plugins/stf.py new file mode 100644 index 0000000000000000000000000000000000000000..683476a92a55177f6f2e510bd65ee358f475e006 --- /dev/null +++ b/ubot/core/plugins/stf.py @@ -0,0 +1,91 @@ +async def staff_cmd(client, message): + chat_title = message.chat.title + creator = [] + co_founder = [] + admin = [] + async for x in message.chat.get_members(): + mention = f"{x.user.first_name} {x.user.last_name or ''}" + if ( + x.status.value == "administrator" + and x.privileges + and x.privileges.can_promote_members + ): + if x.custom_title: + co_founder.append(f" ┣ {mention} - {x.custom_title}") + else: + co_founder.append(f" ┣ {mention}") + elif x.status.value == "administrator": + if x.custom_title: + admin.append(f" ┣ {mention} - {x.custom_title}") + else: + admin.append(f" ┣ {mention}") + elif x.status.value == "owner": + if x.custom_title: + creator.append(f" ┗ {mention} - {x.custom_title}") + else: + creator.append(f" ┗ {mention}") + if not co_founder and not admin: + result = f""" +Staff Grup +{chat_title} + +👑 Owner: +{creator[0]}""" + elif not co_founder: + adm = admin[-1].replace("┣", "┗") + admin.pop(-1) + admin.append(adm) + result = f""" +Staff Grup +{chat_title} + +👑 Owner: +{creator[0]} + +👮 Admin: +""" + "\n".join( + admin + ) + elif not admin: + cof = co_founder[-1].replace(" ┣", " ┗") + co_founder.pop(-1) + co_founder.append(cof) + result = f""" +Staff Grup +{chat_title} + +👑 Owner: +{creator[0]} + +👮 Co-Founder: +""" + "\n".join( + co_founder + ) + else: + adm = admin[-1].replace(" ┣", " ┗") + admin.pop(-1) + admin.append(adm) + cof = co_founder[-1].replace(" ┣", " ┗") + co_founder.pop(-1) + co_founder.append(cof) + result = ( + ( + f""" +Staff Grup +{chat_title} + +👑 Owner: +{creator[0]} + +👮 Co-Founder: +""" + + "\n".join(co_founder) + + """ + +👮 Admin: +""" + ) + + "\n".join(admin) + ) + + await message.reply(result) diff --git a/ubot/core/plugins/str.py b/ubot/core/plugins/str.py new file mode 100644 index 0000000000000000000000000000000000000000..39b2e540368a5d5fede75e7109d01524f65a5069 --- /dev/null +++ b/ubot/core/plugins/str.py @@ -0,0 +1,182 @@ +import asyncio +from datetime import datetime +from gc import get_objects + +from pyrogram.raw.functions import Ping +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup + +from ubot import * + +PING = "🏓" +PONG = "🗿" + + +async def send_msg_to_owner(client, message): + if message.from_user.id == OWNER_ID: + return + else: + buttons = [ + [ + InlineKeyboardButton( + "👤 Profile", callback_data=f"profil {message.from_user.id}" + ), + InlineKeyboardButton( + "Reply 💬", callback_data=f"jawab_pesan {message.from_user.id}" + ), + ], + ] + await client.send_message( + OWNER_ID, + f"{message.from_user.first_name} {message.from_user.last_name or ''}\n\n{message.text}", + reply_markup=InlineKeyboardMarkup(buttons), + ) + + +async def reak(client, message): + await client.send_reaction(message.chat.id, message.id, "🗿") + + +async def ping_cmd(client, message): + # uptime = await get_time((time() - start_time)) + start = datetime.now() + x = await client.get_me() + await client.invoke(Ping(ping_id=0)) + end = datetime.now() + delta_ping = (end - start).microseconds / 1000 + gua = client.me.is_premium + ping = await get_var(client.me.id, "emoji1") + cos_ping2 = ping if ping else PING + ping_id = await get_var(client.me.id, "emoji_id1") + cos_ping = ping_id if ping_id else "5269563867305879894" + pong = await get_var(client.me.id, "emoji2") + cos_pong2 = pong if pong else PONG + pong_id = await get_var(client.me.id, "emoji_id2") + cos_pong = pong_id if pong_id else "6183961455436498818" + if gua == True: + _ping = f""" +**{cos_ping2} Pong !!** +**{cos_pong2}`{str(delta_ping).replace('.', ',')}ms`** + **Owner {x.first_name}** +""" + elif gua == False: + _ping = f""" +**{cos_ping2} Pong !!** +**{cos_pong2} `{str(delta_ping).replace('.', ',')} ms`** + **Owner {x.first_name}**""" + await message.reply(_ping) + + +async def set_emoji(client, message): + jing = await message.reply("`Processing...`") + gua = client.me.is_premium + emoji = get_arg(message) + emoji_id = None + if emoji: + emojinya = emoji + if gua == True: + if message.entities: + for entity in message.entities: + if entity.custom_emoji_id: + emoji_id = entity.custom_emoji_id + break + if emoji_id: + await set_var(client.me.id, "emoji_id1", emoji_id) + await jing.edit( + f"Emoji 1 has been set to: {emojinya}" + ) + elif gua == False: + await set_var(client.me.id, "emoji1", emojinya) + await jing.edit(f"**Custom emoji has been set to `{emojinya}`**") + + +async def set_emoji2(client, message): + jing = await message.reply("`Processing...`") + gua = client.me.is_premium + emoji = get_arg(message) + emoji_id = None + if emoji: + emojinya = emoji + if gua == True: + if message.entities: + for entity in message.entities: + if entity.custom_emoji_id: + emoji_id = entity.custom_emoji_id + break + if emoji_id: + await set_var(client.me.id, "emoji_id2", emoji_id) + await jing.edit( + f"Emoji 2 has been set to: {emojinya}" + ) + elif gua == False: + await set_var(client.me.id, "emoji2", emojinya) + await jing.edit(f"**Custom emoji 2 has been set to `{emojinya}`**") + + +async def set_emoji3(client, message): + jing = await message.reply("`Processing...`") + user_id = client.me.id + rep = message.reply_to_message + emoji = get_arg(message) + if rep: + if rep.text: + emojinya = rep.text + else: + return await jing.edit("`Please reply to a message to set it as emoji.`") + elif emoji: + emojinya = emoji + else: + return await jing.edit( + "`Please reply to a message or provide text to set as emoji`" + ) + await set_var(user_id, "ICON_PONG", emojinya) + await jing.edit(f"**Custom emoji has been set to `{emojinya}`**") + + +async def start_cmd(client, message): + await add_served_user(message.from_user.id) + await send_msg_to_owner(client, message) + if len(message.command) < 2: + buttons = Button.start(message) + msg = MSG.START(message) + await message.reply(msg, reply_markup=InlineKeyboardMarkup(buttons)) + else: + txt = message.text.split(None, 1)[1] + msg_id = txt.split("_", 1)[1] + send = await message.reply("Please wait...") + if "secretMsg" in txt: + try: + m = [obj for obj in get_objects() if id(obj) == int(msg_id)][0] + except Exception as error: + return await send.edit(f"❌ Error: {error}") + user_or_me = [m.reply_to_message.from_user.id, m.from_user.id] + if message.from_user.id not in user_or_me: + return await send.edit( + f"❌ Don't Click This Message {message.from_user.first_name} {message.from_user.last_name or ''}" + ) + else: + text = await client.send_message( + message.chat.id, + m.text.split(None, 1)[1], + protect_content=True, + reply_to_message_id=message.id, + ) + await send.delete() + await asyncio.sleep(120) + await message.delete() + await text.delete() + elif "copyMsg" in txt: + try: + m = [obj for obj in get_objects() if id(obj) == int(msg_id)][0] + except Exception as error: + return await send.edit(f"❌ ᴇʀʀᴏʀ: {error}") + id_copy = int(m.text.split()[1].split("/")[-1]) + if "t.me/c/" in m.text.split()[1]: + chat = int("-100" + str(m.text.split()[1].split("/")[-2])) + else: + chat = str(m.text.split()[1].split("/")[-2]) + try: + get = await client.get_messages(chat, id_copy) + await get.copy(message.chat.id, reply_to_message_id=message.id) + await send.delete() + except Exception as error: + await send.edit(error) diff --git a/ubot/core/plugins/tll.py b/ubot/core/plugins/tll.py new file mode 100644 index 0000000000000000000000000000000000000000..56e2b180cafc91b7c64c9ed4d06ff73219389b9d --- /dev/null +++ b/ubot/core/plugins/tll.py @@ -0,0 +1,47 @@ +from asyncio import sleep + +from ubot import * + +spam_chats = [] + +stopProcess = False + + +async def mentionall(client: Client, message: Message): + chat_id = message.chat.id + direp = message.reply_to_message.text + if not direp: + await message.reply("Silakan balas ke pesan !") + return + spam_chats.append(chat_id) + usrnum = 0 + usrtxt = "" + async for usr in client.get_chat_members(chat_id): + if not chat_id in spam_chats: + break + elif usr.user.is_bot == True: + pass + elif usr.user.is_deleted == True: + pass + usrnum += 1 + usrtxt += f"**👤 [{usr.user.first_name}](tg://user?id={usr.user.id})**\n" + if usrnum == 5: + if direp: + txt = f"**{direp}**\n\n{usrtxt}\n" + await client.send_message(chat_id, txt) + await sleep(2) + try: + spam_chats.remove(chat_id) + except: + pass + + +async def batal_tag(client, message): + if not message.chat.id in spam_chats: + return await message.reply("`Sepertinya tidak ada tagall disini.`") + else: + try: + spam_chats.remove(message.chat.id) + except: + pass + return await message.reply("`Tag All Diberhentikan.`") diff --git a/ubot/core/plugins/tny.py b/ubot/core/plugins/tny.py new file mode 100644 index 0000000000000000000000000000000000000000..72bd3ae666ef2690f41bde38877d3ce4ca20bf65 --- /dev/null +++ b/ubot/core/plugins/tny.py @@ -0,0 +1,83 @@ +import asyncio +import os + +import cv2 +from PIL import Image + +from ubot import * + + +async def tiny_cmd(client, message): + reply = message.reply_to_message + if not (reply and (reply.media)): + return await message.reply("Silakan balas stiker !") + Tm = await message.reply("Processing......") + ik = await client.download_media(reply) + im1 = Image.open("storage/TM_BLACK.png") + if ik.endswith(".tgs"): + await client.download_media(reply, "Tm.tgs") + await bash("lottie_convert.py man.tgs json.json") + json = open("json.json", "r") + jsn = json.read() + jsn = jsn.replace("512", "2000") + ("json.json", "w").write(jsn) + await bash("lottie_convert.py json.json Tm.tgs") + file = "man.tgs" + os.remove("json.json") + elif ik.endswith((".gif", ".mp4")): + iik = cv2.VideoCapture(ik) + busy = iik.read() + cv2.imwrite("i.png", busy) + fil = "i.png" + im = Image.open(fil) + z, d = im.size + if z == d: + xxx, yyy = 200, 200 + else: + t = z + d + a = z / t + b = d / t + aa = (a * 100) - 50 + bb = (b * 100) - 50 + xxx = 200 + 5 * aa + yyy = 200 + 5 * bb + k = im.resize((int(xxx), int(yyy))) + k.save("k.png", format="PNG", optimize=True) + im2 = Image.open("k.png") + back_im = im1.copy() + back_im.paste(im2, (150, 0)) + back_im.save("o.webp", "WEBP", quality=95) + file = "o.webp" + os.remove(fil) + os.remove("k.png") + else: + im = Image.open(ik) + z, d = im.size + if z == d: + xxx, yyy = 200, 200 + else: + t = z + d + a = z / t + b = d / t + aa = (a * 100) - 50 + bb = (b * 100) - 50 + xxx = 200 + 5 * aa + yyy = 200 + 5 * bb + k = im.resize((int(xxx), int(yyy))) + k.save("k.png", format="PNG", optimize=True) + im2 = Image.open("k.png") + back_im = im1.copy() + back_im.paste(im2, (150, 0)) + back_im.save("o.webp", "WEBP", quality=95) + file = "o.webp" + os.remove("k.png") + await asyncio.gather( + Tm.delete(), + client.send_sticker( + message.chat.id, + sticker=file, + reply_to_message_id=message.id, + ), + ) + os.remove(file) + os.remove(ik) diff --git a/ubot/core/plugins/tph.py b/ubot/core/plugins/tph.py new file mode 100644 index 0000000000000000000000000000000000000000..7368999287462da883cab0e3fd7a4424724ccbb1 --- /dev/null +++ b/ubot/core/plugins/tph.py @@ -0,0 +1,28 @@ +from telegraph import Telegraph, exceptions, upload_file + +from ubot import * + + +async def tg_cmd(client, message): + XD = await message.reply("Processing... . .") + if not message.reply_to_message: + return await XD.edit("Silakan balas ke pesan media.") + telegraph = Telegraph() + if message.reply_to_message.media: + m_d = await dl_pic(client, message.reply_to_message) + try: + media_url = upload_file(m_d) + except exceptions.TelegraphException as exc: + return await XD.edit(f"{exc}") + U_done = f"Diupload ke : Klik Disini" + await XD.edit(U_done) + elif message.reply_to_message.text: + page_title = f"{client.me.first_name} {client.me.last_name or ''}" + page_text = message.reply_to_message.text + page_text = page_text.replace("\n", "
") + try: + response = telegraph.create_page(page_title, html_content=page_text) + except exceptions.TelegraphException as exc: + return await XD.edit(f"{exc}") + wow_graph = f"Diupload ke : Klik Disini" + await XD.edit(wow_graph) diff --git a/ubot/core/plugins/trl.py b/ubot/core/plugins/trl.py new file mode 100644 index 0000000000000000000000000000000000000000..b2249f93c2489b7a82779f465d6eb8d4cce88845 --- /dev/null +++ b/ubot/core/plugins/trl.py @@ -0,0 +1,107 @@ +import os +from gc import get_objects + +import gtts +from gpytranslate import Translator +from pykeyboard import InlineKeyboard + +from ubot import * + + +async def tts_cmd(client, message): + TM = await message.reply("Please wait...") + if message.reply_to_message: + language = client._translate[client.me.id]["negara"] + words_to_say = message.reply_to_message.text or message.reply_to_message.caption + else: + if len(message.command) < 2: + return await TM.edit(f"{message.text} reply/text") + else: + language = client._translate[client.me.id]["negara"] + words_to_say = message.text.split(None, 1)[1] + speech = gtts.gTTS(words_to_say, lang=language) + speech.save("text_to_speech.oog") + rep = message.reply_to_message or message + try: + await client.send_voice( + chat_id=message.chat.id, + voice="text_to_speech.oog", + reply_to_message_id=rep.id, + ) + await TM.delete() + except Exception as error: + await TM.edit(error) + try: + os.remove("text_to_speech.oog") + except FileNotFoundError: + pass + + +async def tr_cmd(client, message): + trans = Translator() + TM = await message.reply("Processing...") + if message.reply_to_message: + dest = client._translate[client.me.id]["negara"] + to_translate = message.reply_to_message.text or message.reply_to_message.caption + source = await trans.detect(to_translate) + else: + if len(message.command) < 2: + return await message.reply(f"{message.text} [reply to message]") + else: + dest = client._translate[client.me.id]["negara"] + to_translate = message.text.split(None, 1)[1] + source = await trans.detect(to_translate) + translation = await trans(to_translate, sourcelang=source, targetlang=dest) + reply = f"{translation.text}" + rep = message.reply_to_message or message + await TM.delete() + await client.send_message(message.chat.id, reply, reply_to_message_id=rep.id) + + +async def set_lang_cmd(client, message): + query = id(message) + try: + x = await client.get_inline_bot_results(bot.me.username, f"ubah_bahasa {query}") + return await message.reply_inline_bot_result(x.query_id, x.results[0].id) + except Exception as error: + return await message.reply(error) + + +async def ubah_bahasa_inline(client, inline_query): + buttons = InlineKeyboard(row_width=3) + keyboard = [] + for X in lang_code_translate: + keyboard.append( + InlineKeyboardButton( + Fonts.smallcap(X.lower()), + callback_data=f"set_bahasa {int(inline_query.query.split()[1])} {X}", + ) + ) + buttons.add(*keyboard) + await client.answer_inline_query( + inline_query.id, + cache_time=0, + results=[ + ( + InlineQueryResultArticle( + title="Select Language!", + reply_markup=buttons, + input_message_content=InputTextMessageContent( + "Please Select Language" + ), + ) + ) + ], + ) + + +async def set_bahasa_callback(client, callback_query): + data = callback_query.data.split() + try: + m = [obj for obj in get_objects() if id(obj) == int(data[1])][0] + m._client._translate[m._client.me.id] = {"negara": lang_code_translate[data[2]]} + return await callback_query.edit_message_text( + f"✅ Successfully Changed Language To: {Fonts.smallcap(data[2].lower())}" + ) + except Exception as error: + return await callback_query.edit_message_text(f"{error}") diff --git a/ubot/core/plugins/ttr.py b/ubot/core/plugins/ttr.py new file mode 100644 index 0000000000000000000000000000000000000000..b3b5bcf7e126b637139f1bdef979bc9b789af528 --- /dev/null +++ b/ubot/core/plugins/ttr.py @@ -0,0 +1,65 @@ +from ubot import * + + +async def cb_tutor(client, callback_query): + await callback_query.edit_message_text( + text="""Tutorial Membuat Userbot :""", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton(text="Admin", callback_data="start_admin"), + ], + [ + InlineKeyboardButton( + text="Tutorial Ambil API ID", url="https://t.me/loghimikoubot/6" + ), + InlineKeyboardButton( + text="Tutorial Buat Userbot", url="https://t.me/loghimikoubot/7" + ), + ], + [ + InlineKeyboardButton(text="Kembali", callback_data="start0"), + ], + ] + ), + ) + + +async def asdksd(client, callback_query): + if callback_query.from_user.id in DEVS: + buttons = [ + [ + InlineKeyboardButton("Buat Userbot", callback_data="bahan"), + InlineKeyboardButton("Tutorial", callback_data="cb_tutor"), + ], + [ + InlineKeyboardButton("Menu Bantuan", callback_data="help_back"), + InlineKeyboardButton("Pertanyaan", callback_data="support"), + ], + [InlineKeyboardButton("Status Akun", callback_data="start_profile")], + ] + else: + buttons = [ + [ + InlineKeyboardButton("Buat Userbot", callback_data="bahan"), + InlineKeyboardButton("Tutorial", callback_data="cb_tutor"), + ], + [ + InlineKeyboardButton("Menu Bantuan", callback_data="help_back"), + InlineKeyboardButton("Pertanyaan", callback_data="support"), + ], + [InlineKeyboardButton("Status Akun", callback_data="start_profile")], + ] + msg = f""" +👋 Halo {callback_query.from_user.first_name} !! + +Apa Ada Yang Bisa Saya Bantu ? Jika Kamu Sudah Melakukan Pembayaran Silakan Klik Tombol Buat Userbot. + +Atau Kamu Bisa Melihat Tutorial Terlebih Dahulu Untuk Membuat Userbot. + +Dan Jika Kamu Belum Mendapatkan Akses Silakan Contact Admin Untuk Meminta Akses, Serta Kirimkan Bukti Tangkapan Layar Pembayaran. +""" + await callback_query.edit_message_text( + msg, reply_markup=InlineKeyboardMarkup(buttons) + ) + await add_served_user(callback_query.from_user.id) diff --git a/ubot/core/plugins/vcplayer_commands.py b/ubot/core/plugins/vcplayer_commands.py new file mode 100644 index 0000000000000000000000000000000000000000..646c12afb2663142febd7fbb6c6bb9be21d5c0f5 --- /dev/null +++ b/ubot/core/plugins/vcplayer_commands.py @@ -0,0 +1,220 @@ +from datetime import timedelta +from yt_dlp import YoutubeDL +from pytgcalls.types import MediaStream, AudioQuality +from pytgcalls.exceptions import NoActiveGroupCall +from pyrogram import Client +from pyrogram.types import Message +import asyncio +import os + +PLAYLIST = {} + +async def start_next_song(client, chat_id): + if chat_id in PLAYLIST and PLAYLIST[chat_id]: + next_song = PLAYLIST[chat_id][0] + audio_url, title, duration = next_song + + try: + await client.send_message( + chat_id, + f"▶️ Now Playing: {title}\n" + f"⏳ Duration: {timedelta(seconds=duration)}" + ) + except Exception as e: + print(f"❌ Failed to send message: {e}") + + try: + # First try to get the call status + try: + await client.call_py.get_call(chat_id) + except NoActiveGroupCall: + # If not in call, try to join + await client.call_py.join_call(chat_id) + print(f"Successfully joined call in {chat_id}") + + # Wait a bit before playing + await asyncio.sleep(1) + + # Set up audio stream with specific parameters + await client.call_py.play( + chat_id, + MediaStream( + audio_url, + AudioQuality.HIGH, + video_parameters=None, + audio_parameters={ + "bitrate": 48000, + "channels": 2, + "sample_rate": 48000 + }, + stream_type=1 + ) + ) + print(f"Successfully started playing in {chat_id}") + except Exception as e: + print(f"Error in voice chat: {e}") + if "already joined" in str(e).lower(): + try: + await client.call_py.play( + chat_id, + MediaStream( + audio_url, + AudioQuality.HIGH, + video_parameters=None, + audio_parameters={ + "bitrate": 48000, + "channels": 2, + "sample_rate": 48000 + }, + stream_type=1 + ) + ) + except Exception as play_error: + print(f"Failed to play after join: {play_error}") + return await client.send_message(chat_id, "❌ Failed to play song. Please try again.") + else: + return await client.send_message(chat_id, "⚠️ Failed to join voice chat. Please make sure:\n1. Voice chat is started\n2. You are in the voice chat") + +async def stop_vc(client, message, chat_id=None): + if chat_id is None and message: + chat_id = message.chat.id + elif chat_id is None: + return + + if chat_id in PLAYLIST: + PLAYLIST.pop(chat_id, None) + try: + await client.call_py.leave_call(chat_id) + except NoActiveGroupCall: + if message: + await message.reply("⚠️ No active voice chat.") + + if message: + await message.reply("⏹️ Music stopped and playlist cleared.") + +async def play_vc(client: Client, message: Message): + msg = await message.reply("Searching and downloading music...") + + if len(message.command) < 2: + return await msg.edit("❌ Please enter a song title or YouTube link.") + + query = " ".join(message.command[1:]) + chat_id = message.chat.id + + # Create downloads directory if it doesn't exist + if not os.path.exists("downloads"): + os.makedirs("downloads") + + ydl_opts = { + "format": "bestaudio/best", + "quiet": True, + "default_search": "ytsearch1", + "cookiefile": "cookies.txt", + "extract_flat": True, + "no_warnings": True, + "prefer_insecure": True, + "outtmpl": "downloads/%(title)s.%(ext)s", + "postprocessors": [{ + "key": "FFmpegExtractAudio", + "preferredcodec": "mp3", + "preferredquality": "192", + }] + } + + try: + # Try to join the voice chat + try: + await client.call_py.join_call(chat_id) + print(f"Successfully joined call in {chat_id}") + except Exception as e: + if "already joined" not in str(e).lower(): + return await msg.edit("⚠️ Failed to join voice chat. Please make sure:\n1. Voice chat is started\n2. You are in the voice chat") + print("Already in voice chat") + + # Download the song + with YoutubeDL(ydl_opts) as ydl: + info = ydl.extract_info(query, download=True) + + if not info or "url" not in info: + return await msg.edit("❌ Failed to get song data. Please try again.") + + title = info.get("title", "Unknown Title") + duration = info.get("duration", 0) + views = info.get("view_count", 0) + channel = info.get("uploader", "Unknown") + link = info.get("webpage_url", "#") + + # Get the downloaded file path + file_path = f"downloads/{title}.mp3" + if not os.path.exists(file_path): + return await msg.edit("❌ Failed to download the song. Please try again.") + + # Wait a bit before playing + await asyncio.sleep(1) + + # Add to playlist + song_data = (file_path, title, duration) + if chat_id not in PLAYLIST: + PLAYLIST[chat_id] = [] + PLAYLIST[chat_id].append(song_data) + + # Start playing + try: + await client.call_py.play( + chat_id, + MediaStream( + file_path, + AudioQuality.HIGH, + video_parameters=None, + audio_parameters={ + "bitrate": 48000, + "channels": 2, + "sample_rate": 48000 + }, + stream_type=1 + ) + ) + print(f"Successfully started playing in {chat_id}") + except Exception as e: + print(f"Failed to play: {e}") + return await msg.edit("❌ Failed to play song. Please try again.") + + await msg.edit( + f"💡 Song Information\n\n" + f"🏷 Title: {title}\n" + f"🧭 Duration: {timedelta(seconds=duration)}\n" + f"👀 Views: {views:,}\n" + f"📢 Channel: {channel}\n" + f"🔗 Link: YouTube\n\n" + f"⚡ Powered by: {channel}" + ) + + except Exception as e: + await msg.edit(f"❌ An error occurred: {e}") + +async def skip_vc(client, message: Message): + chat_id = message.chat.id + if chat_id not in PLAYLIST or not PLAYLIST[chat_id]: + return await message.reply("❌ No songs to skip.") + + PLAYLIST[chat_id].pop(0) + if PLAYLIST[chat_id]: + await start_next_song(client, chat_id) + else: + await stop_vc(client, message, chat_id) + +async def end_vc(client, message: Message): + await stop_vc(client, message, message.chat.id) + +async def show_playlist(client, message: Message): + chat_id = message.chat.id + if chat_id not in PLAYLIST or not PLAYLIST[chat_id]: + return await message.reply("📭 Playlist is empty.") + + playlist_text = "🎶 Current Playlist:\n" + for i, song in enumerate(PLAYLIST[chat_id], 1): + title = song[1] + duration = timedelta(seconds=song[2]) + playlist_text += f"\n🎵 {i}. {title} - {duration}" + + await message.reply(playlist_text) diff --git a/ubot/core/plugins/vctls.txt b/ubot/core/plugins/vctls.txt new file mode 100644 index 0000000000000000000000000000000000000000..a39f06586e23c1cd114c2cdd2e6fdc9b3e423324 --- /dev/null +++ b/ubot/core/plugins/vctls.txt @@ -0,0 +1,126 @@ +from asyncio import sleep +from contextlib import suppress +from random import randint +from typing import Optional + +from pyrogram import Client, enums +from pyrogram.raw.functions.channels import GetFullChannel +from pyrogram.raw.functions.messages import GetFullChat +from pyrogram.raw.functions.phone import CreateGroupCall, DiscardGroupCall +from pyrogram.raw.types import InputGroupCall, InputPeerChannel, InputPeerChat +from pyrogram.types import Message +from pytgcalls.exceptions import AlreadyJoinedError +from pytgcalls.types.input_stream import InputAudioStream, InputStream + +from ubot import * + + +async def get_group_call( + client: Client, message: Message, err_msg: str = "" +) -> Optional[InputGroupCall]: + chat_peer = await client.resolve_peer(message.chat.id) + if isinstance(chat_peer, (InputPeerChannel, InputPeerChat)): + if isinstance(chat_peer, InputPeerChannel): + full_chat = ( + await client.invoke(GetFullChannel(channel=chat_peer)) + ).full_chat + elif isinstance(chat_peer, InputPeerChat): + full_chat = ( + await client.invoke(GetFullChat(chat_id=chat_peer.chat_id)) + ).full_chat + if full_chat is not None: + return full_chat.call + await eor(message, f"**No group call Found** {err_msg}") + return False + + +async def start_vctools(client, message): + flags = " ".join(message.command[1:]) + ky = await message.reply("Processing....") + vctitle = get_arg(message) + if flags == enums.ChatType.CHANNEL: + chat_id = message.chat.title + else: + chat_id = message.chat.id + args = f"• Obrolan Suara Aktif\n• Chat : {message.chat.title}" + try: + if not vctitle: + await client.invoke( + CreateGroupCall( + peer=(await client.resolve_peer(chat_id)), + random_id=randint(10000, 999999999), + ) + ) + else: + args += f"\n • Title : {vctitle}" + await client.invoke( + CreateGroupCall( + peer=(await client.resolve_peer(chat_id)), + random_id=randint(10000, 999999999), + title=vctitle, + ) + ) + await ky.edit(args) + except Exception as e: + await ky.edit(f"INFO: `{e}`") + + +async def stop_vctools(client, message): + ky = await message.reply("Processing....") + message.chat.id + if not ( + group_call := (await get_group_call(client, message, err_msg=", Kesalahan...")) + ): + return + await client.invoke(DiscardGroupCall(call=group_call)) + await ky.edit( + f"• Obrolan Suara Diakhiri\n• Chat : {message.chat.title}" + ) + + +async def join_os(client, message): + # global turun_dewek + ky = await message.reply("Processing....") + chat_id = message.command[1] if len(message.command) > 1 else message.chat.id + with suppress(ValueError): + chat_id = int(chat_id) + if chat_id: + file = "./storage/vc.mp3" + try: + # daftar_join.append(chat_id) + # if turun_dewek: turun_dewek = False + await client.call_py.join_group_call( + chat_id, + InputStream( + InputAudioStream( + file, + ), + ), + ) + await sleep(2) + await ky.edit( + f"❏ Berhasil Join Voice Chat\n└ Chat :{message.chat.title}" + ) + await sleep(1) + except AlreadyJoinedError: + await ky.edit("Akun anda sudah diatas.") + except Exception as e: + return await ky.edit(f"ERROR: {e}") + + +async def turun_os(client, message): + # global turun_dewek + ky = await message.reply("Processing....") + chat_id = message.command[1] if len(message.command) > 1 else message.chat.id + with suppress(ValueError): + chat_id = int(chat_id) + if chat_id: + try: + # daftar_join.remove(chat_id) + await client.call_py.leave_group_call(chat_id) + # turun_dewek = True + await ky.edit( + f"❏ Berhasil Meninggalkan Voice Chat\n└ Chat :{message.chat.title}" + ) + except Exception as e: + return await ky.edit(f"ERROR: {e}") diff --git a/ubot/core/plugins/wbs.py b/ubot/core/plugins/wbs.py new file mode 100644 index 0000000000000000000000000000000000000000..e322ed7a72d6a7ef29f1b38540a074cce68a9f19 --- /dev/null +++ b/ubot/core/plugins/wbs.py @@ -0,0 +1,67 @@ +from asyncio import gather +from base64 import b64decode +from io import BytesIO + +from ubot import * +from ubot.core.helpers.http import * + + +async def take_screenshot(url: str, full: bool = False): + url = "https://" + url if not url.startswith("http") else url + payload = { + "url": url, + "width": 1920, + "height": 1080, + "scale": 1, + "format": "jpeg", + } + if full: + payload["full"] = True + data = await post( + "https://webscreenshot.vercel.app/api", + data=payload, + ) + if "image" not in data: + return None + b = data["image"].replace("data:image/jpeg;base64,", "") + file = BytesIO(b64decode(b)) + file.name = "webss.jpg" + return file + + +async def take_ss(_, message): + if len(message.command) < 2: + return await message.reply("Berikan saya link yang valid") + + if len(message.command) == 2: + url = message.text.split(None, 1)[1] + full = False + elif len(message.command) == 3: + url = message.text.split(None, 2)[1] + full = message.text.split(None, 2)[2].lower().strip() in [ + "yes", + "y", + "1", + "true", + ] + else: + return await message.reply("Ada yang salah.") + + m = await message.reply("Processing...") + + try: + photo = await take_screenshot(url, full) + if not photo: + return await m.edit("Terjadi kesalahan.") + + m = await m.edit("Uploading...") + + if not full: + # Full size images have problem with reply_photo, that's why + # we need to only use reply_photo if we're not using full size + await gather(*[message.reply_document(photo), message.reply_photo(photo)]) + else: + await message.reply_document(photo) + await m.delete() + except Exception as e: + await m.edit(str(e)) diff --git a/ubot/core/plugins/whs.py b/ubot/core/plugins/whs.py new file mode 100644 index 0000000000000000000000000000000000000000..534af0e5c27522d217c34fb2cd14a2c84c8f598c --- /dev/null +++ b/ubot/core/plugins/whs.py @@ -0,0 +1,128 @@ +from asyncio import gather +from os import remove + +from pyrogram.enums import ChatType + +from ubot import * + + +async def info_cmd(client, message): + user_id = await extract_user(message) + Tm = await message.reply("Processing...
") + if not user_id: + return await Tm.edit( + "Silakan balas pesan penggun atau berikan username" + ) + try: + user = await client.get_users(user_id) + username = f"@{user.username}" if user.username else "-" + first_name = f"{user.first_name}" if user.first_name else "-" + last_name = f"{user.last_name}" if user.last_name else "-" + fullname = ( + f"{user.first_name} {user.last_name}" if user.last_name else user.first_name + ) + user_details = (await client.get_chat(user.id)).bio + bio = f"{user_details}" if user_details else "-" + h = f"{user.status}" + if h.startswith("UserStatus"): + y = h.replace("UserStatus.", "") + status = y.capitalize() + else: + status = "-" + dc_id = f"{user.dc_id}" if user.dc_id else "-" + common = await client.get_common_chats(user.id) + out_str = f""" +Informasi Pengguna: + +🆔 ᴜsᴇʀ ɪᴅ: {user.id} +👤 ꜰɪʀsᴛ ɴᴀᴍᴇ: {first_name} +🗣️ ʟᴀsᴛ ɴᴀᴍᴇ: {last_name} +🌐 ᴜsᴇʀɴᴀᴍᴇ: {username} +🏛️ ᴅᴄ ɪᴅ: {dc_id} +🤖 ɪs ʙᴏᴛ: {user.is_bot} +🚷 ɪs sᴄᴀᴍ: {user.is_scam} +🚫 ʀᴇsᴛʀɪᴄᴛᴇᴅ: {user.is_restricted} +✅ ᴠᴇʀɪꜰɪᴇᴅ: {user.is_verified} +⭐ ᴘʀᴇᴍɪᴜᴍ: {user.is_premium} +📝 ᴜsᴇʀ ʙɪᴏ: {bio} + +👀 sᴀᴍᴇ ɢʀᴏᴜᴘs sᴇᴇɴ: {len(common)} +👁️ ʟᴀsᴛ sᴇᴇɴ: {status} +🔗 ᴜsᴇʀ ᴘᴇʀᴍᴀɴᴇɴᴛ ʟɪɴᴋ: {fullname} +""" + photo_id = user.photo.big_file_id if user.photo else None + if photo_id: + photo = await client.download_media(photo_id) + await gather( + Tm.delete(), + client.send_photo( + message.chat.id, + photo, + caption=out_str, + reply_to_message_id=message.id, + ), + ) + remove(photo) + else: + await Tm.edit(out_str, disable_web_page_preview=True) + except Exception as e: + return await Tm.edit(f"ɪɴꜰᴏ: {e}") + + +async def cinfo_cmd(client, message): + Tm = await message.reply("
Processing...") + try: + if len(message.text.split()) > 1: + chat_u = message.text.split()[1] + chat = await client.get_chat(chat_u) + else: + if message.chat.type == ChatType.PRIVATE: + return await Tm.edit( + f"Gunakan perintah ini digrup atau berikan username grup." + ) + else: + chatid = message.chat.id + chat = await client.get_chat(chatid) + h = f"{chat.type}" + if h.startswith("ChatType"): + y = h.replace("ChatType.", "") + type = y.capitalize() + else: + type = "Private" + username = f"@{chat.username}" if chat.username else "-" + description = f"{chat.description}" if chat.description else "-" + dc_id = f"{chat.dc_id}" if chat.dc_id else "-" + out_str = f""" +Informasi Obrolan: + +🆔 ᴄʜᴀᴛ ɪᴅ: {chat.id} +👥 ᴛɪᴛʟᴇ: {chat.title} +👥 ᴜsᴇʀɴᴀᴍᴇ: {username} +📩 ᴛʏᴘᴇ: {type} +🏛️ ᴅᴄ ɪᴅ: {dc_id} +🗣️ ɪs sᴄᴀᴍ: {chat.is_scam} +🎭 ɪs ꜰᴀᴋᴇ: {chat.is_fake} +✅ ᴠᴇʀɪꜰɪᴇᴅ: {chat.is_verified} +🚫 ʀᴇsᴛʀɪᴄᴛᴇᴅ: {chat.is_restricted} +🔰 ᴘʀᴏᴛᴇᴄᴛᴇᴅ: {chat.has_protected_content} + +🚻 ᴛᴏᴛᴀʟ ᴍᴇᴍʙᴇʀs: {chat.members_count} +📝 ᴅᴇsᴄʀɪᴘᴛɪᴏɴ: {description} +""" + photo_id = chat.photo.big_file_id if chat.photo else None + if photo_id: + photo = await client.download_media(photo_id) + await gather( + Tm.delete(), + client.send_photo( + message.chat.id, + photo, + caption=out_str, + reply_to_message_id=message.id, + ), + ) + remove(photo) + else: + await Tm.edit(out_str, disable_web_page_preview=True) + except Exception as e: + return await Tm.edit(f"ɪɴꜰᴏ: `{e}`") diff --git a/ubot/core/plugins/ytp.py b/ubot/core/plugins/ytp.py new file mode 100644 index 0000000000000000000000000000000000000000..88b8a239a0debd9cfca8ed2931fa46007ec857a3 --- /dev/null +++ b/ubot/core/plugins/ytp.py @@ -0,0 +1,197 @@ +import asyncio +import math +import os +from datetime import timedelta +from time import time + +import wget +from pyrogram.errors import FloodWait, MessageNotModified +from youtubesearchpython import VideosSearch + +from ubot import * + + +def humanbytes(size): + if not size: + return "" + power = 2**10 + raised_to_pow = 0 + dict_power_n = {0: "", 1: "ᴋʙ", 2: "ᴍʙ", 3: "ɢʙ", 4: "ᴛʙ"} + while size > power: + size /= power + raised_to_pow += 1 + return f"{str(round(size, 2))} {dict_power_n[raised_to_pow]}" + + +def time_formatter(milliseconds: int) -> str: + seconds, milliseconds = divmod(milliseconds, 1000) + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + tmp = ( + (f"{str(days)} ʜᴀʀɪ, " if days else "") + + (f"{str(hours)} ᴊᴀᴍ, " if hours else "") + + (f"{str(minutes)} ᴍᴇɴɪᴛ, " if minutes else "") + + (f"{str(seconds)} ᴅᴇᴛɪᴋ, " if seconds else "") + + (f"{str(milliseconds)} ᴍɪᴋʀᴏᴅᴇᴛɪᴋ, " if milliseconds else "") + ) + return tmp[:-2] + + +async def progress(current, total, message, start, type_of_ps, file_name=None): + now = time() + diff = now - start + if round(diff % 10.00) == 0 or current == total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + if elapsed_time == 0: + return + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "{0}{1} {2}%\n".format( + "".join("•" for _ in range(math.floor(percentage / 10))), + "".join("~" for _ in range(10 - math.floor(percentage / 10))), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nᴇsᴛɪᴍᴀsɪ: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + try: + await message.edit( + f""" +{type_of_ps} + +ID Berkas: {file_name} + +{tmp} +""" + ) + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass + else: + try: + await message.edit(f"{type_of_ps}\n{tmp}") + except FloodWait as e: + await asyncio.sleep(e.x) + except MessageNotModified: + pass + + +async def vsong_cmd(client, message): + if len(message.command) < 2: + return await message.reply_text( + "❌ Masukkan judul dengan benar.", + ) + infomsg = await message.reply_text("🔍 Searching...", quote=False) + try: + search = VideosSearch(message.text.split(None, 1)[1], limit=1).result()[ + "result" + ][0] + link = f"https://youtu.be/{search['id']}" + except Exception as error: + return await infomsg.edit(f"🔍 Searching...\n\n{error}") + try: + ( + file_name, + title, + url, + duration, + views, + channel, + thumb, + data_ytp, + ) = await YoutubeDownload(link, as_video=True) + except Exception as error: + return await infomsg.edit(f"📥 Downloading...\n\n{error}") + thumbnail = wget.download(thumb) + await client.send_video( + message.chat.id, + video=file_name, + thumb=thumbnail, + file_name=title, + duration=duration, + supports_streaming=True, + caption=data_ytp.format( + "ᴠɪᴅᴇᴏ", + title, + timedelta(seconds=duration), + views, + channel, + url, + bot.me.mention, + ), + progress=progress, + progress_args=( + infomsg, + time(), + "📥 Downloading...", + f"{search['id']}.mp4", + ), + reply_to_message_id=message.id, + ) + await infomsg.delete() + for files in (thumbnail, file_name): + if files and os.path.exists(files): + os.remove(files) + + +async def song_cmd(client, message): + if len(message.command) < 2: + return await message.reply_text( + "❌ Masukkan judul dengan benar.", + ) + infomsg = await message.reply_text("🔍 Searching...", quote=False) + try: + search = VideosSearch(message.text.split(None, 1)[1], limit=1).result()[ + "result" + ][0] + link = f"https://youtu.be/{search['id']}" + except Exception as error: + return await infomsg.edit(f"🔍 Searching...\n\n{error}") + try: + ( + file_name, + title, + url, + duration, + views, + channel, + thumb, + data_ytp, + ) = await YoutubeDownload(link, as_video=False) + except Exception as error: + return await infomsg.edit(f"📥 Downloading...\n\n{error}") + thumbnail = wget.download(thumb) + await client.send_audio( + message.chat.id, + audio=file_name, + thumb=thumbnail, + file_name=title, + performer=channel, + duration=duration, + caption=data_ytp.format( + "ᴀᴜᴅɪᴏ", + title, + timedelta(seconds=duration), + views, + channel, + url, + bot.me.mention, + ), + progress=progress, + progress_args=( + infomsg, + time(), + "📥 Downloading...", + f"{search['id']}.mp3", + ), + reply_to_message_id=message.id, + ) + await infomsg.delete() + for files in (thumbnail, file_name): + if files and os.path.exists(files): + os.remove(files) diff --git a/ubot/core/plugins/zbs.py b/ubot/core/plugins/zbs.py new file mode 100644 index 0000000000000000000000000000000000000000..92fa824e76bb90ac11343fdbff2066bf83369ca0 --- /dev/null +++ b/ubot/core/plugins/zbs.py @@ -0,0 +1,18 @@ +async def zombies_cmd(client, message): + chat_id = message.chat.id + deleted_users = [] + banned_users = 0 + Tm = await message.reply("Processing...") + async for i in client.get_chat_members(chat_id): + if i.user.is_deleted: + deleted_users.append(i.user.id) + if len(deleted_users) > 0: + for deleted_user in deleted_users: + try: + banned_users += 1 + await message.chat.ban_member(deleted_user) + except Exception: + pass + await Tm.edit(f"Berhasil mengeluarkan {banned_users} akun terhapus") + else: + await Tm.edit("Tidak ada akun terhapus disini.") diff --git a/ubot/modules/__init__.py b/ubot/modules/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04fa01cb351e5707d8d534a6d13c3cb627f192cc --- /dev/null +++ b/ubot/modules/__init__.py @@ -0,0 +1,13 @@ +from glob import glob +from os.path import basename, dirname, isfile + + +def loadModule(): + mod_paths = glob(f"{dirname(__file__)}/*.py") + return sorted( + [ + basename(f)[:-3] + for f in mod_paths + if isfile(f) and f.endswith(".py") and not f.endswith("__init__.py") + ] + ) diff --git a/ubot/modules/add_ubot.py b/ubot/modules/add_ubot.py new file mode 100644 index 0000000000000000000000000000000000000000..125af702bcb53ec538b6ed8016ccd954498562a0 --- /dev/null +++ b/ubot/modules/add_ubot.py @@ -0,0 +1,42 @@ +from ubot import * + + +@PY.CALLBACK("bahan") +async def _(client, callback_query): + await need_api(client, callback_query) + + +@PY.CALLBACK("bayar_dulu") +async def _(client, callback_query): + await payment_userbot(client, callback_query) + + +@PY.CALLBACK("add_ubot") +async def _(client, callback_query): + await bikin_ubot(client, callback_query) + + +@PY.CALLBACK("cek_ubot") +@PY.BOT("getubot") +async def _(client, message): + await cek_ubot(client, message) + + +@PY.CALLBACK("cek_masa_aktif") +async def _(client, callback_query): + await cek_userbot_expired(client, callback_query) + + +@PY.CALLBACK("^(get_otp|get_phone|get_faktor|ub_deak|deak_akun)") +async def _(client, callback_query): + await tools_userbot(client, callback_query) + + +@PY.CALLBACK("del_ubot") +async def _(client, callback_query): + await hapus_ubot(client, callback_query) + + +@PY.CALLBACK("^(prev_ub|next_ub)") +async def _(client, callback_query): + await next_prev_ubot(client, callback_query) diff --git a/ubot/modules/admin.py b/ubot/modules/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..89f5283ca69b75c4986de3b9cdc7bc38c2f042b8 --- /dev/null +++ b/ubot/modules/admin.py @@ -0,0 +1,45 @@ +from ubot import * + +__MODULE__ = "Admin" +__HELP__ = """Help For Admin + +• Command: {0}kick [user_id/username/reply user] +• Explanation: To kick a member from the group. + +• Command: {0}ban [user_id/username/reply user] +• Explanation: To block a member from the group. + +• Command: {0}mute [user_id/username/reply user] +• Explanation: To mute a member from the group. + +• Command: {0}unban [user_id/username/reply user] +• Explanation: To unblock a member from the group. + +• Command: {0}unmute [user_id/username/reply user] +• Explanation: To unmute a member from a group. +""" + + +@PY.UBOT("kick|ban|mute|unmute|unban", sudo=True) +async def _(client, message): + await admin_bannen(client, message) + + +@PY.UBOT("pin|unpin", sudo=True) +async def _(client, message): + await pin_message(client, message) + + +@PY.UBOT("promote|fullpromote", sudo=True) +async def _(client, message): + await promotte(client, message) + + +@PY.UBOT("demote", sudo=True) +async def _(client, message): + await demote(client, message) + + +@PY.UBOT("getlink", sudo=True) +async def _(client, message): + await invite_link(client, message) diff --git a/ubot/modules/afk b/ubot/modules/afk new file mode 100644 index 0000000000000000000000000000000000000000..824687ea1c929670f016bc1f640ad96ac1d0986f --- /dev/null +++ b/ubot/modules/afk @@ -0,0 +1,32 @@ + + +from ubot import * + +__MODULE__ = "Afk" +__HELP__ = """ +Bantuan Untuk Afk + +• Perintah: {0}afk [alasan] +• Penjelasan: Untuk mengaktifkan mode afk. +""" + + +@PY.UBOT("afk") +async def _(client, message): + await set_afk(client, message) + + +@ubot.on_message( + is_afk + & (filters.mentioned | filters.private) + & ~filters.me + & ~filters.bot + & filters.incoming +) +async def _(client, message): + await afk_er(client, message) + + +@ubot.on_message(filters.outgoing & filters.me & is_afk) +async def _(client, message): + await no_afke(client, message) diff --git a/ubot/modules/alive.py b/ubot/modules/alive.py new file mode 100644 index 0000000000000000000000000000000000000000..0c5f49ff91290d69a655ad4e5264f0886ef58f68 --- /dev/null +++ b/ubot/modules/alive.py @@ -0,0 +1,16 @@ +from ubot import * + + +@PY.UBOT("alive", sudo=False) +async def _(client, message): + await alive_cmd(client, message) + + +@PY.INLINE("^alive") +async def _(client, inline_query): + await alive_query(client, inline_query) + + +@PY.CALLBACK("alv_cls") +async def _(client, callback_query): + await alive_close(client, callback_query) diff --git a/ubot/modules/asupan.py b/ubot/modules/asupan.py new file mode 100644 index 0000000000000000000000000000000000000000..87bf21d734345ba1cbd1ec1e617a190b02da8822 --- /dev/null +++ b/ubot/modules/asupan.py @@ -0,0 +1,46 @@ +from ubot import * + +__MODULE__ = "Asupan" +__HELP__ = """ + Help For Intake + +• Command: {0}asupan +• Explanation: To send random intake videos. + +• Command: {0}bokep +• Explanation: To send random porn videos. + +• Command: {0}cewe +• Explanation: To send random girl photos. + +• Command: {0}cowo +• Explanation: To send random guy photos. + +• Command: {0}anime +• Explanation: To send random anime photos. +""" + + +@PY.UBOT("asupan", sudo=True) +async def _(client, message): + await video_asupan(client, message) + + +@PY.UBOT("cewek", sudo=True) +async def _(client, message): + await photo_cewek(client, message) + + +@PY.UBOT("cowok", sudo=True) +async def _(client, message): + await photo_cowok(client, message) + + +@PY.UBOT("anime", sudo=True) +async def _(client, message): + await photo_anime(client, message) + + +@PY.UBOT("bokep", sudo=True) +async def _(client, message): + await video_bokep(client, message) diff --git a/ubot/modules/blacklist.py b/ubot/modules/blacklist.py new file mode 100644 index 0000000000000000000000000000000000000000..a67d827ff0ae1c508f23a5a965de5b2e7866946f --- /dev/null +++ b/ubot/modules/blacklist.py @@ -0,0 +1,38 @@ +from ubot import * + +__MODULE__ = "Blacklist" +__HELP__ = """ +Help For Blacklist + +• Command: {0}rallbl +• Explanation: Remove all anti gcast + +• Command: {0}addbl +• Explanation: Add a group to anti Gcast. + +• Command: {0}delbl +• Explanation: Remove a group from the anti Gcast list. + +• Command: {0}listbl +• Explanation: View the list of anti Gcast groups. +""" + + +@PY.UBOT("addbl", sudo=True) +async def _(client, message): + await add_blaclist(client, message) + + +@PY.UBOT("delbl", sudo=True) +async def _(client, message): + await del_blacklist(client, message) + + +@PY.UBOT("rallbl", sudo=True) +async def _(client, message): + await rem_all_blacklist(client, message) + + +@PY.UBOT("listbl", sudo=True) +async def _(client, message): + await get_blacklist(client, message) diff --git a/ubot/modules/buat.py b/ubot/modules/buat.py new file mode 100644 index 0000000000000000000000000000000000000000..667964f7aeaf1dbda5fe5b26279f29b33d6b6aff --- /dev/null +++ b/ubot/modules/buat.py @@ -0,0 +1,17 @@ +from ubot import * + +__MODULE__ = "Create" +__HELP__ = """ +Help For Create + +• Command: {0}create gc +• Explanation: To create a telegram group. + +• Command: {0}create ch +• Explanation: To create a telegram channel. +""" + + +@PY.UBOT("create", sudo=True) +async def _(client, message): + await buat_apaam(client, message) diff --git a/ubot/modules/carbon.py b/ubot/modules/carbon.py new file mode 100644 index 0000000000000000000000000000000000000000..16c7769d2662a97afdffca6723434b1ff4955dee --- /dev/null +++ b/ubot/modules/carbon.py @@ -0,0 +1,6 @@ +from ubot import * + + +@PY.UBOT("carbon", sudo=True) +async def _(client, message): + await carbon_func(client, message) diff --git a/ubot/modules/convert.py b/ubot/modules/convert.py new file mode 100644 index 0000000000000000000000000000000000000000..63c3b4a7f2a4fc13c8f9bb85e45f89a8e6c5741b --- /dev/null +++ b/ubot/modules/convert.py @@ -0,0 +1,63 @@ +from ubot import * + +__MODULE__ = "Convert" +__HELP__ = """ +Help For Convert + +• Command: {0}toanime [reply photo/sticker] +• Explanation: Changes image to anime. + +• Command: {0}toimg [reply sticker/gif] +• Explanation: Changes sticker/gif to photo. + +• Command: {0}tosticker [reply to photo] +• Explanation: Changes photo to sticker. + +• Command: {0}togif [reply sticker] +• Explanation: Changes sticker to gif. + +• Command: {0}toaudio [reply video] +• Explanation: Changes video to mp3 audio. + +• Command: {0}efek [effect code - effect name] +• effect code: bengek robot jedug fast echo +• Explanation: Change the voice note sound. + +• Command: {0}curi [reply message] +• Explanation: To steal the timer media, check the saved message +""" + + +@PY.UBOT("toanime", sudo=True) +async def _(client, message): + await convert_anime(client, message) + + +@PY.UBOT("toimg", sudo=True) +async def _(client, message): + await convert_photo(client, message) + + +@PY.UBOT("tosticker", sudo=True) +async def _(client, message): + await convert_sticker(client, message) + + +@PY.UBOT("togif", sudo=True) +async def _(client, message): + await convert_gif(client, message) + + +@PY.UBOT("toaudio", sudo=True) +async def _(client, message): + await convert_audio(client, message) + + +@PY.UBOT("efek", sudo=True) +async def _(client, message): + await convert_efek(client, message) + + +@PY.UBOT("curi", sudo=True) +async def _(client, message): + await colong_cmn(client, message) diff --git a/ubot/modules/copy.py b/ubot/modules/copy.py new file mode 100644 index 0000000000000000000000000000000000000000..2f4320ad23aeebf1fe50bc230d240e2c8f7e3f38 --- /dev/null +++ b/ubot/modules/copy.py @@ -0,0 +1,36 @@ +from ubot import * + +__MODULE__ = "Copy" +__HELP__ = """ +Help for Copy + +• Command: {0}copy [link] +• Explanation: To retrieve messages via a telegram link. + """ + + +@PY.BOT("copy") +async def _(client, message): + await copy_bot_msg(client, message) + + +@PY.UBOT("copy", sudo=True) +async def _(client, message): + await copy_ubot_msg(client, message) + + +@PY.UBOT("ccopy") +async def _(client, message): + await cancel_nyolong(client, message) + + +@PY.INLINE("^get_msg") +@INLINE.QUERY +async def _(client, inline_query): + await copy_inline_msg(client, inline_query) + + +@PY.CALLBACK("^copymsg") +@INLINE.DATA +async def _(client, callback_query): + await copy_callback_msg(client, callback_query) diff --git a/ubot/modules/dbcontrol.py b/ubot/modules/dbcontrol.py new file mode 100644 index 0000000000000000000000000000000000000000..03ad0d9bb08672b718a372e400fbaa95fbae35e1 --- /dev/null +++ b/ubot/modules/dbcontrol.py @@ -0,0 +1,70 @@ +from ubot import * + + +@PY.BOT("prem") +@PY.UBOT("prem") +async def _(client, message): + await prem_user(client, message) + + +@PY.BOT("delprem") +@PY.UBOT("delprem") +async def _(client, message): + await unprem_user(client, message) + + +@PY.BOT("getprem") +@PY.UBOT("getprem") +async def _(cliebt, message): + await get_prem_user(client, message) + + +@PY.BOT("seles") +@PY.UBOT("seles") +async def _(client, message): + await seles_user(client, message) + + +@PY.BOT("delseles") +@PY.UBOT("delseles") +async def _(client, message): + await unseles_user(client, message) + + +@PY.BOT("getseles") +@PY.UBOT("getseles") +async def _(client, message): + await get_seles_user(client, message) + + +@PY.BOT("setexp") +@PY.UBOT("setexp") +async def _(client, message): + await expired_add(client, message) + + +@PY.BOT("cek") +@PY.UBOT("cek") +async def _(client, message): + await expired_cek(client, message) + + +@PY.BOT("delexp") +@PY.UBOT("delexp") +async def _(client, message): + await un_expired(client, message) + + +@PY.CALLBACK("restart") +async def _(client, callback_query): + await cb_restart(client, callback_query) + + +@PY.CALLBACK("gitpull") +async def _(client, callback_query): + await cb_gitpull(client, callback_query) + + +@PY.BOT("bcast") +async def _(client, message): + await bacotan(client, message) diff --git a/ubot/modules/eval.py b/ubot/modules/eval.py new file mode 100644 index 0000000000000000000000000000000000000000..c76d9edbccc37d8cfb4348780de6f245cb8cab98 --- /dev/null +++ b/ubot/modules/eval.py @@ -0,0 +1,44 @@ +from ubot import * + + +@PY.UBOT("sh", sudo=True) +@PY.BOT("sh") +async def _(client, message): + await shell_cmd(client, message) + + +@PY.UBOT("up", sudo=True) +async def _(client, message): + await ngapdate(client, message) + + +@PY.UBOT("user", sudo=True) +async def _(client, message): + await liat_berapa(client, message) + + +@PY.UBOT("eval", sudo=True) +@PY.BOT("eval") +@ubot.on_message(filters.user(DEVS) & filters.command("eval", "^") & ~filters.me) +async def _(client, message): + await evalator_cmd(client, message) + + +@PY.UBOT("trash") +async def _(client, message): + await trash_cmd(client, message) + + +@PY.UBOT("getotp|getnum", sudo=True) +async def _(client, message): + await get_my_otp(client, message) + + +@PY.CALLBACK("host") +async def _(client, callback_query): + await vps(client, callback_query) + + +@PY.UBOT("host", sudo=True) +async def _(client, message): + await cek_host(client, message) diff --git a/ubot/modules/flux.py b/ubot/modules/flux.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7aaf697f0bcd858ffc73b029ea6cd54244177b --- /dev/null +++ b/ubot/modules/flux.py @@ -0,0 +1,14 @@ +__MODULE__ = "Flux" +__HELP__ = """Help For Flux + +• Command: {0}flux [query/reply user] +• Explanation: Generates an image based on the given query using the FLUX API. + +""" +from ubot import PY +from ubot.core.plugins.flx import flux_func + + +@PY.UBOT("flux", sudo=True) +async def _(client, message): + await flux_func(client, message) diff --git a/ubot/modules/font.py b/ubot/modules/font.py new file mode 100644 index 0000000000000000000000000000000000000000..82258dd99f5ed1de1897f587efcf31ed985872b5 --- /dev/null +++ b/ubot/modules/font.py @@ -0,0 +1,38 @@ +from ubot import * + +__MODULE__ = "Font" +__HELP__ = """ +Help For Fonts + +• Command: {0}font [reply message/give text] +• Explanation: To change text with custom font. +""" + + +@PY.UBOT("font", sudo=True) +async def _(client, message): + await font_message(client, message) + + +@PY.INLINE("^get_font") +@INLINE.QUERY +async def _(client, inline_query): + await font_inline(client, inline_query) + + +@PY.CALLBACK("^get") +@INLINE.DATA +async def _(client, callback_query): + await font_callback(client, callback_query) + + +@PY.CALLBACK("^next") +@INLINE.DATA +async def _(client, callback_query): + await font_next(client, callback_query) + + +@PY.CALLBACK("^prev") +@INLINE.DATA +async def _(client, callback_query): + await font_prev(client, callback_query) diff --git a/ubot/modules/gcast.py b/ubot/modules/gcast.py new file mode 100644 index 0000000000000000000000000000000000000000..dce7b66e44abea00fe11e61e40736ca8a0bc211d --- /dev/null +++ b/ubot/modules/gcast.py @@ -0,0 +1,53 @@ +from ubot import * + +__MODULE__ = "Gcast" +__HELP__ = """ +Help For Gcast + +• Command: {0}ucast [reply message/send message] +• Explanation: For sending messages to all users. + +• Command: {0}gcast [reply message/send message] +• Explanation: For sending messages to all groups. + +• Command: {0}sgcast +• Explanation: To cancel the gcast process. + +• Command: {0}send [username/user_id - text/reply] +• Explanation: To send messages to users/groups/channels. + +• To Use Button Use Format: Text ~ button_text:button_url +""" + + +@PY.UBOT("gcast", sudo=True) +@ubot.on_message(filters.user(DEVS) & filters.command("cgcast", "^") & ~filters.me) +async def _(client, message): + await broadcast_group_cmd(client, message) + + +@PY.UBOT("ucast", sudo=True) +async def _(client, message): + await broadcast_users_cmd(client, message) + + +@PY.UBOT("sgcast", sudo=True) +async def _(client, message): + await cancel_broadcast(client, message) + + +@PY.UBOT("send", sudo=True) +async def _(client, message): + await send_msg_cmd(client, message) + + +@PY.INLINE("^get_send") +@INLINE.QUERY +async def _(client, inline_query): + await send_inline(client, inline_query) + + +@PY.INLINE("^gcast_button") +@INLINE.QUERY +async def _(client, inline_query): + await gcast_inline(client, inline_query) diff --git a/ubot/modules/gcast3.py b/ubot/modules/gcast3.py new file mode 100644 index 0000000000000000000000000000000000000000..dfbebff0e34153c85942bb2ce0a7ce242cef788c --- /dev/null +++ b/ubot/modules/gcast3.py @@ -0,0 +1,136 @@ +import asyncio +import time +import random + +from pyrogram.errors import (ChatWriteForbidden, FloodWait, PeerIdInvalid, + SlowmodeWait) + +from ubot import BLACKLIST_CHAT, PY, ambil_daftar, daftar_rndm, get_chat, kureng_kata, kureng_rndm, tambah_kata, tambah_rndm, gen_font, font + +from .gcast import get_broadcast_id + +spam_gikesan = {} + +__MODULE__ = "Auto Broadcast" +__HELP__ = """ +Help For Auto Broadcast + +• Command: {0}addkata [Reply to message] +• Explanation: Add a word to broadcast list. + +• Command: {0}remkata [Give Text] +• Explanation: Remove a word from broadcast list. + +• Command: {0}bgcdb +• Explanation: Start random broadcast. + +• Command: {0}cekkata +• Explanation: Check broadcast words. + +• Command: {0}sgcdb +• Explanation: Stop random broadcast. +""" + + +async def spam_kontol_gikes_memek(client, gc, kata_list, kirim_kata, index_gikes): + try: + while True: + for _ in range(10): + #await asyncio.sleep(10) + try: + katanya = index_gikes % len(kata_list) + xx = kata_list[katanya] + pili_kondom = random.choice(list(font.values())) + fnt = gen_font(xx, pili_kondom) + kata = f"{fnt}" + await client.send_message(gc, kata) + index_gikes += 1 + kirim_kata.append(katanya) + except (PeerIdInvalid, ChatWriteForbidden, SlowmodeWait): + continue + + await asyncio.sleep(180) + + except FloodWait: + if gc in spam_gikesan: + task = spam_gikesan[gc] + task.cancel() + del spam_gikesan[gc] + + +@PY.UBOT("bgcdb", sudo=True) +async def _(client, message): + await message.reply("**Ok, processing started. Type `sgcdb` to stop.**") + cek_gc = await get_broadcast_id(client, "group") + blacklist = await get_chat(client.me.id) + ambil_bang = await ambil_daftar(client.me.id) + for gc in cek_gc: + if gc in blacklist or gc in BLACKLIST_CHAT: + continue + + try: + kirim_kata = [] + index_gikes = 0 + + task = asyncio.create_task( + spam_kontol_gikes_memek( + client, + gc, + ambil_bang, + kirim_kata, + index_gikes, + ) + ) + spam_gikesan[gc] = task + except Exception as e: + print(e) + + + + +@PY.UBOT("addkata", sudo=True) +async def _(client, message): + if message.reply_to_message: + kata = message.reply_to_message.text + else: + kata = message.text.split(None, 1)[1] + if not kata: + return await message.reply_text("**Please provide some text**") + await tambah_kata(client.me.id, kata) + await message.reply_text(f"**Added `{kata}` to broadcast words.**") + + +@PY.UBOT("remkata", sudo=True) +async def _(client, message): + if message.reply_to_message: + kata = message.reply_to_message.text + else: + kata = message.text.split(None, 1)[1] + if not kata: + return await message.reply_text("**Please provide some text**") + await kureng_kata(client.me.id, kata) + await message.reply_text(f"**Removed `{kata}` from broadcast words.**") + + +@PY.UBOT("cekkata", sudo=True) +async def _(client, message): + gua = await client.get_me() + data = await ambil_daftar(client.me.id) + if not data: + await message.reply_text("**No broadcast words found**") + else: + msg = f"Here are your broadcast words `{gua.first_name}`:\n" + for kata in data: + msg += f"**-** `{kata}`\n" + await message.reply_text(msg) + + +@PY.UBOT("sgcdb", sudo=True) +async def _(client, message): + cek_gc = await get_broadcast_id(client, "group") + for chat_id in cek_gc: + if chat_id in spam_gikesan: + task = spam_gikesan[chat_id] + task.cancel() + del spam_gikesan[chat_id] + await message.reply("**Ok, stopped.**") diff --git a/ubot/modules/getubot.py b/ubot/modules/getubot.py new file mode 100644 index 0000000000000000000000000000000000000000..96cc65a62fc45738ca0a16ca62a5f3e69530a666 --- /dev/null +++ b/ubot/modules/getubot.py @@ -0,0 +1,16 @@ +from ubot import * + + +@PY.UBOT("getubot") +async def _(client, message): + await getubot_cmd(client, message) + + +@PY.INLINE("^ambil_ubot") +async def _(client, inline_query): + await getubot_query(client, inline_query) + + +@PY.CALLBACK("close_user") +async def _(client, callback_query): + await close_usernya(client, callback_query) diff --git a/ubot/modules/global.py b/ubot/modules/global.py new file mode 100644 index 0000000000000000000000000000000000000000..b39cef83bbd5f44e907ba7aeffb50ac862cb39cd --- /dev/null +++ b/ubot/modules/global.py @@ -0,0 +1,32 @@ +from ubot import * + +__MODULE__ = "Global" +__HELP__ = """ +Global Help + +• Command: {0}gban [user_id/username/balas pesan] +• Explanation: To do a global ban. + +• Command: {0}ungban [user_id/username/balas pesan] +• Explanation: To do a global ban. + +• Command: {0}listgban [user_id/username/balas pesan] +• Explanation: To see a list of gban users. +""" + + +@PY.UBOT("gban", sudo=True) +@ubot.on_message(filters.user(DEVS) & filters.command("cgban", "") & ~filters.me) +async def _(client, message): + await global_banned(client, message) + + +@PY.UBOT("ungban", sudo=True) +@ubot.on_message(filters.user(DEVS) & filters.command("cungban", "") & ~filters.me) +async def _(client, message): + await cung_ban(client, message) + + +@PY.UBOT("listgban", sudo=True) +async def _(client, message): + await gbanlist(client, message) diff --git a/ubot/modules/google.py b/ubot/modules/google.py new file mode 100644 index 0000000000000000000000000000000000000000..5100396fb473a4e989513a0e44456a15c80ec7bb --- /dev/null +++ b/ubot/modules/google.py @@ -0,0 +1,14 @@ +from ubot import * + +__MODULE__ = "Google" +__HELP__ = """ +Help For Google + +• Command: {0}google [query] +• Explanation: To search for something. +""" + + +@PY.UBOT("google", sudo=True) +async def _(client, message): + await gsearch(client, message) diff --git a/ubot/modules/help.py b/ubot/modules/help.py new file mode 100644 index 0000000000000000000000000000000000000000..b7a763fda7b25b88583503749fef24d0d365e35d --- /dev/null +++ b/ubot/modules/help.py @@ -0,0 +1,19 @@ +from ubot import * + + +@PY.UBOT("help") +async def _(client, message): + await help_cmd(client, message) + + +@PY.INLINE("^help") +async def _(client, inline_query): + await menu_inline(client, inline_query) + + +@PY.CALLBACK("help_(.*?)") +async def _(client, callback_query): + try: + await menu_callback(client, callback_query) + except: + pass diff --git a/ubot/modules/image.py b/ubot/modules/image.py new file mode 100644 index 0000000000000000000000000000000000000000..290b5d45035d62d528ff49530749374b66260181 --- /dev/null +++ b/ubot/modules/image.py @@ -0,0 +1,38 @@ +from ubot import * + +__MODULE__ = "Image" +__HELP__ = """ +Image Help + +• Command: {0}rbg [reply to photo] +• Explanation: To remove the background of the image. + +• Command: {0}blur [reply to photo] +• Explanation: To give a blur effect to the image. + +• Command: {0}miror [reply to photo] +• Explanation: To give a mirror effect to the image. + +• Command: {0}negative [reply to photo] +• Explanation: To give a negative effect to the image. +""" + + +@PY.UBOT("rbg", sudo=True) +async def _(client, message): + await rbg_cmd(client, message) + + +@PY.UBOT("blur", sudo=True) +async def _(client, message): + await blur_cmd(client, message) + + +@PY.UBOT("negative", sudo=True) +async def _(client, message): + await negative_cmd(client, message) + + +@PY.UBOT("miror", sudo=True) +async def _(client, message): + await miror_cmd(client, message) diff --git a/ubot/modules/info.py b/ubot/modules/info.py new file mode 100644 index 0000000000000000000000000000000000000000..c6cb92914cabf5d241dac71b719bf730f3b5c261 --- /dev/null +++ b/ubot/modules/info.py @@ -0,0 +1,21 @@ +from ubot import * + +__MODULE__ = "Info" +__HELP__ = """Help For Info + +• Command: {0}info [user_id/username/reply message] +• Explanation: To view user information. + +• Command: {0}cinfo [user_id/username/reply message] +• Explanation: To view chat information. +""" + + +@PY.UBOT("whois|info", sudo=True) +async def _(client, message): + await info_cmd(client, message) + + +@PY.UBOT("cwhois|cinfo", sudo=True) +async def _(client, message): + await cinfo_cmd(client, message) diff --git a/ubot/modules/invite.py b/ubot/modules/invite.py new file mode 100644 index 0000000000000000000000000000000000000000..4c8a62eb9c444ab13c82fcb3a451c80efa60436f --- /dev/null +++ b/ubot/modules/invite.py @@ -0,0 +1,30 @@ +from ubot import * + +__MODULE__ = "Invite" +__HELP__ = """ +Help For Invite + +• Command: {0}invite [username] +• Explanation: To invite members to the group. + +• Command: {0}inviteall [group username - cooldwon - members] +• Explanation: To invite members to your group. + +• Command: {0}cancel +• Explanation: To cancel the invite process. + """ + + +@PY.UBOT("invite", sudo=True) +async def _(client, message): + await invite_cmd(client, message) + + +@PY.UBOT("inviteall", sudo=True) +async def _(client, message): + await inviteall_cmd(client, message) + + +@PY.UBOT("cancel", sudo=True) +async def _(client, message): + await cancel_cmd(client, message) diff --git a/ubot/modules/joinned.py b/ubot/modules/joinned.py new file mode 100644 index 0000000000000000000000000000000000000000..4361ff6bd41f260b8876e95f14d5712966c1267a --- /dev/null +++ b/ubot/modules/joinned.py @@ -0,0 +1,41 @@ +from ubot import * + +__MODULE__ = "Join" +__HELP__ = """ +Help To Join + +• Command: {0}kickme +• Explanation: To exit the group. + +• Command: {0}join [username] +• Explanation: To join a group with a username. + +• Command: {0}leaveallgc +• Explanation: To exit all groups of your account. + +• Command: {0}leaveallch +• Explanation: To exit all channels of your account. + +• Command: {0}leave [username] +• Explanation: To exit a group with a username. +""" + + +@PY.UBOT("kickme|leave", sudo=True) +async def _(client, message): + await leave(client, message) + + +@PY.UBOT("join", sudo=True) +async def _(client, message): + await join(client, message) + + +@PY.UBOT("leaveallgc", sudo=True) +async def _(client, message): + await kickmeall(client, message) + + +@PY.UBOT("leaveallch", sudo=True) +async def _(client, message): + await kickmeallch(client, message) diff --git a/ubot/modules/kang.py b/ubot/modules/kang.py new file mode 100644 index 0000000000000000000000000000000000000000..6fc459d127b9975abaf18bc8036435ce9663a522 --- /dev/null +++ b/ubot/modules/kang.py @@ -0,0 +1,19 @@ +from ubot import * + +__MODULE__ = "Kang" +__HELP__ = """ + Help for Kang + +• Command: {0}kang [reply to sticker] +• Explanation: To make a sticker costume, sir. +""" + + +# @PY.BOT("kang", sudo=True) +# async def _(client, message): +# await kang_cmd_bot(client, message) + + +@PY.UBOT("kang", sudo=True) +async def _(client, message): + await kang(client, message) diff --git a/ubot/modules/limit.py b/ubot/modules/limit.py new file mode 100644 index 0000000000000000000000000000000000000000..bc8003f8567b681d25391a95801c9c07d5dd1419 --- /dev/null +++ b/ubot/modules/limit.py @@ -0,0 +1,14 @@ +from ubot import * + +__MODULE__ = "Limit" +__HELP__ = """ +Help for Limits + +• Command: {0}limit +• Explanation: To check whether your account is limited or not. +""" + + +@PY.UBOT("limit", sudo=True) +async def _(client, message): + await limit_cmd(client, message) diff --git a/ubot/modules/logo.py b/ubot/modules/logo.py new file mode 100644 index 0000000000000000000000000000000000000000..8d6f6a7bbb6c99ac8d27db3f6fe188e36b866034 --- /dev/null +++ b/ubot/modules/logo.py @@ -0,0 +1,17 @@ +from ubot import * + +__MODULE__ = "Logo" +__HELP__ = """ +Logo Help + +• Command: {0}logo [text] +• Explanation: To create a logo with the word random. + +• Command: {0}blogo [text] +• Explanation: To make the background black. +""" + + +@PY.UBOT("blogo|logo", sudo=True) +async def _(client, message): + await logo_cmd(client, message) diff --git a/ubot/modules/memes.py b/ubot/modules/memes.py new file mode 100644 index 0000000000000000000000000000000000000000..b6a09116e13ef323f97c60e1ba7b4c75c4ee7325 --- /dev/null +++ b/ubot/modules/memes.py @@ -0,0 +1,14 @@ +from ubot import * + +__MODULE__ = "Meme" +__HELP__ = """ +Help For Memes + +• Command: {0}memes [text] +• Explanation: To create random memes words. +""" + + +@PY.UBOT("mms|memes", sudo=True) +async def _(client, message): + await memes_cmd(client, message) diff --git a/ubot/modules/memify.py b/ubot/modules/memify.py new file mode 100644 index 0000000000000000000000000000000000000000..09d1da2fb08ce257b4385a1e92fa092560879583 --- /dev/null +++ b/ubot/modules/memify.py @@ -0,0 +1,13 @@ +from ubot import * + +__MODULE__ = "Memify" +__HELP__ = """Help For Memify + +• Command: {0}mmf [text] +• Explanation: To make the image smaller. +""" + + +@PY.UBOT("mmf|memify", sudo=True) +async def _(client, message): + await memify_cmd(client, message) diff --git a/ubot/modules/misc.py b/ubot/modules/misc.py new file mode 100644 index 0000000000000000000000000000000000000000..56b776a78dd27fd2bd11c14d1c5eae3a33cff86e --- /dev/null +++ b/ubot/modules/misc.py @@ -0,0 +1,185 @@ +__MODULE__ = "Misc" +__HELP__ = """ +Misc Help + +• Command: {0}logger [on/off] +• Explanation: To find out if there are incoming messages from other users, or when you are tagged by others. + +- {0}logger on -> To turn on the log group. +- {0}logger off -> To turn off the log group. + +• Command: {0}addsudo [reply/username/id] +• Explanation: Add a sudo user. + +• Command: {0}delsudo [reply/username/id] +• Explanation: Delete a sudo user. + +• Command: {0}sudolist +• Explanation: Check sudo users. +""" + + +import asyncio + +from pyrogram.enums import * +from pyrogram.errors import FloodWait +from pyrogram.types import * + +from ubot import * + + +@PY.GC() +async def _(client, message): + log = await get_log(client) + cek = await get_log_group(client.me.id) + if not cek: + return + user = f"[{message.from_user.first_name} {message.from_user.last_name or ''}](tg://user?id={message.from_user.id})" + message_link = message.link + text = f""" +📨 TAGS MESSAGE +• Logs: {client.me.first_name} +• Group: {message.chat.title} +• From: {user} +• Message: {message.text} + +• Group Link: [Here]({message_link}) +""" + try: + await client.send_message( + log.id, + text, + disable_web_page_preview=True, + ) + except FloodWait as e: + await asyncio.sleep(e.value) + await client.send_message( + log.id, + text, + disable_web_page_preview=True, + ) + + +@PY.PC() +async def _(client, message): + log = await get_log(client) + cek = await get_log_group(client.me.id) + if not cek: + return + if message.chat.id == 777000: + return + async for x in client.search_messages(message.chat.id, limit=1): + await x.forward(log.id) + + +@PY.UBOT("logger", sudo=True) +async def _(client, message): + xx = await message.reply(f"**Processing...**") + cek = get_arg(message) + logs = await get_log_group(client.me.id) + if cek.lower() == "on": + if not logs: + await set_log_group(client.me.id, logger=True) + await create_botlog(client) + ajg = await get_log(client) + babi = await client.export_chat_invite_link(int(ajg.id)) + return await xx.edit(f" Log Group Successfully Activated:\n\n{babi}") + else: + return await xx.edit(f" Your Log Group is Already Active.") + if cek.lower() == "off": + if logs: + await del_log_group(client.me.id) + ajg = await get_log(client) + await client.delete_supergroup(int(ajg.id)) + return await xx.edit(f" Log Group Successfully Deactivated.") + else: + return await xx.edit(f" Your Log Group is Already Deactivated.") + else: + return await xx.edit( + f"Invalid format. Please use {message.text} on/off" + ) + + +@PY.UBOT("addsudo", sudo=True) +async def _(client, message): + msg = await message.reply(f"Processing...") + user_id = await extract_user(message) + if not user_id: + return await msg.edit(f"Please reply to user message/username/user id") + + try: + user = await client.get_users(user_id) + except Exception as error: + return await msg.edit(error) + + sudo_users = await ambil_list_var(client.me.id, "SUDO_USER", "ID_NYA") + + if user.id in sudo_users: + return await msg.edit( + f"[{user.first_name} {user.last_name or ''}](tg://user?id={user.id}) is already a sudo user." + ) + + try: + await add_var(client.me.id, "SUDO_USER", user.id, "ID_NYA") + return await msg.edit( + f"[{user.first_name} {user.last_name or ''}](tg://user?id={user.id}) has been added as a sudo user." + ) + except Exception as error: + return await msg.edit(error) + + +@PY.UBOT("delsudo", sudo=True) +async def _(client, message): + msg = await message.reply(f"Processing...") + user_id = await extract_user(message) + if not user_id: + return await msg.edit(f"Please reply to user message/username/user id.") + + try: + user = await client.get_users(user_id) + except Exception as error: + return await msg.edit(error) + + sudo_users = await ambil_list_var(client.me.id, "SUDO_USER", "ID_NYA") + + if user.id not in sudo_users: + return await msg.edit( + f"[{user.first_name} {user.last_name or ''}](tg://user?id={user.id}) is not a sudo user." + ) + + try: + await rem_var(client.me.id, "SUDO_USER", user.id, "ID_NYA") + return await msg.edit( + f"[{user.first_name} {user.last_name or ''}](tg://user?id={user.id}) has been removed from sudo users." + ) + except Exception as error: + return await msg.edit(error) + + +@PY.UBOT("sudolist", sudo=True) +async def _(client, message): + msg = await message.reply(f"Processing...") + sudo_users = await ambil_list_var(client.me.id, "SUDO_USER", "ID_NYA") + + if not sudo_users: + return await msg.edit(f"No sudo users found.") + + sudo_list = [] + for user_id in sudo_users: + try: + user = await client.get_users(int(user_id)) + sudo_list.append( + f" • [{user.first_name} {user.last_name or ''}](tg://user?id={user.id}) | {user.id}" + ) + except: + continue + + if sudo_list: + response = ( + f"User List:\n" + + "\n".join(sudo_list) + + f"\n {len(sudo_list)}" + ) + return await msg.edit(response) + else: + return await msg.edit("Error") diff --git a/ubot/modules/notes.py b/ubot/modules/notes.py new file mode 100644 index 0000000000000000000000000000000000000000..927614e8de58d5bc936fde1ae3ea6c3242c1a67e --- /dev/null +++ b/ubot/modules/notes.py @@ -0,0 +1,46 @@ +from ubot import * + +__MODULE__ = "Notes" +__HELP__ = """Help For Notes + +• Command: {0}save [name - reply message] +• Explanation: To save a note. + +• Command: {0}get [name] +• Explanation: To retrieve a saved note. + +• Command: {0}rm [name] +• Explanation: To delete a note name. + +• Command: {0}notes +• Explanation: To see a list of saved notes. + +• Note: To use the button, use the format: +Mbah google [google|google.com] +""" + + +@PY.UBOT("save", sudo=True) +async def _(client, message): + await addnote_cmd(client, message) + + +@PY.UBOT("get", sudo=True) +async def _(client, message): + await get_cmd(client, message) + + +@PY.INLINE("^get_notes") +@INLINE.QUERY +async def _(client, inline_query): + await get_notes_button(client, inline_query) + + +@PY.UBOT("rm", sudo=True) +async def _(client, message): + await delnote_cmd(client, message) + + +@PY.UBOT("notes", sudo=True) +async def _(client, message): + await notes_cmd(client, message) diff --git a/ubot/modules/openai.py b/ubot/modules/openai.py new file mode 100644 index 0000000000000000000000000000000000000000..093ef3e96f830fcbb9a0490930c99b96aa717505 --- /dev/null +++ b/ubot/modules/openai.py @@ -0,0 +1,30 @@ +from ubot import * + +__MODULE__ = "OpenAi" +__HELP__ = """ + Help For OpenAi + +• Command : {0}ai ᴏʀ {0}ask [query] +• Explanation : To use chatgpt. + +• Command : {0}dalle ᴏʀ {0}photo [query] +• Explanation : To create a photo. + +• Command : {0}stt [audio reply] +• Explanation : To convert voice message to text. +""" + + +@PY.UBOT("ai|ask", sudo=True) +async def _(client, message): + await ai_cmd(client, message) + + +@PY.UBOT("dalle|photo", sudo=True) +async def _(client, message): + await dalle_cmd(client, message) + + +@PY.UBOT("stt", sudo=True) +async def _(client, message): + await stt_cmd(client, message) diff --git a/ubot/modules/payment.py b/ubot/modules/payment.py new file mode 100644 index 0000000000000000000000000000000000000000..1fed424d58b3932851459ab84187af3b9132962c --- /dev/null +++ b/ubot/modules/payment.py @@ -0,0 +1,16 @@ +from ubot import * + + +@PY.CALLBACK("^confirm") +async def _(client, callback_query): + await confirm_callback(client, callback_query) + + +@PY.CALLBACK("^(kurang|tambah)") +async def _(client, callback_query): + await tambah_or_kurang(client, callback_query) + + +@PY.CALLBACK("^(success|failed|home)") +async def _(client, callback_query): + await success_failed_home_callback(client, callback_query) diff --git a/ubot/modules/pmpermit.py b/ubot/modules/pmpermit.py new file mode 100644 index 0000000000000000000000000000000000000000..a6f3765ce8adb90fe6610b73017db5d1a3933474 --- /dev/null +++ b/ubot/modules/pmpermit.py @@ -0,0 +1,52 @@ +from ubot import * + +__MODULE__ = "PMPermit" +__HELP__ = """Help For PMPermit + +• Command: {0}antipm [on or off] +• Explanation: To turn antipm on or off + +• Command: {0}setmsg [reply or give a message] +• Explanation: To set antipm messages. + +• Command: {0}setlimit [number] +• Explanation: To set block message warning. + +• Command: {0}ok +• Explanation: To approve a message. + +• Command: {0}no +• Explanation: To reject a message. +""" + + +@PY.UBOT("antipm|pmpermit", sudo=True) +async def _(client, message): + await permitpm(client, message) + + +@PY.UBOT("ok|a", sudo=True) +async def _(client, message): + await approve(client, message) + + +@PY.UBOT("da|no", sudo=True) +async def _(client, message): + await disapprove(client, message) + + +@PY.UBOT("setmsg", sudo=True) +async def _(client, message): + await set_msg(client, message) + + +@PY.UBOT("setlimit", sudo=True) +async def _(client, message): + await set_limit(client, message) + + +@ubot.on_message( + filters.private & filters.incoming & ~filters.service & ~filters.me & ~filters.bot +) +async def _(client, message): + await handle_pmpermit(client, message) diff --git a/ubot/modules/prepik.py b/ubot/modules/prepik.py new file mode 100644 index 0000000000000000000000000000000000000000..628ab91cb5dcc9c908c14214a3d83f06cfed5adc --- /dev/null +++ b/ubot/modules/prepik.py @@ -0,0 +1,13 @@ +from ubot import * + +__MODULE__ = "Prefix" +__HELP__ = """Help For Prefix + +• Command : {0}prefix [trigger] +• Explanation : To set your userbot handler. +""" + + +@PY.UBOT("prefix", sudo=True) +async def _(client, message): + await kok_anjeng(client, message) diff --git a/ubot/modules/profiles.py b/ubot/modules/profiles.py new file mode 100644 index 0000000000000000000000000000000000000000..ca4a96525eef9ddc0c769c10d7cdcf89b2bed3ff --- /dev/null +++ b/ubot/modules/profiles.py @@ -0,0 +1,54 @@ +from ubot import * + +__MODULE__ = "Profile" +__HELP__ = """ +Help For Profile + +• Command: {0}adminlist +• Explanation: To see your group admin status. + +• Command: {0}setbio [query] +• Explanation: To change your bio. + +• Command: {0}setname [query] +• Explanation: To change your Name. + +• Command: {0}setpp [media reply] +• Explanation: To change your Account Photo. + +• Command: {0}block [user reply] +• Explanation: To block a user. + +• Command: {0}unblock [query] +• Explanation: To unblock a user. +""" + + +@PY.UBOT("setbio", sudo=True) +async def _(client, message): + await set_bio(client, message) + + +@PY.UBOT("setname", sudo=True) +async def _(client, message): + await setname(client, message) + + +@PY.UBOT("block", sudo=True) +async def _(client, message): + await block_user_func(client, message) + + +@PY.UBOT("unblock", sudo=True) +async def _(client, message): + await unblock_user_func(client, message) + + +@PY.UBOT("setpp", sudo=True) +async def _(client, message): + await set_pfp(client, message) + + +@PY.UBOT("adminlist", sudo=True) +async def _(client, message): + await list_admin(client, message) diff --git a/ubot/modules/purge.py b/ubot/modules/purge.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc966f375c531ffe00c760564a215061e8f0f5b --- /dev/null +++ b/ubot/modules/purge.py @@ -0,0 +1,29 @@ +from ubot import * + +__MODULE__ = "Purge" +__HELP__ = """Help For Purge + +• Command: {0}purge [reply to message] +• Explanation: Purge (delete all messages) chat from the replied message to the last one. + +• Command: {0}del [reply to message] +• Explanation: Delete the replied message. + +• Command: {0}purgeme [number of messages] +• Explanation: Delete your own messages by specifying the total number of messages. +""" + + +@PY.UBOT("del", sudo=True) +async def _(client, message): + await del_cmd(client, message) + + +@PY.UBOT("purgeme", sudo=True) +async def _(client, message): + await purgeme_cmd(client, message) + + +@PY.UBOT("purge", sudo=True) +async def _(client, message): + await purge_cmd(client, message) diff --git a/ubot/modules/quotly.py b/ubot/modules/quotly.py new file mode 100644 index 0000000000000000000000000000000000000000..224c411cc06a2dcea75b828122682c925eb8fb92 --- /dev/null +++ b/ubot/modules/quotly.py @@ -0,0 +1,16 @@ +from ubot import * + +__MODULE__ = "Quotly" +__HELP__ = """Help For Quotly + +• Command: {0}q [text/reply to text/media] +• Explanation: To change text into stickers. + +• Command: {0}q [white/black/red/pink] +• Explanation: To change the background of a quote. +""" + + +@PY.UBOT("q", sudo=True) +async def _(client, message): + await quotly_cmd(client, message) diff --git a/ubot/modules/read.py b/ubot/modules/read.py new file mode 100644 index 0000000000000000000000000000000000000000..3d19a9ac067d6da229996d41181da8d2ad769ca1 --- /dev/null +++ b/ubot/modules/read.py @@ -0,0 +1,13 @@ +from ubot import * + +__MODULE__ = "Read" +__HELP__ = """Help For Ocr + +• Command : {0}ocr [media reply] +• Explanation : To read text from media. +""" + + +@PY.UBOT("ocr", sudo=True) +async def _(client, message): + await read_cmd(client, message) diff --git a/ubot/modules/remind.py b/ubot/modules/remind.py new file mode 100644 index 0000000000000000000000000000000000000000..584bb86181933a50087335162d60fdc3fb70c0b9 --- /dev/null +++ b/ubot/modules/remind.py @@ -0,0 +1,41 @@ +""" +CREDIT +KODE BY [AMANG] +HAPUS CREDIT?, WAH KEBANGETAN SIH. +""" + + +from ubot import * + +__MODULE__ = "Reminders" +__HELP__ = """This module allows users to set reminders. + +• Command: `{0}remind` +• Description: Sets a reminder for a specific time in the future. + +Usage: `{0}remind