Upload 25 files
Browse files- .github/dependabot.yml +13 -0
- Dockerfile +19 -0
- LICENSE +201 -0
- Procfile +2 -0
- README.md +127 -10
- SECURITY.md +21 -0
- app.json +56 -0
- bot.py +172 -0
- config.py +238 -0
- helper/database.py +300 -0
- helper/ffmpeg.py +44 -0
- helper/utils.py +205 -0
- plugins/__init__.py +74 -0
- plugins/admin_panel.py +342 -0
- plugins/file_rename.py +365 -0
- plugins/force_sub.py +80 -0
- plugins/metadata.py +90 -0
- plugins/prefix_and_suffix.py +97 -0
- plugins/start_and_cb.py +325 -0
- plugins/thumb_and_cap.py +95 -0
- plugins/web_support.py +127 -0
- render.yaml +34 -0
- requirements.txt +11 -0
- runtime.txt +1 -0
- templates/welcome.html +619 -0
.github/dependabot.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# rkn developer
|
| 3 |
+
# To get started with Dependabot version updates, you'll need to specify which
|
| 4 |
+
# package ecosystems to update and where the package manifests are located.
|
| 5 |
+
# Please see the documentation for all configuration options:
|
| 6 |
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
| 7 |
+
|
| 8 |
+
version: 2
|
| 9 |
+
updates:
|
| 10 |
+
- package-ecosystem: "pip" # See documentation for possible values
|
| 11 |
+
directory: "/" # Location of package manifests
|
| 12 |
+
schedule:
|
| 13 |
+
interval: "weekly"
|
Dockerfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image
|
| 2 |
+
FROM python:3.9-slim-buster
|
| 3 |
+
|
| 4 |
+
RUN apt-get update -qq && apt-get -y install ffmpeg
|
| 5 |
+
|
| 6 |
+
# Set the working directory in the container
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
+
# Copy the dependencies file to the working directory
|
| 10 |
+
COPY requirements.txt .
|
| 11 |
+
|
| 12 |
+
# Install any needed dependencies specified in requirements.txt
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Copy the rest of the application code to the working directory
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# Command to run the application
|
| 19 |
+
CMD ["python", "bot.py"]
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
Procfile
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
web: python3 bot.py
|
| 2 |
+
worker: python3 bot.py
|
README.md
CHANGED
|
@@ -1,10 +1,127 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
| 2 |
+
|
| 3 |
+

|
| 4 |
+
|
| 5 |
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
<p align="center">
|
| 9 |
+
<img src="https://telegra.ph/file/b746aadfe59959eb76f59.jpg" alt="RKN RENAME BOT V3">
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
<p align="center">
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+

|
| 16 |
+

|
| 17 |
+

|
| 18 |
+
|
| 19 |
+
</p>
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
### Sᴀᴍᴩʟᴇ Bᴏᴛ (Official Digital Rename Bot)
|
| 23 |
+
|
| 24 |
+
* [Rkn_RenameBot](http://t.me/Rkn_RenameBot)
|
| 25 |
+
* [Digital_Rename_Bot](http://t.me/Digital_Rename_Bot)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
## Deploy Me 🥀
|
| 29 |
+
|
| 30 |
+
<details><summary>📌 Deploy to Koyeb </summary>
|
| 31 |
+
|
| 32 |
+
[](https://app.koyeb.com/deploy?type=git&repository=github.com/RknDeveloper/Digital-Rename-Bot&env[BOT_TOKEN]&env[API_ID]&env[API_HASH]&env[WEBHOOK]=True&env[ADMIN]&env[DB_URL]&env[DB_NAME]=Rkn-Developer&env[FORCE_SUB]&env[START_PIC]&env[LOG_CHANNEL]=You%20Dont%20Need%20LogChannel%20To%20Remove%20This%20Variable&run_command=python%20bot.py&branch=main&name=rkn-rename)
|
| 33 |
+
</details>
|
| 34 |
+
|
| 35 |
+
<details><summary>📌 Deploy to Render </summary>
|
| 36 |
+
|
| 37 |
+
[](https://render.com/deploy?repo=https://github.com/DigitalBotz/Digital-Rename-Bot)
|
| 38 |
+
|
| 39 |
+
</details>
|
| 40 |
+
|
| 41 |
+
<details><summary>📌 Deploy To Railway </summary>
|
| 42 |
+
<a href="https://graph.org/file/fabd75cd5043d2cfdc13d.jpg"><img src="https://railway.app/button.svg" alt="Deploy"></a>
|
| 43 |
+
</details>
|
| 44 |
+
|
| 45 |
+
<details><summary>📌 Deploy to Heroku </summary>
|
| 46 |
+
|
| 47 |
+
<a href="https://heroku.com/deploy?template=https://github.com/DigitalBotz/Digital-Rename-Bot"><img src="https://img.shields.io/badge/Deploy%20To%20Heroku-black?style=for-the-badge&logo=heroku" width="220" height="38.45"></p></a>
|
| 48 |
+
</details>
|
| 49 |
+
|
| 50 |
+
## Rᴇǫᴜɪʀᴇᴅ Cᴏɴғɪɢs
|
| 51 |
+
|
| 52 |
+
* `BOT_TOKEN` - Get Bot Token From @BotFather
|
| 53 |
+
* `API_ID` - From my.telegram.org
|
| 54 |
+
* `API_HASH` - From my.telegram.org
|
| 55 |
+
* `ADMIN` - AUTH Or Bot Controllers Id's Multiple Id Use Space To Split
|
| 56 |
+
* `DB_URL` - Mongo Database URL From https://cloud.mongodb.com
|
| 57 |
+
* `DB_NAME` - Your Database Name From Mongodb.
|
| 58 |
+
* `FORCE_SUB` - Your Force Sub Channel Username Without @
|
| 59 |
+
* `LOG_CHANNEL` - Bot Logs Sending Channel. If You Don't Need This To Remove This Variable In Your Server
|
| 60 |
+
* `STRING_SESSION` - Your Tg Premium Account String Session Required. `[Note :- If you remove the string session, 4GB files doesn't works on the bot.]`
|
| 61 |
+
|
| 62 |
+
## 🥰 Features
|
| 63 |
+
|
| 64 |
+
* Renames very fast .
|
| 65 |
+
* Permanent Thumbnail support.
|
| 66 |
+
* Force join for the user for use.
|
| 67 |
+
* Supports Broadcasts.
|
| 68 |
+
* Custom File Name Support...[Prefix_&_Suffix]
|
| 69 |
+
* Set custom caption.
|
| 70 |
+
* Has a custom Start-up pic.
|
| 71 |
+
* Force subscribe available.
|
| 72 |
+
* Supports ulimited renaming at a time.
|
| 73 |
+
* Custom Metadata Support.
|
| 74 |
+
* Admin Command Available.
|
| 75 |
+
* premium subscription available.
|
| 76 |
+
* premium trial available.
|
| 77 |
+
* handle ban/unban members using command.
|
| 78 |
+
* Deploy to Koyeb + Heroku + Railway + Render.
|
| 79 |
+
* Developer Service 24x7. 🔥
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
## Botfather Commands
|
| 83 |
+
```
|
| 84 |
+
start - 𝖈ʜᴇᴄᴋ 𝖎 𝖆ᴍ ʟɪᴠᴇ.
|
| 85 |
+
plans - ᴜᴘɢʀᴀᴅᴇ ᴛᴏ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ.
|
| 86 |
+
myplan - ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ ʜᴇʀᴇ.
|
| 87 |
+
view_thumb - 𝖙ᴏ 𝖘ᴇᴇ 𝖞ᴏᴜʀ 𝖈ᴜ𝖘ᴛᴏᴍ 𝖙ʜᴜᴍʙɴᴀɪʟ !!
|
| 88 |
+
del_thumb - 𝖙ᴏ 𝖉ᴇʟᴇᴛᴇ 𝖞ᴏᴜʀ 𝖈ᴜ𝖘ᴛᴏᴍ 𝖙ʜᴜᴍʙɴᴀɪʟ !!
|
| 89 |
+
set_caption - Sᴇᴛ A Cᴜsᴛᴏᴍ Cᴀᴘᴛɪᴏɴ !!
|
| 90 |
+
see_caption - Sᴇᴇ Yᴏᴜʀ Cᴜsᴛᴏᴍ Cᴀᴘᴛɪᴏɴ !!
|
| 91 |
+
del_caption - Dᴇʟᴇᴛᴇ Cᴜsᴛᴏᴍ Cᴀᴘᴛɪᴏɴ !!
|
| 92 |
+
metadata - Tᴏ Sᴇᴛ & Cʜᴀɴɢᴇ ʏᴏᴜʀ ᴍᴇᴛᴀᴅᴀᴛᴀ ᴄᴏᴅᴇ
|
| 93 |
+
set_prefix - Tᴏ Sᴇᴛ Yᴏᴜʀ Pʀᴇғɪx !!
|
| 94 |
+
see_prefix - Tᴏ Sᴇᴇ Yᴏᴜʀ Pʀᴇғɪx !!
|
| 95 |
+
del_prefix - Dᴇʟᴇᴛᴇ Yᴏᴜʀ Pʀᴇғɪx !!
|
| 96 |
+
set_suffix - Tᴏ Sᴇᴛ Yᴏᴜʀ Sᴜғғɪx !!
|
| 97 |
+
see_suffix - Tᴏ Sᴇᴇ Yᴏᴜʀ Sᴜғғɪx !!
|
| 98 |
+
del_suffix - Dᴇʟᴇᴛᴇ Yᴏᴜʀ Sᴜғғɪx !!
|
| 99 |
+
restart - ᴛᴏ ʀᴇsᴛᴀʀᴛ ᴛʜᴇ ʙᴏᴛ ᴀɴᴅ sᴇɴᴅ ᴍᴇssᴀɢᴇ ᴀʟʟ ᴅʙ ᴜsᴇʀs (Aᴅᴍɪɴ Oɴʟʏ)
|
| 100 |
+
addpremium - ᴀᴅᴅ ᴘʀᴇᴍɪᴜᴍ (Aᴅᴍɪɴ Oɴʟʏ)
|
| 101 |
+
remove_premium - ʀᴇᴍᴏᴠᴇ ᴘʀᴇᴍɪᴜᴍ (Aᴅᴍɪɴ Oɴʟʏ)
|
| 102 |
+
ban - ban members using command (admin only)
|
| 103 |
+
unban - unban members using command (admin only)
|
| 104 |
+
banned_users - check bot all ban users using command (admin only)
|
| 105 |
+
logs - ᴄʜᴇᴄᴋ ʙᴏᴛ ʟᴏɢs (Aᴅᴍɪɴ Oɴʟʏ)
|
| 106 |
+
status - Cʜᴇᴄᴋ Bᴏᴛ Sᴛᴀᴛᴜs (Aᴅᴍɪɴ Oɴʟʏ)
|
| 107 |
+
broadcast - Sᴇɴᴅ Mᴇssᴀɢᴇ Tᴏ Aʟʟ Usᴇʀs (Aᴅᴍɪɴ Oɴʟʏ)
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## Note:
|
| 111 |
+
|
| 112 |
+
- Please, Just Fork The Repo And Edit As Per Your Needs. # Don't Remove My Credit.
|
| 113 |
+
- ᴅᴏ ɴᴏᴛ ʀᴇᴍᴏᴠᴇ ᴄʀᴇᴅɪᴛs ɢɪᴠᴇɴ ɪɴ ᴛʜɪs ʀᴇᴘᴏ.
|
| 114 |
+
- Importing this repo instead of forking is strictly prohibited, Kindly fork and edit as your wish. Must Give Credits for developer(s)
|
| 115 |
+
- If you find any bugs or errors, [report](https://t.me/DigitalBotz_Support) it
|
| 116 |
+
|
| 117 |
+
## ❣️ Special Thanks 👍
|
| 118 |
+
|
| 119 |
+
- Thanks To RknDeveloper For His Awesome [File-Rename-Bot](https://github.com/RknDeveloper/File-Rename-Bot.git)
|
| 120 |
+
- Thanks To [RknDeveloper](https://github.com/RknDeveloper) who have edited and modified this repo as now it is. (It's me 😂)
|
| 121 |
+
- Thanks To [JayMahakal](https://github.com/JayMahakal98) who have edited and modified this repo as now it is.
|
| 122 |
+
- Thanks To Rkn Developer Teams ✅ (Edit & New Feature Added)
|
| 123 |
+
- Special Repo Owner Thanks To [Digital Botz](https://github.com/DigitalBotz) 🥲
|
| 124 |
+
|
| 125 |
+
## Last Updated
|
| 126 |
+
- `22-11-2025 12:15:30 AM`
|
| 127 |
+
-
|
SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Security Policy
|
| 2 |
+
|
| 3 |
+
## Supported Versions
|
| 4 |
+
|
| 5 |
+
Use this section to tell people about which versions of your project are
|
| 6 |
+
currently being supported with security updates.
|
| 7 |
+
|
| 8 |
+
| Version | Supported |
|
| 9 |
+
| ------- | ------------------ |
|
| 10 |
+
| 5.1.x | :white_check_mark: |
|
| 11 |
+
| 5.0.x | :x: |
|
| 12 |
+
| 4.0.x | :white_check_mark: |
|
| 13 |
+
| < 4.0 | :x: |
|
| 14 |
+
|
| 15 |
+
## Reporting a Vulnerability
|
| 16 |
+
|
| 17 |
+
Use this section to tell people how to report a vulnerability.
|
| 18 |
+
|
| 19 |
+
Tell them where to go, how often they can expect to get an update on a
|
| 20 |
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
| 21 |
+
declined, etc.
|
app.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Renamer Bot",
|
| 3 |
+
"description": "Telegram File Renamer Bot ",
|
| 4 |
+
"logo": "https://telegra.ph/file/b746aadfe59959eb76f59.jpg",
|
| 5 |
+
"keywords": ["Renamer Bot", "Mongo DB"],
|
| 6 |
+
"repository": "https://github.com/DigitalBotz/Digital-Rename-Bot",
|
| 7 |
+
"env": {
|
| 8 |
+
"API_ID": {
|
| 9 |
+
"description": "Your APP ID From my.telegram.org ",
|
| 10 |
+
"value": ""
|
| 11 |
+
},
|
| 12 |
+
"API_HASH": {
|
| 13 |
+
"description": "Your API Hash From my.telegram.org ",
|
| 14 |
+
"value": ""
|
| 15 |
+
},
|
| 16 |
+
|
| 17 |
+
"FORCE_SUB": {
|
| 18 |
+
"description": "Your force sub channel user name without [@] ",
|
| 19 |
+
"value": "",
|
| 20 |
+
"required": false
|
| 21 |
+
},
|
| 22 |
+
"BOT_TOKEN": {
|
| 23 |
+
"description": "Your Bot Token From @BotFather",
|
| 24 |
+
"value": ""
|
| 25 |
+
},
|
| 26 |
+
"ADMIN": {
|
| 27 |
+
"description":"Add Your User ID multiple is use space to split"
|
| 28 |
+
},
|
| 29 |
+
"LOG_CHANNEL": {
|
| 30 |
+
"description":"Bot Log Sending Channel (just create a private channel and add bot to admin and take channel id to add this variable) ⚠️ id startswith -100 must",
|
| 31 |
+
"required": false
|
| 32 |
+
},
|
| 33 |
+
"DB_URL": {
|
| 34 |
+
"description": "Your Mongo DB URL Obtained From mongodb.com",
|
| 35 |
+
"value": ""
|
| 36 |
+
},
|
| 37 |
+
"DB_NAME":{
|
| 38 |
+
"description":"Your Mongo DB Database Name ",
|
| 39 |
+
"value": "Digital_Rename_Bot",
|
| 40 |
+
"required": false
|
| 41 |
+
},
|
| 42 |
+
"RKN_PIC": {
|
| 43 |
+
"description": "Your Bot start cmd Pic from @RKN_Telegraphbot",
|
| 44 |
+
"value": "https://telegra.ph/file/b746aadfe59959eb76f59.jpg",
|
| 45 |
+
"required": false
|
| 46 |
+
}
|
| 47 |
+
},
|
| 48 |
+
"buildpacks": [
|
| 49 |
+
{
|
| 50 |
+
"url": "heroku/python"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest"
|
| 54 |
+
}
|
| 55 |
+
]
|
| 56 |
+
}
|
bot.py
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# extra imports
|
| 33 |
+
import aiohttp, asyncio, warnings, pytz, datetime
|
| 34 |
+
import logging
|
| 35 |
+
import logging.config
|
| 36 |
+
import glob, sys
|
| 37 |
+
import importlib.util
|
| 38 |
+
from pathlib import Path
|
| 39 |
+
|
| 40 |
+
# pyrogram imports
|
| 41 |
+
from pyrogram import Client, __version__, errors
|
| 42 |
+
from pyrogram.raw.all import layer
|
| 43 |
+
from pyrogram import idle
|
| 44 |
+
|
| 45 |
+
# bots imports
|
| 46 |
+
from config import Config
|
| 47 |
+
from plugins.web_support import web_server
|
| 48 |
+
from plugins.file_rename import app
|
| 49 |
+
|
| 50 |
+
# Get logging configurations
|
| 51 |
+
logging.basicConfig(
|
| 52 |
+
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
| 53 |
+
handlers=[logging.FileHandler('BotLog.txt'),
|
| 54 |
+
logging.StreamHandler()]
|
| 55 |
+
)
|
| 56 |
+
#logger = logging.getLogger(__name__)
|
| 57 |
+
logging.getLogger("pyrofork").setLevel(logging.WARNING)
|
| 58 |
+
|
| 59 |
+
class DigitalRenameBot(Client):
|
| 60 |
+
def __init__(self):
|
| 61 |
+
super().__init__(
|
| 62 |
+
name="DigitalRenameBot",
|
| 63 |
+
api_id=Config.API_ID,
|
| 64 |
+
api_hash=Config.API_HASH,
|
| 65 |
+
bot_token=Config.BOT_TOKEN,
|
| 66 |
+
workers=200,
|
| 67 |
+
plugins={"root": "plugins"},
|
| 68 |
+
sleep_threshold=5,
|
| 69 |
+
max_concurrent_transmissions=50
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
async def start(self):
|
| 74 |
+
await super().start()
|
| 75 |
+
me = await self.get_me()
|
| 76 |
+
self.mention = me.mention
|
| 77 |
+
self.username = me.username
|
| 78 |
+
self.uptime = Config.BOT_UPTIME
|
| 79 |
+
self.premium = Config.PREMIUM_MODE
|
| 80 |
+
self.uploadlimit = Config.UPLOAD_LIMIT_MODE
|
| 81 |
+
Config.BOT = self
|
| 82 |
+
|
| 83 |
+
app = aiohttp.web.AppRunner(await web_server())
|
| 84 |
+
await app.setup()
|
| 85 |
+
bind_address = "0.0.0.0"
|
| 86 |
+
await aiohttp.web.TCPSite(app, bind_address, Config.PORT).start()
|
| 87 |
+
|
| 88 |
+
path = "plugins/*.py"
|
| 89 |
+
files = glob.glob(path)
|
| 90 |
+
for name in files:
|
| 91 |
+
with open(name) as a:
|
| 92 |
+
patt = Path(a.name)
|
| 93 |
+
plugin_name = patt.stem.replace(".py", "")
|
| 94 |
+
plugins_path = Path(f"plugins/{plugin_name}.py")
|
| 95 |
+
import_path = "plugins.{}".format(plugin_name)
|
| 96 |
+
spec = importlib.util.spec_from_file_location(import_path, plugins_path)
|
| 97 |
+
load = importlib.util.module_from_spec(spec)
|
| 98 |
+
spec.loader.exec_module(load)
|
| 99 |
+
sys.modules["plugins" + plugin_name] = load
|
| 100 |
+
print("Digital Botz Imported " + plugin_name)
|
| 101 |
+
|
| 102 |
+
print(f"{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️")
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
for id in Config.ADMIN:
|
| 106 |
+
if Config.STRING_SESSION:
|
| 107 |
+
try: await self.send_message(id, f"𝟮𝗚𝗕+ ғɪʟᴇ sᴜᴘᴘᴏʀᴛ ʜᴀs ʙᴇᴇɴ ᴀᴅᴅᴇᴅ ᴛᴏ ʏᴏᴜʀ ʙᴏᴛ.\n\nNote: 𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 𝐩𝐫𝐞𝐦𝐢𝐮𝐦 𝐚𝐜𝐜𝐨𝐮𝐧𝐭 𝐬𝐭𝐫𝐢𝐧𝐠 𝐬𝐞𝐬𝐬𝐢𝐨𝐧 𝐫𝐞𝐪𝐮𝐢𝐫𝐞𝐝 𝐓𝐡𝐞𝐧 𝐬𝐮𝐩𝐩𝐨𝐫𝐭𝐬 𝟐𝐆𝐁+ 𝐟𝐢𝐥𝐞𝐬.\n\n**__{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️__**")
|
| 108 |
+
except: pass
|
| 109 |
+
else:
|
| 110 |
+
try: await self.send_message(id, f"𝟮𝗚𝗕- ғɪʟᴇ sᴜᴘᴘᴏʀᴛ ʜᴀs ʙᴇᴇɴ ᴀᴅᴅᴇᴅ ᴛᴏ ʏᴏᴜʀ ʙᴏᴛ.\n\n**__{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️__**")
|
| 111 |
+
except: pass
|
| 112 |
+
|
| 113 |
+
if Config.LOG_CHANNEL:
|
| 114 |
+
try:
|
| 115 |
+
curr = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 116 |
+
date = curr.strftime('%d %B, %Y')
|
| 117 |
+
time = curr.strftime('%I:%M:%S %p')
|
| 118 |
+
await self.send_message(Config.LOG_CHANNEL, f"**__{me.mention} Iꜱ Rᴇsᴛᴀʀᴛᴇᴅ !!**\n\n📅 Dᴀᴛᴇ : `{date}`\n⏰ Tɪᴍᴇ : `{time}`\n🌐 Tɪᴍᴇᴢᴏɴᴇ : `Asia/Kolkata`\n\n🉐 Vᴇʀsɪᴏɴ : `v{__version__} (Layer {layer})`</b>")
|
| 119 |
+
except:
|
| 120 |
+
print("Pʟᴇᴀꜱᴇ Mᴀᴋᴇ Tʜɪꜱ Iꜱ Aᴅᴍɪɴ Iɴ Yᴏᴜʀ Lᴏɢ Cʜᴀɴɴᴇʟ")
|
| 121 |
+
|
| 122 |
+
async def stop(self, *args):
|
| 123 |
+
for id in Config.ADMIN:
|
| 124 |
+
try: await self.send_message(id, f"**Bot Stopped....**")
|
| 125 |
+
except: pass
|
| 126 |
+
|
| 127 |
+
print("Bot Stopped 🙄")
|
| 128 |
+
await super().stop()
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
digital_instance = DigitalRenameBot()
|
| 132 |
+
|
| 133 |
+
def main():
|
| 134 |
+
async def start_services():
|
| 135 |
+
if Config.STRING_SESSION:
|
| 136 |
+
await asyncio.gather(app.start(), digital_instance.start())
|
| 137 |
+
else:
|
| 138 |
+
await asyncio.gather(digital_instance.start())
|
| 139 |
+
|
| 140 |
+
# Idle mode start karo
|
| 141 |
+
await idle()
|
| 142 |
+
|
| 143 |
+
# Bot stop karo
|
| 144 |
+
if Config.STRING_SESSION:
|
| 145 |
+
await asyncio.gather(app.stop(), digital_instance.stop())
|
| 146 |
+
else:
|
| 147 |
+
await asyncio.gather(digital_instance.stop())
|
| 148 |
+
|
| 149 |
+
loop = asyncio.get_event_loop()
|
| 150 |
+
try:
|
| 151 |
+
loop.run_until_complete(start_services())
|
| 152 |
+
except KeyboardInterrupt:
|
| 153 |
+
print("\n🛑 Bot stopped by user!")
|
| 154 |
+
finally:
|
| 155 |
+
loop.close()
|
| 156 |
+
|
| 157 |
+
if __name__ == "__main__":
|
| 158 |
+
warnings.filterwarnings("ignore", message="There is no current event loop")
|
| 159 |
+
try:
|
| 160 |
+
main()
|
| 161 |
+
except errors.FloodWait as ft:
|
| 162 |
+
print(f"⏳ FloodWait: Sleeping for {ft.value} seconds")
|
| 163 |
+
asyncio.run(asyncio.sleep(ft.value))
|
| 164 |
+
print("Now Ready For Deploying!")
|
| 165 |
+
main()
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
# Rkn Developer
|
| 169 |
+
# Don't Remove Credit 😔
|
| 170 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 171 |
+
# Developer @RknDeveloperr
|
| 172 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
config.py
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
import re, os, time
|
| 33 |
+
id_pattern = re.compile(r'^.\d+$')
|
| 34 |
+
|
| 35 |
+
class Config(object):
|
| 36 |
+
# digital_botz client config
|
| 37 |
+
API_ID = os.environ.get("API_ID", "")
|
| 38 |
+
API_HASH = os.environ.get("API_HASH", "")
|
| 39 |
+
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
|
| 40 |
+
BOT = None
|
| 41 |
+
|
| 42 |
+
# premium account string session required 😢
|
| 43 |
+
STRING_SESSION = os.environ.get("STRING_SESSION", "")
|
| 44 |
+
|
| 45 |
+
# database config
|
| 46 |
+
DB_NAME = os.environ.get("DB_NAME","Digital_Rename_Bot")
|
| 47 |
+
DB_URL = os.environ.get("DB_URL","")
|
| 48 |
+
|
| 49 |
+
# other configs
|
| 50 |
+
RKN_PIC = os.environ.get("RKN_PIC", "https://telegra.ph/file/b746aadfe59959eb76f59.jpg")
|
| 51 |
+
ADMIN = [int(admin) if id_pattern.search(admin) else admin for admin in os.environ.get('ADMIN', '6705898491').split()]
|
| 52 |
+
LOG_CHANNEL = int(os.environ.get("LOG_CHANNEL", "-1002123429361"))
|
| 53 |
+
|
| 54 |
+
# free upload limit
|
| 55 |
+
FREE_UPLOAD_LIMIT = 6442450944 # calculation 6*1024*1024*1024=results
|
| 56 |
+
|
| 57 |
+
# premium mode feature ✅
|
| 58 |
+
UPLOAD_LIMIT_MODE = True
|
| 59 |
+
PREMIUM_MODE = True
|
| 60 |
+
|
| 61 |
+
#force subs
|
| 62 |
+
try:
|
| 63 |
+
FORCE_SUB = int(os.environ.get("FORCE_SUB", ""))
|
| 64 |
+
except:
|
| 65 |
+
FORCE_SUB = os.environ.get("FORCE_SUB", "Digital_Botz")
|
| 66 |
+
|
| 67 |
+
# wes response configuration
|
| 68 |
+
PORT = int(os.environ.get("PORT", "8080"))
|
| 69 |
+
BOT_UPTIME = time.time()
|
| 70 |
+
|
| 71 |
+
class rkn(object):
|
| 72 |
+
# part of text configuration
|
| 73 |
+
START_TXT = """<b>H𝙰𝙸, {}👋
|
| 74 |
+
|
| 75 |
+
𝚃ʜɪs 𝙸s 𝙰ɴ 𝙰ᴅᴠᴀᴄᴇᴅ 𝙰ɴᴅ 𝚈ᴇᴛ 𝙿ᴏᴡᴇʀғᴜʟ 𝚁ᴇɴᴀᴍᴇ 𝙱ᴏᴛ
|
| 76 |
+
𝚄sɪɴɢ 𝚃ʜɪs 𝙱ᴏᴛ 𝚈ᴏᴜ 𝙲ᴀɴ 𝚁ᴇɴᴀᴍᴇ & 𝙲ʜᴀɴɢᴇ 𝚃ʜᴜᴍʙɴᴀɪʟ 𝙾ғ 𝚈ᴏᴜʀ 𝙵ɪʟᴇ
|
| 77 |
+
𝚈ᴏᴜ 𝙲ᴀɴ 𝙰ʟsᴏ 𝙲ᴏɴᴠᴇʀᴛ 𝚅ɪᴅᴇᴏ 𝚃ᴏ 𝙵ɪʟᴇ & 𝙵ɪʟᴇ 𝚃ᴏ 𝚅ɪᴅᴇᴏ
|
| 78 |
+
𝚃𝙷𝙸𝚂 𝙱𝙾𝚃 𝙰𝙻𝚂𝙾 𝚂𝚄𝙿𝙿𝙾𝚁𝚃𝚂 𝙲𝚄𝚂𝚃𝙾𝙼 𝚃𝙷𝚄𝙼𝙱𝙽𝙰𝙸𝙻 𝙰𝙽𝙳 𝙲𝚄𝚂𝚃𝙾𝙼 𝙲𝙰𝙿𝚃𝙸𝙾𝙽
|
| 79 |
+
|
| 80 |
+
Tʜɪs Bᴏᴛ Wᴀs Cʀᴇᴀᴛᴇᴅ Bʏ : @Digital_Botz 💞</b>"""
|
| 81 |
+
|
| 82 |
+
ABOUT_TXT = """<b>╭───────────⍟
|
| 83 |
+
├🤖 ᴍy ɴᴀᴍᴇ : {}
|
| 84 |
+
├🖥️ Dᴇᴠᴇʟᴏᴩᴇʀꜱ : {}
|
| 85 |
+
├👨💻 Pʀᴏɢʀᴀᴍᴇʀ : {}
|
| 86 |
+
├📕 Lɪʙʀᴀʀy : {}
|
| 87 |
+
├✏️ Lᴀɴɢᴜᴀɢᴇ: {}
|
| 88 |
+
├💾 Dᴀᴛᴀ Bᴀꜱᴇ: {}
|
| 89 |
+
├📊 ᴠᴇʀsɪᴏɴ: <a href=https://github.com/DigitalBotz/Digital-Rename-Bot>{}</a></b>
|
| 90 |
+
╰───────────────⍟ """
|
| 91 |
+
|
| 92 |
+
HELP_TXT = """
|
| 93 |
+
<b>•></b> /start Tʜᴇ Bᴏᴛ.
|
| 94 |
+
|
| 95 |
+
✏️ <b><u>Hᴏᴡ Tᴏ Rᴇɴᴀᴍᴇ A Fɪʟᴇ</u></b>
|
| 96 |
+
<b>•></b> Sᴇɴᴅ Aɴy Fɪʟᴇ Aɴᴅ Tyᴩᴇ Nᴇᴡ Fɪʟᴇ Nɴᴀᴍᴇ \nAɴᴅ Aᴇʟᴇᴄᴛ Tʜᴇ Fᴏʀᴍᴀᴛ [ document, video, audio ].
|
| 97 |
+
ℹ️ 𝗔𝗻𝘆 𝗢𝘁𝗵𝗲𝗿 𝗛𝗲𝗹𝗽 𝗖𝗼𝗻𝘁𝗮𝗰𝘁 :- <a href=https://t.me/DigitalBotz_Support>𝑺𝑼𝑷𝑷𝑶𝑹𝑻 𝑮𝑹𝑶𝑼𝑷</a>
|
| 98 |
+
"""
|
| 99 |
+
|
| 100 |
+
UPGRADE_PREMIUM= """
|
| 101 |
+
•⪼ ★𝘗𝘭𝘢𝘯𝘴 - ⏳𝘋𝘢𝘵𝘦 - 💸𝘗𝘳𝘪𝘤𝘦
|
| 102 |
+
•⪼ 🥉𝘉𝘳𝘰𝘯𝘻𝘦 - 3𝘥𝘢𝘺𝘴 - 39
|
| 103 |
+
•⪼ 🥈𝘚𝘪𝘭𝘷𝘦𝘳 - 7𝘥𝘢𝘺𝘴 - 59
|
| 104 |
+
•⪼ 🥇𝘎𝘰𝘭𝘥 - 15𝘥𝘢𝘺𝘴 - 99
|
| 105 |
+
•⪼ 🏆𝘗𝘭𝘢𝘵𝘪𝘯𝘶𝘮 - 1𝘮𝘰𝘯𝘵𝘩 - 179
|
| 106 |
+
•⪼ 💎𝘋𝘪𝘢𝘮𝘰𝘯𝘥 - 2𝘮𝘰𝘯𝘵𝘩 - 339
|
| 107 |
+
|
| 108 |
+
- 𝘋𝘢𝘪𝘭𝘺 𝘜𝘱𝘭𝘰𝘢𝘥 𝘓𝘪𝘮𝘪𝘵 𝘜��𝘭𝘪𝘮𝘪𝘵𝘦𝘥
|
| 109 |
+
- 𝘋𝘪𝘴𝘤𝘰𝘶𝘯𝘵 𝘈𝘭𝘭 𝘗𝘭𝘢𝘯 𝘙𝘴.9
|
| 110 |
+
"""
|
| 111 |
+
|
| 112 |
+
UPGRADE_PLAN= """
|
| 113 |
+
𝘗𝘭𝘢𝘯: 𝘗𝘳𝘰
|
| 114 |
+
𝘋𝘢𝘵𝘦: 1 𝘮𝘰𝘯𝘵𝘩
|
| 115 |
+
𝘗𝘳𝘪𝘤𝘦: 179
|
| 116 |
+
𝘓𝘪𝘮𝘪𝘵: 100 𝘎𝘉
|
| 117 |
+
|
| 118 |
+
𝘗𝘭𝘢𝘯: 𝘜𝘭𝘵𝘢 𝘗𝘳𝘰
|
| 119 |
+
𝘋𝘢𝘵𝘦: 1 𝘮𝘰𝘯𝘵𝘩
|
| 120 |
+
𝘗𝘳𝘪𝘤𝘦: 199
|
| 121 |
+
𝘓𝘪𝘮𝘪𝘵: 1000 𝘎𝘉
|
| 122 |
+
|
| 123 |
+
- 𝘋𝘪𝘴𝘤𝘰𝘶𝘯𝘵 𝘈𝘭𝘭 𝘗𝘭𝘢𝘯 𝘙𝘴.9
|
| 124 |
+
"""
|
| 125 |
+
|
| 126 |
+
THUMBNAIL = """
|
| 127 |
+
🌌 <b><u>Hᴏᴡ Tᴏ Sᴇᴛ Tʜᴜᴍʙɴɪʟᴇ</u></b>
|
| 128 |
+
|
| 129 |
+
<b>•></b> Sᴇɴᴅ Aɴy Pʜᴏᴛᴏ Tᴏ Aᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟy Sᴇᴛ Tʜᴜᴍʙɴɪʟᴇ.
|
| 130 |
+
<b>•></b> /del_thumb Uꜱᴇ Tʜɪꜱ Cᴏᴍᴍᴀɴᴅ Tᴏ Dᴇʟᴇᴛᴇ Yᴏᴜʀ Oʟᴅ Tʜᴜᴍʙɴɪʟᴇ.
|
| 131 |
+
<b>•></b> /view_thumb Uꜱᴇ Tʜɪꜱ Cᴏᴍᴍᴀɴᴅ Tᴏ Vɪᴇᴡ Yᴏᴜʀ Cᴜʀʀᴇɴᴛ Tʜᴜᴍʙɴɪʟᴇ.
|
| 132 |
+
"""
|
| 133 |
+
CAPTION= """
|
| 134 |
+
📑 <b><u>Hᴏᴡ Tᴏ Sᴇᴛ Cᴜꜱᴛᴏᴍ Cᴀᴩᴛɪᴏɴ</u></b>
|
| 135 |
+
|
| 136 |
+
<b>•></b> /set_caption - Uꜱᴇ Tʜɪꜱ Cᴏᴍᴍᴀɴᴅ Tᴏ Sᴇᴛ ᴀ Cᴜꜱᴛᴏᴍ Cᴀᴩᴛɪᴏɴ
|
| 137 |
+
<b>•></b> /see_caption - Uꜱᴇ Tʜɪꜱ Cᴏᴍᴍᴀɴᴅ Tᴏ Vɪᴇᴡ Yᴏᴜʀ Cᴜꜱᴛᴏᴍ Cᴀᴩᴛɪᴏɴ
|
| 138 |
+
<b>•></b> /del_caption - Uꜱᴇ Tʜɪꜱ Cᴏᴍᴍᴀɴᴅ Tᴏ Dᴇʟᴇᴛᴇ Yᴏᴜʀ Cᴜꜱᴛᴏᴍ Cᴀᴩᴛɪᴏɴ
|
| 139 |
+
|
| 140 |
+
Exᴀᴍᴩʟᴇ:- `/set_caption 📕 Fɪʟᴇ Nᴀᴍᴇ: {filename}
|
| 141 |
+
💾 Sɪᴢᴇ: {filesize}
|
| 142 |
+
⏰ Dᴜʀᴀᴛɪᴏɴ: {duration}`
|
| 143 |
+
"""
|
| 144 |
+
BOT_STATUS = """
|
| 145 |
+
⚡️ ʙᴏᴛ sᴛᴀᴛᴜs ⚡️
|
| 146 |
+
|
| 147 |
+
⌚️ ʙᴏᴛ ᴜᴩᴛɪᴍᴇ: `{}`
|
| 148 |
+
👭 ᴛᴏᴛᴀʟ ᴜsᴇʀꜱ: `{}`
|
| 149 |
+
💸 ᴛᴏᴛᴀʟ ᴘʀᴇᴍɪᴜᴍ ᴜsᴇʀs: `{}`
|
| 150 |
+
֍ ᴜᴘʟᴏᴀᴅ: `{}`
|
| 151 |
+
⊙ ᴅᴏᴡɴʟᴏᴀᴅ: `{}`
|
| 152 |
+
"""
|
| 153 |
+
LIVE_STATUS = """
|
| 154 |
+
⚡ ʟɪᴠᴇ sᴇʀᴠᴇʀ sᴛᴀᴛᴜs ⚡
|
| 155 |
+
|
| 156 |
+
ᴜᴘᴛɪᴍᴇ: `{}`
|
| 157 |
+
ᴄᴘᴜ: `{}%`
|
| 158 |
+
ʀᴀᴍ: `{}%`
|
| 159 |
+
ᴛᴏᴛᴀʟ ᴅɪsᴋ: `{}`
|
| 160 |
+
ᴜsᴇᴅ sᴘᴀᴄᴇ: `{} {}%`
|
| 161 |
+
ғʀᴇᴇ sᴘᴀᴄᴇ: `{}`
|
| 162 |
+
ᴜᴘʟᴏᴀᴅ: `{}`
|
| 163 |
+
ᴅᴏᴡɴʟᴏᴀᴅ: `{}`
|
| 164 |
+
V𝟹.𝟶.𝟶 [STABLE]
|
| 165 |
+
"""
|
| 166 |
+
DIGITAL_METADATA = """
|
| 167 |
+
❪ SET CUSTOM METADATA ❫
|
| 168 |
+
|
| 169 |
+
- /metadata - Tᴏ Sᴇᴛ & Cʜᴀɴɢᴇ ʏᴏᴜʀ ᴍᴇᴛᴀᴅᴀᴛᴀ ᴄᴏᴅᴇ
|
| 170 |
+
|
| 171 |
+
☞ Fᴏʀ Exᴀᴍᴘʟᴇ:-
|
| 172 |
+
|
| 173 |
+
`--change-title @Rkn_Botz
|
| 174 |
+
--change-video-title @Rkn_Botz
|
| 175 |
+
--change-audio-title @Rkn_Botz
|
| 176 |
+
--change-subtitle-title @Rkn_Botz
|
| 177 |
+
--change-author @Rkn_Botz`
|
| 178 |
+
|
| 179 |
+
📥 Fᴏʀ Hᴇʟᴘ Cᴏɴᴛ. @Digital_Botz
|
| 180 |
+
"""
|
| 181 |
+
|
| 182 |
+
CUSTOM_FILE_NAME = """
|
| 183 |
+
<u>🖋️ Custom File Name</u>
|
| 184 |
+
|
| 185 |
+
you can pre-add a prefix and suffix along with your new filename
|
| 186 |
+
|
| 187 |
+
➢ /set_prefix - To add a prefix along with your _filename.
|
| 188 |
+
➢ /see_prefix - Tᴏ Sᴇᴇ Yᴏᴜʀ Pʀᴇғɪx !!
|
| 189 |
+
➢ /del_prefix - Tᴏ Dᴇʟᴇᴛᴇ Yᴏᴜʀ Pʀᴇғɪx !!
|
| 190 |
+
➢ /set_suffix - To add a suffix along with your filename_.
|
| 191 |
+
➢ /see_suffix - Tᴏ Sᴇᴇ Yᴏᴜʀ Sᴜғғɪx !!
|
| 192 |
+
➢ /del_suffix - Tᴏ Dᴇʟᴇᴛᴇ Yᴏᴜʀ Sᴜғғɪx !!
|
| 193 |
+
|
| 194 |
+
Exᴀᴍᴩʟᴇ:- `/set_suffix @Digital_Botz`
|
| 195 |
+
Exᴀᴍᴩʟᴇ:- `/set_prefix @Digital_Botz`
|
| 196 |
+
"""
|
| 197 |
+
|
| 198 |
+
#⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
| 199 |
+
#⚠️ Dᴏɴ'ᴛ Rᴇᴍᴏᴠᴇ Oᴜʀ Cʀᴇᴅɪᴛꜱ @RknDeveloper🙏🥲
|
| 200 |
+
# ᴡʜᴏᴇᴠᴇʀ ɪs ᴅᴇᴘʟᴏʏɪɴɢ ᴛʜɪs ʀᴇᴘᴏ ɪs ᴡᴀʀɴᴇᴅ ⚠️ ᴅᴏ ɴᴏᴛ ʀᴇᴍᴏᴠᴇ ᴄʀᴇᴅɪᴛs ɢɪᴠᴇɴ ɪɴ ᴛʜɪs ʀᴇᴘᴏ #ғɪʀsᴛ ᴀɴᴅ ʟᴀsᴛ ᴡᴀʀɴɪɴɢ ⚠️
|
| 201 |
+
DEV_TXT = """<b><u>Sᴩᴇᴄɪᴀʟ Tʜᴀɴᴋꜱ & Dᴇᴠᴇʟᴏᴩᴇʀꜱ</b></u>
|
| 202 |
+
|
| 203 |
+
» 𝗦𝗢𝗨𝗥𝗖𝗘 𝗖𝗢𝗗𝗘 : <a href=https://github.com/DigitalBotz/Digital-Rename-Bot>Digital-Rename-Bot</a>
|
| 204 |
+
|
| 205 |
+
• ❣️ <a href=https://github.com/RknDeveloper>RknDeveloper</a>
|
| 206 |
+
• ❣️ <a href=https://github.com/DigitalBotz>DigitalBotz</a>
|
| 207 |
+
• ❣️ <a href=https://github.com/JayMahakal98>Jay Mahakal</a> """
|
| 208 |
+
# ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
|
| 209 |
+
|
| 210 |
+
SEND_METADATA = """
|
| 211 |
+
❪ SET CUSTOM METADATA ❫
|
| 212 |
+
|
| 213 |
+
☞ Fᴏʀ Exᴀᴍᴘʟᴇ:-
|
| 214 |
+
|
| 215 |
+
`--change-title @Rkn_Botz
|
| 216 |
+
--change-video-title @Rkn_Botz
|
| 217 |
+
--change-audio-title @Rkn_Botz
|
| 218 |
+
--change-subtitle-title @Rkn_Botz
|
| 219 |
+
--change-author @Rkn_Botz`
|
| 220 |
+
|
| 221 |
+
📥 Fᴏʀ Hᴇʟᴘ Cᴏɴᴛ. @Digital_Botz
|
| 222 |
+
"""
|
| 223 |
+
|
| 224 |
+
RKN_PROGRESS = """<b>
|
| 225 |
+
╭━━━━━━━━◉🚀◉━━━━━━━━╮
|
| 226 |
+
┃ 𝗥𝗞𝗡 𝗣𝗥𝗢𝗖𝗘𝗦𝗦𝗜𝗡𝗚...❱━➣
|
| 227 |
+
┣━━━━━━━━━━━━━━━━━━━━╯
|
| 228 |
+
┣⪼ 📦 𝗦𝗜𝗭𝗘: {1} | {2}
|
| 229 |
+
┣⪼ 📊 𝗗𝗢𝗡𝗘: {0}%
|
| 230 |
+
┣⪼ 🚀 𝗦𝗣𝗘𝗘𝗗: {3}/s
|
| 231 |
+
┣⪼ ⏰ 𝗘𝗧𝗔: {4}
|
| 232 |
+
╰━━━━━━━━◉🔥◉━━━━━━━━╯</b>"""
|
| 233 |
+
|
| 234 |
+
# Rkn Developer
|
| 235 |
+
# Don't Remove Credit 😔
|
| 236 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 237 |
+
# Developer @RknDeveloperr
|
| 238 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
helper/database.py
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To (https://github.com/JayMahakal98)
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
|
| 9 |
+
"""
|
| 10 |
+
Apache License 2.0
|
| 11 |
+
Copyright (c) 2022 @Digital_Botz
|
| 12 |
+
|
| 13 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 14 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 15 |
+
in the Software without restriction, including without limitation the rights
|
| 16 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 17 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 18 |
+
furnished to do so, subject to the following conditions:
|
| 19 |
+
The above copyright notice and this permission notice shall be included in all
|
| 20 |
+
copies or substantial portions of the Software.
|
| 21 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 22 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 23 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 24 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 25 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 26 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 27 |
+
|
| 28 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 29 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 30 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
# database imports
|
| 34 |
+
import motor.motor_asyncio, datetime, pytz
|
| 35 |
+
|
| 36 |
+
# bots imports
|
| 37 |
+
from config import Config
|
| 38 |
+
from helper.utils import send_log
|
| 39 |
+
|
| 40 |
+
class Database:
|
| 41 |
+
def __init__(self, uri, database_name):
|
| 42 |
+
self._client = motor.motor_asyncio.AsyncIOMotorClient(uri)
|
| 43 |
+
self.db = self._client[database_name]
|
| 44 |
+
self.col = self.db.user
|
| 45 |
+
self.premium = self.db.premium
|
| 46 |
+
|
| 47 |
+
def new_user(self, id):
|
| 48 |
+
return dict(
|
| 49 |
+
_id=int(id),
|
| 50 |
+
join_date=datetime.date.today().isoformat(),
|
| 51 |
+
file_id=None,
|
| 52 |
+
caption=None,
|
| 53 |
+
prefix=None,
|
| 54 |
+
suffix=None,
|
| 55 |
+
used_limit=0,
|
| 56 |
+
usertype="Free",
|
| 57 |
+
uploadlimit=Config.FREE_UPLOAD_LIMIT,
|
| 58 |
+
daily=0,
|
| 59 |
+
metadata_mode=False,
|
| 60 |
+
metadata_code="--change-title @Rkn_Botz\n--change-video-title @Rkn_Botz\n--change-audio-title @Rkn_Botz\n--change-subtitle-title @Rkn_Botz\n--change-author @Rkn_Botz",
|
| 61 |
+
expiry_time=None,
|
| 62 |
+
has_free_trial=False,
|
| 63 |
+
ban_status=dict(
|
| 64 |
+
is_banned=False,
|
| 65 |
+
ban_duration=0,
|
| 66 |
+
banned_on=datetime.date.max.isoformat(),
|
| 67 |
+
ban_reason=''
|
| 68 |
+
)
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
async def add_user(self, b, m):
|
| 72 |
+
u = m.from_user
|
| 73 |
+
if not await self.is_user_exist(u.id):
|
| 74 |
+
user = self.new_user(u.id)
|
| 75 |
+
await self.col.insert_one(user)
|
| 76 |
+
await send_log(b, u)
|
| 77 |
+
|
| 78 |
+
async def is_user_exist(self, id):
|
| 79 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 80 |
+
return bool(user)
|
| 81 |
+
|
| 82 |
+
async def total_users_count(self):
|
| 83 |
+
count = await self.col.count_documents({})
|
| 84 |
+
return count
|
| 85 |
+
|
| 86 |
+
async def get_all_users(self):
|
| 87 |
+
all_users = self.col.find({})
|
| 88 |
+
return all_users
|
| 89 |
+
|
| 90 |
+
async def delete_user(self, user_id):
|
| 91 |
+
await self.col.delete_many({'_id': int(user_id)})
|
| 92 |
+
|
| 93 |
+
async def set_thumbnail(self, id, file_id):
|
| 94 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'file_id': file_id}})
|
| 95 |
+
|
| 96 |
+
async def get_thumbnail(self, id):
|
| 97 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 98 |
+
return user.get('file_id', None)
|
| 99 |
+
|
| 100 |
+
async def set_caption(self, id, caption):
|
| 101 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'caption': caption}})
|
| 102 |
+
|
| 103 |
+
async def get_caption(self, id):
|
| 104 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 105 |
+
return user.get('caption', None)
|
| 106 |
+
|
| 107 |
+
async def set_prefix(self, id, prefix):
|
| 108 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'prefix': prefix}})
|
| 109 |
+
|
| 110 |
+
async def get_prefix(self, id):
|
| 111 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 112 |
+
return user.get('prefix', None)
|
| 113 |
+
|
| 114 |
+
async def set_suffix(self, id, suffix):
|
| 115 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'suffix': suffix}})
|
| 116 |
+
|
| 117 |
+
async def get_suffix(self, id):
|
| 118 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 119 |
+
return user.get('suffix', None)
|
| 120 |
+
|
| 121 |
+
async def set_metadata_mode(self, id, bool_meta):
|
| 122 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'metadata_mode': bool_meta}})
|
| 123 |
+
|
| 124 |
+
async def get_metadata_mode(self, id):
|
| 125 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 126 |
+
return user.get('metadata_mode', None)
|
| 127 |
+
|
| 128 |
+
async def set_metadata_code(self, id, metadata_code):
|
| 129 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'metadata_code': metadata_code}})
|
| 130 |
+
|
| 131 |
+
async def get_metadata_code(self, id):
|
| 132 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 133 |
+
return user.get('metadata_code', None)
|
| 134 |
+
|
| 135 |
+
async def set_used_limit(self, id, used):
|
| 136 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'used_limit': used}})
|
| 137 |
+
|
| 138 |
+
async def set_usertype(self, id, type):
|
| 139 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'usertype': type}})
|
| 140 |
+
|
| 141 |
+
async def set_uploadlimit(self, id, limit):
|
| 142 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'uploadlimit': limit}})
|
| 143 |
+
|
| 144 |
+
async def set_reset_dailylimit(self, id, date):
|
| 145 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'daily': date}})
|
| 146 |
+
|
| 147 |
+
async def reset_uploadlimit_access(self, user_id):
|
| 148 |
+
seconds = 1440 * 60
|
| 149 |
+
reset_date = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
|
| 150 |
+
zero_usage = 0
|
| 151 |
+
|
| 152 |
+
user_data = await self.get_user_data(user_id)
|
| 153 |
+
if user_data:
|
| 154 |
+
expiry_time = user_data.get("daily")
|
| 155 |
+
current_time = datetime.datetime.now()
|
| 156 |
+
|
| 157 |
+
needs_reset = (
|
| 158 |
+
expiry_time is None or
|
| 159 |
+
expiry_time == 0 or
|
| 160 |
+
not isinstance(expiry_time, datetime.datetime) or
|
| 161 |
+
current_time > expiry_time
|
| 162 |
+
)
|
| 163 |
+
|
| 164 |
+
if needs_reset:
|
| 165 |
+
await self.col.update_one(
|
| 166 |
+
{'_id': user_id},
|
| 167 |
+
{'$set': {
|
| 168 |
+
'daily': reset_date,
|
| 169 |
+
'used_limit': zero_usage
|
| 170 |
+
}}
|
| 171 |
+
)
|
| 172 |
+
|
| 173 |
+
async def get_user_data(self, id) -> dict:
|
| 174 |
+
user_data = await self.col.find_one({'_id': int(id)})
|
| 175 |
+
return user_data or None
|
| 176 |
+
|
| 177 |
+
async def get_user(self, user_id):
|
| 178 |
+
user_data = await self.premium.find_one({"id": user_id})
|
| 179 |
+
return user_data
|
| 180 |
+
|
| 181 |
+
async def add_premium(self, user_id, user_data, limit=None, type=None):
|
| 182 |
+
await self.premium.update_one(
|
| 183 |
+
{"id": user_id},
|
| 184 |
+
{"$set": user_data},
|
| 185 |
+
upsert=True
|
| 186 |
+
)
|
| 187 |
+
|
| 188 |
+
if Config.UPLOAD_LIMIT_MODE and limit and type:
|
| 189 |
+
await self.col.update_one(
|
| 190 |
+
{'_id': user_id},
|
| 191 |
+
{'$set': {
|
| 192 |
+
'usertype': type,
|
| 193 |
+
'uploadlimit': limit
|
| 194 |
+
}}
|
| 195 |
+
)
|
| 196 |
+
|
| 197 |
+
async def remove_premium(self, user_id, limit=Config.FREE_UPLOAD_LIMIT, type="Free"):
|
| 198 |
+
await self.premium.update_one(
|
| 199 |
+
{"id": user_id},
|
| 200 |
+
{"$set": {
|
| 201 |
+
"expiry_time": None,
|
| 202 |
+
"has_free_trial": False
|
| 203 |
+
}}
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
if Config.UPLOAD_LIMIT_MODE and limit and type:
|
| 207 |
+
await self.col.update_one(
|
| 208 |
+
{'_id': user_id},
|
| 209 |
+
{'$set': {
|
| 210 |
+
'usertype': user_type,
|
| 211 |
+
'uploadlimit': limit
|
| 212 |
+
}}
|
| 213 |
+
)
|
| 214 |
+
|
| 215 |
+
async def checking_remaining_time(self, user_id):
|
| 216 |
+
user_data = await self.get_user(user_id)
|
| 217 |
+
expiry_time = user_data.get("expiry_time")
|
| 218 |
+
time_left_str = expiry_time - datetime.datetime.now()
|
| 219 |
+
return time_left_str
|
| 220 |
+
|
| 221 |
+
async def has_premium_access(self, user_id):
|
| 222 |
+
user_data = await self.get_user(user_id)
|
| 223 |
+
if user_data:
|
| 224 |
+
expiry_time = user_data.get("expiry_time")
|
| 225 |
+
if expiry_time is None:
|
| 226 |
+
# User previously used the free trial, but it has ended.
|
| 227 |
+
return False
|
| 228 |
+
elif isinstance(expiry_time, datetime.datetime) and datetime.datetime.now() <= expiry_time:
|
| 229 |
+
return True
|
| 230 |
+
else:
|
| 231 |
+
await self.remove_premium(user_id)
|
| 232 |
+
return False
|
| 233 |
+
|
| 234 |
+
async def total_premium_users_count(self):
|
| 235 |
+
count = await self.premium.count_documents({"expiry_time": {"$gt": datetime.datetime.now()}})
|
| 236 |
+
return count
|
| 237 |
+
|
| 238 |
+
async def get_all_premium_users(self):
|
| 239 |
+
all_premium_users = self.premium.find({"expiry_time": {"$gt": datetime.datetime.now()}})
|
| 240 |
+
return all_premium_users
|
| 241 |
+
|
| 242 |
+
async def get_free_trial_status(self, user_id):
|
| 243 |
+
user_data = await self.get_user(user_id)
|
| 244 |
+
if user_data:
|
| 245 |
+
return user_data.get("has_free_trial", False)
|
| 246 |
+
return False
|
| 247 |
+
|
| 248 |
+
async def give_free_trial(self, user_id):
|
| 249 |
+
seconds = 720 * 60
|
| 250 |
+
expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
|
| 251 |
+
user_data = {
|
| 252 |
+
"id": user_id,
|
| 253 |
+
"expiry_time": expiry_time,
|
| 254 |
+
"has_free_trial": True
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
if Config.UPLOAD_LIMIT_MODE:
|
| 258 |
+
limit_type = "Trial"
|
| 259 |
+
upload_limit = 536870912000
|
| 260 |
+
await self.add_premium(user_id, user_data, upload_limit, limit_type)
|
| 261 |
+
else:
|
| 262 |
+
await self.add_premium(user_id, user_data)
|
| 263 |
+
|
| 264 |
+
async def remove_ban(self, id):
|
| 265 |
+
ban_status = dict(
|
| 266 |
+
is_banned=False,
|
| 267 |
+
ban_duration=0,
|
| 268 |
+
banned_on=datetime.date.max.isoformat(),
|
| 269 |
+
ban_reason=''
|
| 270 |
+
)
|
| 271 |
+
await self.col.update_one({'_id': int(id)}, {'$set': {'ban_status': ban_status}})
|
| 272 |
+
|
| 273 |
+
async def ban_user(self, user_id, ban_duration, ban_reason):
|
| 274 |
+
ban_status = dict(
|
| 275 |
+
is_banned=True,
|
| 276 |
+
ban_duration=ban_duration,
|
| 277 |
+
banned_on=datetime.date.today().isoformat(),
|
| 278 |
+
ban_reason=ban_reason)
|
| 279 |
+
await self.col.update_one({'_id': int(user_id)}, {'$set': {'ban_status': ban_status}})
|
| 280 |
+
|
| 281 |
+
async def get_ban_status(self, id):
|
| 282 |
+
default = dict(
|
| 283 |
+
is_banned=False,
|
| 284 |
+
ban_duration=0,
|
| 285 |
+
banned_on=datetime.date.max.isoformat(),
|
| 286 |
+
ban_reason='')
|
| 287 |
+
user = await self.col.find_one({'_id': int(id)})
|
| 288 |
+
return user.get('ban_status', default)
|
| 289 |
+
|
| 290 |
+
async def get_all_banned_users(self):
|
| 291 |
+
banned_users = self.col.find({'ban_status.is_banned': True})
|
| 292 |
+
return banned_users
|
| 293 |
+
|
| 294 |
+
digital_botz = Database(Config.DB_URL, Config.DB_NAME)
|
| 295 |
+
|
| 296 |
+
# Rkn Developer
|
| 297 |
+
# Don't Remove Credit 😔
|
| 298 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 299 |
+
# Developer @RknDeveloperr
|
| 300 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
helper/ffmpeg.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os, time, asyncio, subprocess, json
|
| 2 |
+
from helper.utils import metadata_text
|
| 3 |
+
|
| 4 |
+
async def change_metadata(input_file, output_file, metadata):
|
| 5 |
+
author, title, video_title, audio_title, subtitle_title = await metadata_text(metadata)
|
| 6 |
+
|
| 7 |
+
# Get the video metadata
|
| 8 |
+
output = subprocess.check_output(['ffprobe', '-v', 'error', '-show_streams', '-print_format', 'json', input_file])
|
| 9 |
+
data = json.loads(output)
|
| 10 |
+
streams = data['streams']
|
| 11 |
+
|
| 12 |
+
# Create the FFmpeg command to change metadata
|
| 13 |
+
cmd = [
|
| 14 |
+
'ffmpeg',
|
| 15 |
+
'-i', input_file,
|
| 16 |
+
'-map', '0', # Map all streams
|
| 17 |
+
'-c:v', 'copy', # Copy video stream
|
| 18 |
+
'-c:a', 'copy', # Copy audio stream
|
| 19 |
+
'-c:s', 'copy', # Copy subtitles stream
|
| 20 |
+
'-metadata', f'title={title}',
|
| 21 |
+
'-metadata', f'author={author}',
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
# Add title to video stream
|
| 25 |
+
for stream in streams:
|
| 26 |
+
if stream['codec_type'] == 'video' and video_title:
|
| 27 |
+
cmd.extend([f'-metadata:s:{stream["index"]}', f'title={video_title}'])
|
| 28 |
+
elif stream['codec_type'] == 'audio' and audio_title:
|
| 29 |
+
cmd.extend([f'-metadata:s:{stream["index"]}', f'title={audio_title}'])
|
| 30 |
+
elif stream['codec_type'] == 'subtitle' and subtitle_title:
|
| 31 |
+
cmd.extend([f'-metadata:s:{stream["index"]}', f'title={subtitle_title}'])
|
| 32 |
+
|
| 33 |
+
cmd.extend(['-metadata', f'comment=Added by @Digital_Rename_Bot'])
|
| 34 |
+
cmd.extend(['-f', 'matroska']) # support all format
|
| 35 |
+
cmd.append(output_file)
|
| 36 |
+
print(cmd)
|
| 37 |
+
|
| 38 |
+
# Execute the command
|
| 39 |
+
try:
|
| 40 |
+
subprocess.run(cmd, check=True)
|
| 41 |
+
return True
|
| 42 |
+
except subprocess.CalledProcessError as e:
|
| 43 |
+
print("FFmpeg Error:", e.stderr)
|
| 44 |
+
return False
|
helper/utils.py
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To (https://github.com/JayMahakal98) & @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
|
| 9 |
+
"""
|
| 10 |
+
Apache License 2.0
|
| 11 |
+
Copyright (c) 2022 @Digital_Botz
|
| 12 |
+
|
| 13 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 14 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 15 |
+
in the Software without restriction, including without limitation the rights
|
| 16 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 17 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 18 |
+
furnished to do so, subject to the following conditions:
|
| 19 |
+
The above copyright notice and this permission notice shall be included in all
|
| 20 |
+
copies or substantial portions of the Software.
|
| 21 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 22 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 23 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 24 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 25 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 26 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 27 |
+
|
| 28 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 29 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 30 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
# extra imports
|
| 34 |
+
import math, time, re, datetime, pytz, os
|
| 35 |
+
from config import Config, rkn
|
| 36 |
+
|
| 37 |
+
# pyrogram imports
|
| 38 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
| 39 |
+
|
| 40 |
+
async def progress_for_pyrogram(current, total, ud_type, message, start):
|
| 41 |
+
now = time.time()
|
| 42 |
+
diff = now - start
|
| 43 |
+
if round(diff % 5.00) == 0 or current == total:
|
| 44 |
+
percentage = current * 100 / total
|
| 45 |
+
speed = current / diff
|
| 46 |
+
elapsed_time = round(diff) * 1000
|
| 47 |
+
time_to_completion = round((total - current) / speed) * 1000
|
| 48 |
+
estimated_total_time = elapsed_time + time_to_completion
|
| 49 |
+
|
| 50 |
+
elapsed_time = TimeFormatter(milliseconds=elapsed_time)
|
| 51 |
+
estimated_total_time = TimeFormatter(milliseconds=estimated_total_time)
|
| 52 |
+
|
| 53 |
+
progress = "{0}{1}".format(
|
| 54 |
+
''.join(["▣" for i in range(math.floor(percentage / 5))]),
|
| 55 |
+
''.join(["▢" for i in range(20 - math.floor(percentage / 5))])
|
| 56 |
+
)
|
| 57 |
+
tmp = progress + rkn.RKN_PROGRESS.format(
|
| 58 |
+
round(percentage, 2),
|
| 59 |
+
humanbytes(current),
|
| 60 |
+
humanbytes(total),
|
| 61 |
+
humanbytes(speed),
|
| 62 |
+
estimated_total_time if estimated_total_time != '' else "0 s"
|
| 63 |
+
)
|
| 64 |
+
try:
|
| 65 |
+
await message.edit(
|
| 66 |
+
text=f"{ud_type}\n\n{tmp}",
|
| 67 |
+
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("✖️ 𝙲𝙰𝙽𝙲𝙴𝙻 ✖️", callback_data="close")]])
|
| 68 |
+
)
|
| 69 |
+
except:
|
| 70 |
+
pass
|
| 71 |
+
|
| 72 |
+
def humanbytes(size):
|
| 73 |
+
if not size:
|
| 74 |
+
return ""
|
| 75 |
+
power = 2**10
|
| 76 |
+
n = 0
|
| 77 |
+
Dic_powerN = {0: ' ', 1: 'K', 2: 'M', 3: 'G', 4: 'T'}
|
| 78 |
+
while size > power:
|
| 79 |
+
size /= power
|
| 80 |
+
n += 1
|
| 81 |
+
return str(round(size, 2)) + " " + Dic_powerN[n] + 'ʙ'
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def TimeFormatter(milliseconds: int) -> str:
|
| 85 |
+
seconds, milliseconds = divmod(int(milliseconds), 1000)
|
| 86 |
+
minutes, seconds = divmod(seconds, 60)
|
| 87 |
+
hours, minutes = divmod(minutes, 60)
|
| 88 |
+
days, hours = divmod(hours, 24)
|
| 89 |
+
tmp = ((str(days) + "ᴅ, ") if days else "") + \
|
| 90 |
+
((str(hours) + "ʜ, ") if hours else "") + \
|
| 91 |
+
((str(minutes) + "ᴍ, ") if minutes else "") + \
|
| 92 |
+
((str(seconds) + "ꜱ, ") if seconds else "") + \
|
| 93 |
+
((str(milliseconds) + "ᴍꜱ, ") if milliseconds else "")
|
| 94 |
+
return tmp[:-2]
|
| 95 |
+
|
| 96 |
+
def convert(seconds):
|
| 97 |
+
seconds = seconds % (24 * 3600)
|
| 98 |
+
hour = seconds // 3600
|
| 99 |
+
seconds %= 3600
|
| 100 |
+
minutes = seconds // 60
|
| 101 |
+
seconds %= 60
|
| 102 |
+
return "%d:%02d:%02d" % (hour, minutes, seconds)
|
| 103 |
+
|
| 104 |
+
async def send_log(b, u):
|
| 105 |
+
if Config.LOG_CHANNEL:
|
| 106 |
+
curr = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 107 |
+
log_message = (
|
| 108 |
+
"**--Nᴇᴡ Uꜱᴇʀ Sᴛᴀʀᴛᴇᴅ Tʜᴇ Bᴏᴛ--**\n\n"
|
| 109 |
+
f"Uꜱᴇʀ: {u.mention}\n"
|
| 110 |
+
f"Iᴅ: `{u.id}`\n"
|
| 111 |
+
f"Uɴ: @{u.username}\n\n"
|
| 112 |
+
f"Dᴀᴛᴇ: {curr.strftime('%d %B, %Y')}\n"
|
| 113 |
+
f"Tɪᴍᴇ: {curr.strftime('%I:%M:%S %p')}\n\n"
|
| 114 |
+
f"By: {b.mention}"
|
| 115 |
+
)
|
| 116 |
+
await b.send_message(Config.LOG_CHANNEL, log_message)
|
| 117 |
+
|
| 118 |
+
async def get_seconds_first(time_string):
|
| 119 |
+
conversion_factors = {
|
| 120 |
+
's': 1,
|
| 121 |
+
'min': 60,
|
| 122 |
+
'hour': 3600,
|
| 123 |
+
'day': 86400,
|
| 124 |
+
'month': 86400 * 30,
|
| 125 |
+
'year': 86400 * 365
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
parts = time_string.split()
|
| 129 |
+
total_seconds = 0
|
| 130 |
+
|
| 131 |
+
for i in range(0, len(parts), 2):
|
| 132 |
+
value = int(parts[i])
|
| 133 |
+
unit = parts[i+1].rstrip('s') # Remove 's' from unit
|
| 134 |
+
total_seconds += value * conversion_factors.get(unit, 0)
|
| 135 |
+
|
| 136 |
+
return total_seconds
|
| 137 |
+
|
| 138 |
+
async def get_seconds(time_string):
|
| 139 |
+
conversion_factors = {
|
| 140 |
+
's': 1,
|
| 141 |
+
'min': 60,
|
| 142 |
+
'hour': 3600,
|
| 143 |
+
'day': 86400,
|
| 144 |
+
'month': 86400 * 30,
|
| 145 |
+
'year': 86400 * 365
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
total_seconds = 0
|
| 149 |
+
pattern = r'(\d+)\s*(\w+)'
|
| 150 |
+
matches = re.findall(pattern, time_string)
|
| 151 |
+
|
| 152 |
+
for value, unit in matches:
|
| 153 |
+
total_seconds += int(value) * conversion_factors.get(unit, 0)
|
| 154 |
+
|
| 155 |
+
return total_seconds
|
| 156 |
+
|
| 157 |
+
async def add_prefix_suffix(input_string, prefix='', suffix=''):
|
| 158 |
+
pattern = r'(?P<filename>.*?)(\.\w+)?$'
|
| 159 |
+
match = re.search(pattern, input_string)
|
| 160 |
+
|
| 161 |
+
if match:
|
| 162 |
+
filename = match.group('filename')
|
| 163 |
+
extension = match.group(2) or ''
|
| 164 |
+
|
| 165 |
+
prefix_str = f"{prefix} " if prefix else ""
|
| 166 |
+
suffix_str = f" {suffix}" if suffix else ""
|
| 167 |
+
|
| 168 |
+
return f"{prefix_str}{filename}{suffix_str}{extension}"
|
| 169 |
+
else:
|
| 170 |
+
return input_string
|
| 171 |
+
|
| 172 |
+
async def remove_path(*paths):
|
| 173 |
+
for path in paths:
|
| 174 |
+
if path and os.path.lexists(path):
|
| 175 |
+
os.remove(path)
|
| 176 |
+
|
| 177 |
+
async def metadata_text(metadata_text):
|
| 178 |
+
author = None
|
| 179 |
+
title = None
|
| 180 |
+
video_title = None
|
| 181 |
+
audio_title = None
|
| 182 |
+
subtitle_title = None
|
| 183 |
+
|
| 184 |
+
flags = [i.strip() for i in metadata_text.split('--')]
|
| 185 |
+
for f in flags:
|
| 186 |
+
if "change-author" in f:
|
| 187 |
+
author = f[len("change-author"):].strip()
|
| 188 |
+
if "change-title" in f:
|
| 189 |
+
title = f[len("change-title"):].strip()
|
| 190 |
+
if "change-video-title" in f:
|
| 191 |
+
video_title = f[len("change-video-title"):].strip()
|
| 192 |
+
if "change-audio-title" in f:
|
| 193 |
+
audio_title = f[len("change-audio-title"):].strip()
|
| 194 |
+
if "change-subtitle-title" in f:
|
| 195 |
+
subtitle_title = f[len("change-subtitle-title"):].strip()
|
| 196 |
+
|
| 197 |
+
return author, title, video_title, audio_title, subtitle_title
|
| 198 |
+
|
| 199 |
+
# (c) @RknDeveloperr
|
| 200 |
+
# Rkn Developer
|
| 201 |
+
# Don't Remove Credit 😔
|
| 202 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 203 |
+
# Developer @RknDeveloperr
|
| 204 |
+
# Special Thanks To @ReshamOwner
|
| 205 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/__init__.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Telegram MTProto API Client Library for Pyrogram
|
| 2 |
+
# Copyright (C) 2017-present DigitalBotz <https://github.com/DigitalBotz>
|
| 3 |
+
# I am a telegram bot, I created it using pyrogram library. https://github.com/pyrogram
|
| 4 |
+
"""
|
| 5 |
+
Apache License 2.0
|
| 6 |
+
Copyright (c) 2022 @Digital_Botz
|
| 7 |
+
|
| 8 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 9 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 10 |
+
in the Software without restriction, including without limitation the rights
|
| 11 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 12 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 13 |
+
furnished to do so, subject to the following conditions:
|
| 14 |
+
The above copyright notice and this permission notice shall be included in all
|
| 15 |
+
copies or substantial portions of the Software.
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 17 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 18 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 19 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 20 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 21 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 22 |
+
|
| 23 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 24 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 25 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
__name__ = "Digital-Rename-Bot"
|
| 29 |
+
__version__ = "3.1.0"
|
| 30 |
+
__license__ = " Apache License, Version 2.0"
|
| 31 |
+
__copyright__ = "Copyright (C) 2022-present Digital Botz <https://github.com/DigitalBotz>"
|
| 32 |
+
__programer__ = "<a href=https://github.com/DigitalBotz/Digital-Rename-Bot>Digital Botz</a>"
|
| 33 |
+
__library__ = "<a href=https://github.com/pyrogram>Pyʀᴏɢʀᴀᴍ</a>"
|
| 34 |
+
__language__ = "<a href=https://www.python.org/>Pyᴛʜᴏɴ 3</a>"
|
| 35 |
+
__database__ = "<a href=https://cloud.mongodb.com/>Mᴏɴɢᴏ DB</a>"
|
| 36 |
+
__developer__ = "<a href=https://t.me/Digital_Botz>Digital Botz</a>"
|
| 37 |
+
__maindeveloper__ = "<a href=https://t.me/RknDeveloper>RknDeveloper</a>"
|
| 38 |
+
|
| 39 |
+
# main copyright herders (©️)
|
| 40 |
+
# I have been working on this repo since 2022
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
# main working files
|
| 44 |
+
# - bot.py
|
| 45 |
+
# - web_support.py
|
| 46 |
+
# - plugins/
|
| 47 |
+
# - start_&_cb.py
|
| 48 |
+
# - Force_Sub.py
|
| 49 |
+
# - admin_panel.py
|
| 50 |
+
# - file_rename.py
|
| 51 |
+
# - metadata.py
|
| 52 |
+
# - prefix_&_suffix.py
|
| 53 |
+
# - thumb_&_cap.py
|
| 54 |
+
# - config.py
|
| 55 |
+
# - utils.py
|
| 56 |
+
# - database.py
|
| 57 |
+
|
| 58 |
+
# bot run files
|
| 59 |
+
# - bot.py
|
| 60 |
+
# - Procfile
|
| 61 |
+
# - Dockerfile
|
| 62 |
+
# - requirements.txt
|
| 63 |
+
# - runtime.txt
|
| 64 |
+
|
| 65 |
+
from plugins.force_sub import not_subscribed, forces_sub, handle_banned_user_status
|
| 66 |
+
from pyrogram import Client, filters
|
| 67 |
+
|
| 68 |
+
@Client.on_message(filters.private)
|
| 69 |
+
async def _(bot, message):
|
| 70 |
+
await handle_banned_user_status(bot, message)
|
| 71 |
+
|
| 72 |
+
@Client.on_message(filters.private & filters.create(not_subscribed))
|
| 73 |
+
async def forces_sub_handler(bot, message):
|
| 74 |
+
await forces_sub(bot, message)
|
plugins/admin_panel.py
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
"""
|
| 7 |
+
Apache License 2.0
|
| 8 |
+
Copyright (c) 2022 @Digital_Botz
|
| 9 |
+
|
| 10 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 11 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 12 |
+
in the Software without restriction, including without limitation the rights
|
| 13 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 14 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 15 |
+
furnished to do so, subject to the following conditions:
|
| 16 |
+
The above copyright notice and this permission notice shall be included in all
|
| 17 |
+
copies or substantial portions of the Software.
|
| 18 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 19 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 20 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 21 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 22 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 23 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 24 |
+
|
| 25 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 26 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 27 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
# extra imports
|
| 31 |
+
from config import Config
|
| 32 |
+
from helper.database import digital_botz
|
| 33 |
+
from helper.utils import get_seconds, humanbytes
|
| 34 |
+
import os, sys, time, asyncio, logging, datetime, pytz, traceback
|
| 35 |
+
|
| 36 |
+
# pyrogram imports
|
| 37 |
+
from pyrogram.types import Message
|
| 38 |
+
from pyrogram import Client, filters
|
| 39 |
+
from pyrogram.errors import FloodWait, InputUserDeactivated, UserIsBlocked, PeerIdInvalid
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
logger = logging.getLogger(__name__)
|
| 43 |
+
logger.setLevel(logging.INFO)
|
| 44 |
+
|
| 45 |
+
@Client.on_message(filters.command(["stats", "status"]) & filters.user(Config.ADMIN))
|
| 46 |
+
async def get_stats(bot, message):
|
| 47 |
+
total_users = await digital_botz.total_users_count()
|
| 48 |
+
if bot.premium:
|
| 49 |
+
total_premium_users = await digital_botz.total_premium_users_count()
|
| 50 |
+
else:
|
| 51 |
+
total_premium_users = "Disabled ✅"
|
| 52 |
+
uptime = time.strftime("%Hh%Mm%Ss", time.gmtime(time.time() - bot.uptime))
|
| 53 |
+
start_t = time.time()
|
| 54 |
+
rkn = await message.reply('**ᴘʀᴏᴄᴇssɪɴɢ.....**')
|
| 55 |
+
end_t = time.time()
|
| 56 |
+
time_taken_s = (end_t - start_t) * 1000
|
| 57 |
+
await rkn.edit(text=f"**--Bᴏᴛ Sᴛᴀᴛᴜꜱ--** \n\n**⌚️ Bᴏᴛ Uᴩᴛɪᴍᴇ:** {uptime} \n**🐌 Cᴜʀʀᴇɴᴛ Pɪɴɢ:** `{time_taken_s:.3f} ᴍꜱ` \n**👭 Tᴏᴛᴀʟ Uꜱᴇʀꜱ:** `{total_users}`\n**💸 ᴛᴏᴛᴀʟ ᴘʀᴇᴍɪᴜᴍ ᴜsᴇʀs:** `{total_premium_users}`")
|
| 58 |
+
|
| 59 |
+
# bot logs process
|
| 60 |
+
@Client.on_message(filters.command('logs') & filters.user(Config.ADMIN))
|
| 61 |
+
async def log_file(b, m):
|
| 62 |
+
try:
|
| 63 |
+
await m.reply_document('BotLog.txt')
|
| 64 |
+
except Exception as e:
|
| 65 |
+
await m.reply(str(e))
|
| 66 |
+
|
| 67 |
+
@Client.on_message(filters.command(["addpremium", "add_premium"]) & filters.user(Config.ADMIN))
|
| 68 |
+
async def add_premium(client, message):
|
| 69 |
+
if not client.premium:
|
| 70 |
+
return await message.reply_text("premium mode disabled ✅")
|
| 71 |
+
|
| 72 |
+
if client.uploadlimit:
|
| 73 |
+
if len(message.command) < 4:
|
| 74 |
+
return await message.reply_text("Usage : /addpremium user_id Plan_Type (e.g... `Pro`, `UltraPro`) time (e.g., '1 day for days', '1 hour for hours', or '1 min for minutes', or '1 month for months' or '1 year for year')", quote=True)
|
| 75 |
+
|
| 76 |
+
user_id = int(message.command[1])
|
| 77 |
+
plan_type = message.command[2]
|
| 78 |
+
|
| 79 |
+
if plan_type not in ["Pro", "UltraPro"]:
|
| 80 |
+
return await message.reply_text("Invalid Plan Type. Please use 'Pro' or 'UltraPro'.", quote=True)
|
| 81 |
+
|
| 82 |
+
time_string = " ".join(message.command[3:])
|
| 83 |
+
|
| 84 |
+
time_zone = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 85 |
+
current_time = time_zone.strftime("%d-%m-%Y\n⏱️ ᴊᴏɪɴɪɴɢ ᴛɪᴍᴇ : %I:%M:%S %p")
|
| 86 |
+
|
| 87 |
+
user = await client.get_users(user_id)
|
| 88 |
+
|
| 89 |
+
if plan_type == "Pro":
|
| 90 |
+
limit = 107374182400
|
| 91 |
+
type = "Pro"
|
| 92 |
+
elif plan_type == "UltraPro":
|
| 93 |
+
limit = 1073741824000
|
| 94 |
+
type = "UltraPro"
|
| 95 |
+
|
| 96 |
+
seconds = await get_seconds(time_string)
|
| 97 |
+
if seconds <= 0:
|
| 98 |
+
return await message.reply_text("Invalid time format. Please use `/addpremium user_id 1 year 1 month 1 day 1 min 10 s`", quote=True)
|
| 99 |
+
|
| 100 |
+
expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
|
| 101 |
+
user_data = {"id": user_id, "expiry_time": expiry_time}
|
| 102 |
+
await digital_botz.addpremium(user_id, user_data, limit, type)
|
| 103 |
+
|
| 104 |
+
user_data = await digital_botz.get_user_data(user_id)
|
| 105 |
+
limit = user_data.get('uploadlimit', 0)
|
| 106 |
+
type = user_data.get('usertype', "Free")
|
| 107 |
+
data = await digital_botz.get_user(user_id)
|
| 108 |
+
expiry = data.get("expiry_time")
|
| 109 |
+
expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
|
| 110 |
+
|
| 111 |
+
await message.reply_text(f"ᴘʀᴇᴍɪᴜᴍ ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ✅\n\n👤 ᴜꜱᴇʀ : {user.mention}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\nᴘʟᴀɴ :- `{type}`\nᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ ʟɪᴍɪᴛ :- `{humanbytes(limit)}`\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time_string}</code>\n\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", quote=True, disable_web_page_preview=True)
|
| 112 |
+
|
| 113 |
+
await client.send_message(
|
| 114 |
+
chat_id=user_id,
|
| 115 |
+
text=f"👋 ʜᴇʏ {user.mention},\nᴛʜᴀɴᴋ ʏᴏᴜ ꜰᴏʀ ᴘᴜʀᴄʜᴀꜱɪɴɢ ᴘʀᴇᴍɪᴜᴍ.\nᴇɴᴊᴏʏ !! ✨🎉\n\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time}</code>\nᴘʟᴀɴ :- `{type}`\nᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ ʟɪᴍɪᴛ :- `{humanbytes(limit)}`\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", disable_web_page_preview=True
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
else:
|
| 119 |
+
if len(message.command) < 3:
|
| 120 |
+
return await message.reply_text("Usage : /addpremium user_id time (e.g., '1 day for days', '1 hour for hours', or '1 min for minutes', or '1 month for months' or '1 year for year')", quote=True)
|
| 121 |
+
|
| 122 |
+
user_id = int(message.command[1])
|
| 123 |
+
time_string = " ".join(message.command[2:])
|
| 124 |
+
|
| 125 |
+
time_zone = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
|
| 126 |
+
current_time = time_zone.strftime("%d-%m-%Y\n⏱️ ᴊᴏɪɴɪɴɢ ᴛɪᴍᴇ : %I:%M:%S %p")
|
| 127 |
+
|
| 128 |
+
user = await client.get_users(user_id)
|
| 129 |
+
seconds = await get_seconds(time_string)
|
| 130 |
+
if seconds <= 0:
|
| 131 |
+
return await message.reply_text("Invalid time format. Please use `/addpremium user_id 1 year 1 month 1 day 1 min 10 s`", quote=True)
|
| 132 |
+
|
| 133 |
+
expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
|
| 134 |
+
user_data = {"id": user_id, "expiry_time": expiry_time}
|
| 135 |
+
await digital_botz.addpremium(user_id, user_data)
|
| 136 |
+
data = await digital_botz.get_user(user_id)
|
| 137 |
+
expiry = data.get("expiry_time")
|
| 138 |
+
expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
|
| 139 |
+
|
| 140 |
+
await message.reply_text(f"ᴘʀᴇᴍɪᴜᴍ ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ✅\n\n👤 ᴜꜱᴇʀ : {user.mention}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time_string}</code>\n\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", quote=True, disable_web_page_preview=True)
|
| 141 |
+
|
| 142 |
+
await client.send_message(
|
| 143 |
+
chat_id=user_id,
|
| 144 |
+
text=f"👋 ʜᴇʏ {user.mention},\nᴛʜᴀɴᴋ ʏᴏᴜ ꜰᴏʀ ᴘᴜʀᴄʜᴀꜱɪɴɢ ᴘʀᴇᴍɪᴜᴍ.\nᴇɴᴊᴏʏ !! ✨🎉\n\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time}</code>\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", disable_web_page_preview=True
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
@Client.on_message(filters.command(["removepremium", "remove_premium"]) & filters.user(Config.ADMIN))
|
| 149 |
+
async def remove_premium(bot, message):
|
| 150 |
+
if not bot.premium:
|
| 151 |
+
return await message.reply_text("premium mode disabled ✅")
|
| 152 |
+
|
| 153 |
+
if len(message.command) == 2:
|
| 154 |
+
user_id = int(message.command[1]) # Convert the user_id to integer
|
| 155 |
+
user = await bot.get_users(user_id)
|
| 156 |
+
if await digital_botz.has_premium_access(user_id):
|
| 157 |
+
await digital_botz.remove_premium(user_id)
|
| 158 |
+
await message.reply_text(f"ʜᴇʏ {user.mention}, ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ sᴜᴄᴄᴇssғᴜʟʟʏ ʀᴇᴍᴏᴠᴇᴅ.", quote=True)
|
| 159 |
+
await bot.send_message(chat_id=user_id, text=f"<b>ʜᴇʏ {user.mention},\n\n✨ ʏᴏᴜʀ ᴀᴄᴄᴏᴜɴᴛ ʜᴀs ʙᴇᴇɴ ʀᴇᴍᴏᴠᴇᴅ ᴛᴏ ᴏᴜʀ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ\n\nᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴘʟᴀɴ ʜᴇʀᴇ /myplan</b>")
|
| 160 |
+
else:
|
| 161 |
+
await message.reply_text("ᴜɴᴀʙʟᴇ ᴛᴏ ʀᴇᴍᴏᴠᴇ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ !\nᴀʀᴇ ʏᴏᴜ ꜱᴜʀᴇ, ɪᴛ ᴡᴀꜱ ᴀ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ ɪᴅ ?", quote=True)
|
| 162 |
+
else:
|
| 163 |
+
await message.reply_text("ᴜꜱᴀɢᴇ : /remove_premium ᴜꜱᴇʀ ɪᴅ", quote=True)
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
# Restart to cancell all process
|
| 167 |
+
@Client.on_message(filters.private & filters.command("restart") & filters.user(Config.ADMIN))
|
| 168 |
+
async def restart_bot(b, m):
|
| 169 |
+
rkn = await b.send_message(text="**🔄 ᴘʀᴏᴄᴇssᴇs sᴛᴏᴘᴘᴇᴅ. ʙᴏᴛ ɪs ʀᴇsᴛᴀʀᴛɪɴɢ.....**", chat_id=m.chat.id)
|
| 170 |
+
failed = 0
|
| 171 |
+
success = 0
|
| 172 |
+
deactivated = 0
|
| 173 |
+
blocked = 0
|
| 174 |
+
start_time = time.time()
|
| 175 |
+
total_users = await digital_botz.total_users_count()
|
| 176 |
+
all_users = await digital_botz.get_all_users()
|
| 177 |
+
async for user in all_users:
|
| 178 |
+
try:
|
| 179 |
+
restart_msg = f"ʜᴇʏ, {(await b.get_users(user['_id'])).mention}\n\n**🔄 ᴘʀᴏᴄᴇssᴇs sᴛᴏᴘᴘᴇᴅ. ʙᴏᴛ ɪs ʀᴇsᴛᴀʀᴛɪɴɢ.....\n\n✅️ ʙᴏᴛ ɪs ʀᴇsᴛᴀʀᴛᴇᴅ. ɴᴏᴡ ʏᴏᴜ ᴄᴀɴ ᴜsᴇ ᴍᴇ.**"
|
| 180 |
+
await b.send_message(user['_id'], restart_msg)
|
| 181 |
+
success += 1
|
| 182 |
+
except InputUserDeactivated:
|
| 183 |
+
deactivated +=1
|
| 184 |
+
await digital_botz.delete_user(user['_id'])
|
| 185 |
+
except UserIsBlocked:
|
| 186 |
+
blocked +=1
|
| 187 |
+
await digital_botz.delete_user(user['_id'])
|
| 188 |
+
except Exception as e:
|
| 189 |
+
failed += 1
|
| 190 |
+
await digital_botz.delete_user(user['_id'])
|
| 191 |
+
print(e)
|
| 192 |
+
pass
|
| 193 |
+
try:
|
| 194 |
+
await rkn.edit(f"<u>ʀᴇsᴛᴀʀᴛ ɪɴ ᴩʀᴏɢʀᴇꜱꜱ:</u>\n\n• ᴛᴏᴛᴀʟ ᴜsᴇʀs: {total_users}\n• sᴜᴄᴄᴇssғᴜʟ: {success}\n• ʙʟᴏᴄᴋᴇᴅ ᴜsᴇʀs: {blocked}\n• ᴅᴇʟᴇᴛᴇᴅ ᴀᴄᴄᴏᴜɴᴛs: {deactivated}\n• ᴜɴsᴜᴄᴄᴇssғᴜʟ: {failed}")
|
| 195 |
+
except FloodWait as e:
|
| 196 |
+
await asyncio.sleep(e.value)
|
| 197 |
+
completed_restart = datetime.timedelta(seconds=int(time.time() - start_time))
|
| 198 |
+
await rkn.edit(f"ᴄᴏᴍᴘʟᴇᴛᴇᴅ ʀᴇsᴛᴀʀᴛ: {completed_restart}\n\n• ᴛᴏᴛᴀʟ ᴜsᴇʀs: {total_users}\n• sᴜᴄᴄᴇssғᴜʟ: {success}\n• ʙʟᴏᴄᴋᴇᴅ ᴜsᴇʀs: {blocked}\n• ᴅᴇʟᴇᴛᴇᴅ ᴀᴄᴄᴏᴜɴᴛs: {deactivated}\n• ᴜɴsᴜᴄᴄᴇssғᴜʟ: {failed}")
|
| 199 |
+
os.execl(sys.executable, sys.executable, *sys.argv)
|
| 200 |
+
|
| 201 |
+
@Client.on_message(filters.private & filters.command("ban") & filters.user(Config.ADMIN))
|
| 202 |
+
async def ban(c: Client, m: Message):
|
| 203 |
+
if len(m.command) == 1:
|
| 204 |
+
await m.reply_text(
|
| 205 |
+
f"Use this command to ban any user from the bot.\n\n"
|
| 206 |
+
f"Usage:\n\n"
|
| 207 |
+
f"`/ban user_id ban_duration ban_reason`\n\n"
|
| 208 |
+
f"Eg: `/ban 1234567 28 You misused me.`\n"
|
| 209 |
+
f"This will ban user with id `1234567` for `28` days for the reason `You misused me`.",
|
| 210 |
+
quote=True
|
| 211 |
+
)
|
| 212 |
+
return
|
| 213 |
+
|
| 214 |
+
try:
|
| 215 |
+
user_id = int(m.command[1])
|
| 216 |
+
ban_duration = int(m.command[2])
|
| 217 |
+
ban_reason = ' '.join(m.command[3:])
|
| 218 |
+
ban_log_text = f"Banning user {user_id} for {ban_duration} days for the reason {ban_reason}."
|
| 219 |
+
try:
|
| 220 |
+
await c.send_message(user_id,
|
| 221 |
+
f"You are banned to use this bot for **{ban_duration}** day(s) for the reason __{ban_reason}__ \n\n"
|
| 222 |
+
f"**Message from the admin**"
|
| 223 |
+
)
|
| 224 |
+
ban_log_text += '\n\nUser notified successfully!'
|
| 225 |
+
except:
|
| 226 |
+
traceback.print_exc()
|
| 227 |
+
ban_log_text += f"\n\nUser notification failed! \n\n`{traceback.format_exc()}`"
|
| 228 |
+
|
| 229 |
+
await digital_botz.ban_user(user_id, ban_duration, ban_reason)
|
| 230 |
+
await m.reply_text(ban_log_text, quote=True)
|
| 231 |
+
except:
|
| 232 |
+
traceback.print_exc()
|
| 233 |
+
await m.reply_text(
|
| 234 |
+
f"Error occoured! Traceback given below\n\n`{traceback.format_exc()}`",
|
| 235 |
+
quote=True
|
| 236 |
+
)
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
@Client.on_message(filters.private & filters.command("unban") & filters.user(Config.ADMIN))
|
| 240 |
+
async def unban(c: Client, m: Message):
|
| 241 |
+
if len(m.command) == 1:
|
| 242 |
+
await m.reply_text(
|
| 243 |
+
f"Use this command to unban any user.\n\n"
|
| 244 |
+
f"Usage:\n\n`/unban user_id`\n\n"
|
| 245 |
+
f"Eg: `/unban 1234567`\n"
|
| 246 |
+
f"This will unban user with id `1234567`.",
|
| 247 |
+
quote=True
|
| 248 |
+
)
|
| 249 |
+
return
|
| 250 |
+
|
| 251 |
+
try:
|
| 252 |
+
user_id = int(m.command[1])
|
| 253 |
+
unban_log_text = f"Unbanning user {user_id}"
|
| 254 |
+
try:
|
| 255 |
+
await c.send_message(user_id, f"Your ban was lifted!")
|
| 256 |
+
unban_log_text += '\n\nUser notified successfully!'
|
| 257 |
+
except:
|
| 258 |
+
traceback.print_exc()
|
| 259 |
+
unban_log_text += f"\n\nUser notification failed! \n\n`{traceback.format_exc()}`"
|
| 260 |
+
await digital_botz.remove_ban(user_id)
|
| 261 |
+
await m.reply_text(unban_log_text, quote=True)
|
| 262 |
+
except:
|
| 263 |
+
traceback.print_exc()
|
| 264 |
+
await m.reply_text(
|
| 265 |
+
f"Error occurred! Traceback given below\n\n`{traceback.format_exc()}`",
|
| 266 |
+
quote=True
|
| 267 |
+
)
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
@Client.on_message(filters.private & filters.command("banned_users") & filters.user(Config.ADMIN))
|
| 271 |
+
async def _banned_users(_, m: Message):
|
| 272 |
+
all_banned_users = await digital_botz.get_all_banned_users()
|
| 273 |
+
banned_usr_count = 0
|
| 274 |
+
text = ''
|
| 275 |
+
async for banned_user in all_banned_users:
|
| 276 |
+
user_id = banned_user['id']
|
| 277 |
+
ban_duration = banned_user['ban_status']['ban_duration']
|
| 278 |
+
banned_on = banned_user['ban_status']['banned_on']
|
| 279 |
+
ban_reason = banned_user['ban_status']['ban_reason']
|
| 280 |
+
banned_usr_count += 1
|
| 281 |
+
text += f"> **user_id**: `{user_id}`, **Ban Duration**: `{ban_duration}`, " \
|
| 282 |
+
f"**Banned on**: `{banned_on}`, **Reason**: `{ban_reason}`\n\n"
|
| 283 |
+
reply_text = f"Total banned user(s): `{banned_usr_count}`\n\n{text}"
|
| 284 |
+
if len(reply_text) > 4096:
|
| 285 |
+
with open('banned-users.txt', 'w') as f:
|
| 286 |
+
f.write(reply_text)
|
| 287 |
+
await m.reply_document('banned-users.txt', True)
|
| 288 |
+
os.remove('banned-users.txt')
|
| 289 |
+
return
|
| 290 |
+
await m.reply_text(reply_text, True)
|
| 291 |
+
|
| 292 |
+
|
| 293 |
+
@Client.on_message(filters.command("broadcast") & filters.user(Config.ADMIN) & filters.reply)
|
| 294 |
+
async def broadcast_handler(bot: Client, m: Message):
|
| 295 |
+
await bot.send_message(Config.LOG_CHANNEL, f"{m.from_user.mention} or {m.from_user.id} Iꜱ ꜱᴛᴀʀᴛᴇᴅ ᴛʜᴇ Bʀᴏᴀᴅᴄᴀꜱᴛ......")
|
| 296 |
+
all_users = await digital_botz.get_all_users()
|
| 297 |
+
broadcast_msg = m.reply_to_message
|
| 298 |
+
sts_msg = await m.reply_text("Bʀᴏᴀᴅᴄᴀꜱᴛ Sᴛᴀʀᴛᴇᴅ..!")
|
| 299 |
+
done = 0
|
| 300 |
+
failed = 0
|
| 301 |
+
success = 0
|
| 302 |
+
start_time = time.time()
|
| 303 |
+
total_users = await digital_botz.total_users_count()
|
| 304 |
+
async for user in all_users:
|
| 305 |
+
sts = await send_msg(user['_id'], broadcast_msg)
|
| 306 |
+
if sts == 200:
|
| 307 |
+
success += 1
|
| 308 |
+
else:
|
| 309 |
+
failed += 1
|
| 310 |
+
if sts == 400:
|
| 311 |
+
await digital_botz.delete_user(user['_id'])
|
| 312 |
+
done += 1
|
| 313 |
+
if not done % 20:
|
| 314 |
+
await sts_msg.edit(f"Bʀᴏᴀᴅᴄᴀꜱᴛ Iɴ Pʀᴏɢʀᴇꜱꜱ: \nTᴏᴛᴀʟ Uꜱᴇʀꜱ {total_users} \nCᴏᴍᴩʟᴇᴛᴇᴅ: {done} / {total_users}\nSᴜᴄᴄᴇꜱꜱ: {success}\nFᴀɪʟᴇᴅ: {failed}")
|
| 315 |
+
completed_in = datetime.timedelta(seconds=int(time.time() - start_time))
|
| 316 |
+
await sts_msg.edit(f"Bʀᴏᴀᴅᴄᴀꜱᴛ Cᴏᴍᴩʟᴇᴛᴇᴅ: \nCᴏᴍᴩʟᴇᴛᴇᴅ Iɴ `{completed_in}`.\n\nTᴏᴛᴀʟ Uꜱᴇʀꜱ {total_users}\nCᴏᴍᴩʟᴇᴛᴇᴅ: {done} / {total_users}\nSᴜᴄᴄᴇꜱꜱ: {success}\nFᴀɪʟᴇᴅ: {failed}")
|
| 317 |
+
|
| 318 |
+
async def send_msg(user_id, message):
|
| 319 |
+
try:
|
| 320 |
+
await message.copy(chat_id=int(user_id))
|
| 321 |
+
return 200
|
| 322 |
+
except FloodWait as e:
|
| 323 |
+
await asyncio.sleep(e.value)
|
| 324 |
+
return send_msg(user_id, message)
|
| 325 |
+
except InputUserDeactivated:
|
| 326 |
+
logger.info(f"{user_id} : Dᴇᴀᴄᴛɪᴠᴀᴛᴇᴅ")
|
| 327 |
+
return 400
|
| 328 |
+
except UserIsBlocked:
|
| 329 |
+
logger.info(f"{user_id} : Bʟᴏᴄᴋᴇᴅ Tʜᴇ Bᴏᴛ")
|
| 330 |
+
return 400
|
| 331 |
+
except PeerIdInvalid:
|
| 332 |
+
logger.info(f"{user_id} : Uꜱᴇʀ Iᴅ Iɴᴠᴀʟɪᴅ")
|
| 333 |
+
return 400
|
| 334 |
+
except Exception as e:
|
| 335 |
+
logger.error(f"{user_id} : {e}")
|
| 336 |
+
return 500
|
| 337 |
+
|
| 338 |
+
|
| 339 |
+
# Rkn Developer
|
| 340 |
+
# Don't Remove Credit 😔
|
| 341 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 342 |
+
# Developer @RknDeveloperr
|
plugins/file_rename.py
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# pyrogram imports
|
| 33 |
+
from pyrogram import Client, filters
|
| 34 |
+
from pyrogram.enums import MessageMediaType
|
| 35 |
+
from pyrogram.errors import FloodWait
|
| 36 |
+
from pyrogram.file_id import FileId
|
| 37 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, ForceReply
|
| 38 |
+
|
| 39 |
+
# hachoir imports
|
| 40 |
+
from hachoir.metadata import extractMetadata
|
| 41 |
+
from hachoir.parser import createParser
|
| 42 |
+
from PIL import Image
|
| 43 |
+
|
| 44 |
+
# bots imports
|
| 45 |
+
from helper.utils import progress_for_pyrogram, convert, humanbytes, add_prefix_suffix, remove_path
|
| 46 |
+
from helper.database import digital_botz
|
| 47 |
+
from helper.ffmpeg import change_metadata
|
| 48 |
+
from config import Config
|
| 49 |
+
|
| 50 |
+
# extra imports
|
| 51 |
+
from asyncio import sleep
|
| 52 |
+
import os, time, asyncio
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
UPLOAD_TEXT = """Uploading Started...."""
|
| 56 |
+
DOWNLOAD_TEXT = """Download Started..."""
|
| 57 |
+
|
| 58 |
+
app = Client("4gb_FileRenameBot", api_id=Config.API_ID, api_hash=Config.API_HASH, session_string=Config.STRING_SESSION)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
@Client.on_message(filters.private & (filters.audio | filters.document | filters.video))
|
| 62 |
+
async def rename_start(client, message):
|
| 63 |
+
user_id = message.from_user.id
|
| 64 |
+
rkn_file = getattr(message, message.media.value)
|
| 65 |
+
filename = rkn_file.file_name
|
| 66 |
+
filesize = humanbytes(rkn_file.file_size)
|
| 67 |
+
mime_type = rkn_file.mime_type
|
| 68 |
+
dcid = FileId.decode(rkn_file.file_id).dc_id
|
| 69 |
+
extension_type = mime_type.split('/')[0]
|
| 70 |
+
|
| 71 |
+
if client.premium and client.uploadlimit:
|
| 72 |
+
await digital_botz.reset_uploadlimit_access(user_id)
|
| 73 |
+
user_data = await digital_botz.get_user_data(user_id)
|
| 74 |
+
limit = user_data.get('uploadlimit', 0)
|
| 75 |
+
used = user_data.get('used_limit', 0)
|
| 76 |
+
remain = int(limit) - int(used)
|
| 77 |
+
used_percentage = int(used) / int(limit) * 100
|
| 78 |
+
if remain < int(rkn_file.file_size):
|
| 79 |
+
return await message.reply_text(f"{used_percentage:.2f}% Of Daily Upload Limit {humanbytes(limit)}.\n\n Media Size: {filesize}\n Your Used Daily Limit {humanbytes(used)}\n\nYou have only **{humanbytes(remain)}** Data.\nPlease, Buy Premium Plan s.", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("🪪 Uᴘɢʀᴀᴅᴇ", callback_data="plans")]]))
|
| 80 |
+
|
| 81 |
+
if await digital_botz.has_premium_access(user_id) and client.premium:
|
| 82 |
+
if not Config.STRING_SESSION:
|
| 83 |
+
if rkn_file.file_size > 2000 * 1024 * 1024:
|
| 84 |
+
return await message.reply_text("Sᴏʀʀy Bʀᴏ Tʜɪꜱ Bᴏᴛ Iꜱ Dᴏᴇꜱɴ'ᴛ Sᴜᴩᴩᴏʀᴛ Uᴩʟᴏᴀᴅɪɴɢ Fɪʟᴇꜱ Bɪɢɢᴇʀ Tʜᴀɴ 2Gʙ+")
|
| 85 |
+
|
| 86 |
+
try:
|
| 87 |
+
await message.reply_text(
|
| 88 |
+
text=f"**__ᴍᴇᴅɪᴀ ɪɴꜰᴏ:\n\n◈ ᴏʟᴅ ꜰɪʟᴇ ɴᴀᴍᴇ: `{filename}`\n\n◈ ᴇxᴛᴇɴꜱɪᴏɴ: `{extension_type.upper()}`\n◈ ꜰɪʟᴇ ꜱɪᴢᴇ: `{filesize}`\n◈ ᴍɪᴍᴇ ᴛʏᴇᴩ: `{mime_type}`\n◈ ᴅᴄ ɪᴅ: `{dcid}`\n\nᴘʟᴇᴀsᴇ ᴇɴᴛᴇʀ ᴛʜᴇ ɴᴇᴡ ғɪʟᴇɴᴀᴍᴇ ᴡɪᴛʜ ᴇxᴛᴇɴsɪᴏɴ ᴀɴᴅ ʀᴇᴘʟʏ ᴛʜɪs ᴍᴇssᴀɢᴇ....__**",
|
| 89 |
+
reply_to_message_id=message.id,
|
| 90 |
+
reply_markup=ForceReply(True)
|
| 91 |
+
)
|
| 92 |
+
await asyncio.sleep(30)
|
| 93 |
+
except FloodWait as e:
|
| 94 |
+
await asyncio.sleep(e.value)
|
| 95 |
+
await message.reply_text(
|
| 96 |
+
text=f"**__ᴍᴇᴅɪᴀ ɪɴꜰᴏ:\n\n◈ ᴏʟᴅ ꜰɪʟᴇ ɴᴀᴍᴇ: `{filename}`\n\n◈ ᴇxᴛᴇɴꜱɪᴏɴ: `{extension_type.upper()}`\n◈ ꜰɪʟᴇ ꜱɪᴢᴇ: `{filesize}`\n◈ ᴍɪᴍᴇ ᴛʏᴇᴩ: `{mime_type}`\n◈ ᴅᴄ ɪᴅ: `{dcid}`\n\nᴘʟᴇᴀsᴇ ��ɴᴛᴇʀ ᴛʜᴇ ɴᴇᴡ ғɪʟᴇɴᴀᴍᴇ ᴡɪᴛʜ ᴇxᴛᴇɴsɪᴏɴ ᴀɴᴅ ʀᴇᴘʟʏ ᴛʜɪs ᴍᴇssᴀɢᴇ....__**",
|
| 97 |
+
reply_to_message_id=message.id,
|
| 98 |
+
reply_markup=ForceReply(True)
|
| 99 |
+
)
|
| 100 |
+
except Exception as e:
|
| 101 |
+
print(f"Error in rename_start: {e}")
|
| 102 |
+
else:
|
| 103 |
+
if rkn_file.file_size > 2000 * 1024 * 1024 and client.premium:
|
| 104 |
+
return await message.reply_text("If you want to rename 4GB+ files then you will have to buy premium. /plans")
|
| 105 |
+
|
| 106 |
+
try:
|
| 107 |
+
await message.reply_text(
|
| 108 |
+
text=f"**__ᴍᴇᴅɪᴀ ɪɴꜰᴏ:\n\n◈ ᴏʟᴅ ꜰɪʟᴇ ɴᴀᴍᴇ: `{filename}`\n\n◈ ᴇxᴛᴇɴꜱɪᴏɴ: `{extension_type.upper()}`\n◈ ꜰɪʟᴇ ꜱɪᴢᴇ: `{filesize}`\n◈ ᴍɪᴍᴇ ᴛʏᴇᴩ: `{mime_type}`\n◈ ᴅᴄ ɪᴅ: `{dcid}`\n\nᴘʟᴇᴀsᴇ ᴇɴᴛᴇʀ ᴛʜᴇ ɴᴇᴡ ғɪʟᴇɴᴀᴍᴇ ᴡɪᴛʜ ᴇxᴛᴇɴsɪᴏɴ ᴀɴᴅ ʀᴇᴘʟʏ ᴛʜɪs ᴍᴇssᴀɢᴇ....__**",
|
| 109 |
+
reply_to_message_id=message.id,
|
| 110 |
+
reply_markup=ForceReply(True)
|
| 111 |
+
)
|
| 112 |
+
await asyncio.sleep(30)
|
| 113 |
+
except FloodWait as e:
|
| 114 |
+
await asyncio.sleep(e.value)
|
| 115 |
+
await message.reply_text(
|
| 116 |
+
text=f"**__ᴍᴇᴅɪᴀ ɪɴꜰᴏ:\n\n◈ ᴏʟᴅ ꜰɪʟᴇ ɴᴀᴍᴇ: `{filename}`\n\n◈ ᴇxᴛᴇɴꜱɪᴏɴ: `{extension_type.upper()}`\n◈ ꜰɪʟᴇ ꜱɪᴢᴇ: `{filesize}`\n◈ ᴍɪᴍᴇ ᴛʏᴇᴩ: `{mime_type}`\n◈ ᴅᴄ ɪᴅ: `{dcid}`\n\nᴘʟᴇᴀsᴇ ᴇɴᴛᴇʀ ᴛʜᴇ ɴᴇᴡ ғɪʟᴇɴᴀᴍᴇ ᴡɪᴛʜ ᴇxᴛᴇɴsɪᴏɴ ᴀɴᴅ ʀᴇᴘʟʏ ᴛʜɪs ᴍᴇssᴀɢᴇ....__**",
|
| 117 |
+
reply_to_message_id=message.id,
|
| 118 |
+
reply_markup=ForceReply(True)
|
| 119 |
+
)
|
| 120 |
+
except Exception as e:
|
| 121 |
+
print(f"Error in rename_start (non-premium): {e}")
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
@Client.on_message(filters.private & filters.reply)
|
| 125 |
+
async def refunc(client, message):
|
| 126 |
+
reply_message = message.reply_to_message
|
| 127 |
+
if (reply_message.reply_markup) and isinstance(reply_message.reply_markup, ForceReply):
|
| 128 |
+
new_name = message.text
|
| 129 |
+
await message.delete()
|
| 130 |
+
msg = await client.get_messages(message.chat.id, reply_message.id)
|
| 131 |
+
file = msg.reply_to_message
|
| 132 |
+
media = getattr(file, file.media.value)
|
| 133 |
+
if not "." in new_name:
|
| 134 |
+
if "." in media.file_name:
|
| 135 |
+
extn = media.file_name.rsplit('.', 1)[-1]
|
| 136 |
+
else:
|
| 137 |
+
extn = "mkv"
|
| 138 |
+
new_name = new_name + "." + extn
|
| 139 |
+
await reply_message.delete()
|
| 140 |
+
|
| 141 |
+
button = [[InlineKeyboardButton("📁 Dᴏᴄᴜᴍᴇɴᴛ",callback_data = "upload#document")]]
|
| 142 |
+
if file.media in [MessageMediaType.VIDEO, MessageMediaType.DOCUMENT]:
|
| 143 |
+
button.append([InlineKeyboardButton("🎥 Vɪᴅᴇᴏ", callback_data = "upload#video")])
|
| 144 |
+
elif file.media == MessageMediaType.AUDIO:
|
| 145 |
+
button.append([InlineKeyboardButton("🎵 Aᴜᴅɪᴏ", callback_data = "upload#audio")])
|
| 146 |
+
await message.reply(
|
| 147 |
+
text=f"**Sᴇʟᴇᴄᴛ Tʜᴇ Oᴜᴛᴩᴜᴛ Fɪʟᴇ Tyᴩᴇ**\n**• Fɪʟᴇ Nᴀᴍᴇ :-**`{new_name}`",
|
| 148 |
+
reply_to_message_id=file.id,
|
| 149 |
+
reply_markup=InlineKeyboardMarkup(button)
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
async def upload_files(bot, sender_id, upload_type, file_path, ph_path, caption, duration, rkn_processing):
|
| 153 |
+
"""
|
| 154 |
+
Unified function to upload files based on type
|
| 155 |
+
- Supports both 2GB and 4GB files
|
| 156 |
+
- Uses same function for all file sizes
|
| 157 |
+
- Handles document, video, and audio files
|
| 158 |
+
"""
|
| 159 |
+
try:
|
| 160 |
+
# Check if file exists
|
| 161 |
+
if not os.path.exists(file_path):
|
| 162 |
+
return None, f"File not found: {file_path}"
|
| 163 |
+
|
| 164 |
+
# Upload document files (2GB & 4GB)
|
| 165 |
+
if upload_type == "document":
|
| 166 |
+
filw = await bot.send_document(
|
| 167 |
+
sender_id,
|
| 168 |
+
document=file_path,
|
| 169 |
+
thumb=ph_path,
|
| 170 |
+
caption=caption,
|
| 171 |
+
progress=progress_for_pyrogram,
|
| 172 |
+
progress_args=(UPLOAD_TEXT, rkn_processing, time.time()))
|
| 173 |
+
|
| 174 |
+
# Upload video files (2GB & 4GB)
|
| 175 |
+
elif upload_type == "video":
|
| 176 |
+
filw = await bot.send_video(
|
| 177 |
+
sender_id,
|
| 178 |
+
video=file_path,
|
| 179 |
+
caption=caption,
|
| 180 |
+
thumb=ph_path,
|
| 181 |
+
duration=duration,
|
| 182 |
+
progress=progress_for_pyrogram,
|
| 183 |
+
progress_args=(UPLOAD_TEXT, rkn_processing, time.time()))
|
| 184 |
+
|
| 185 |
+
# Upload audio files (2GB & 4GB)
|
| 186 |
+
elif upload_type == "audio":
|
| 187 |
+
filw = await bot.send_audio(
|
| 188 |
+
sender_id,
|
| 189 |
+
audio=file_path,
|
| 190 |
+
caption=caption,
|
| 191 |
+
thumb=ph_path,
|
| 192 |
+
duration=duration,
|
| 193 |
+
progress=progress_for_pyrogram,
|
| 194 |
+
progress_args=(UPLOAD_TEXT, rkn_processing, time.time()))
|
| 195 |
+
else:
|
| 196 |
+
return None, f"Unknown upload type: {upload_type}"
|
| 197 |
+
|
| 198 |
+
# Return uploaded file object
|
| 199 |
+
return filw, None
|
| 200 |
+
|
| 201 |
+
except Exception as e:
|
| 202 |
+
# Return error if upload fails
|
| 203 |
+
return None, str(e)
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
#@Client.on_callback_query(filters.regex("upload"))
|
| 207 |
+
async def upload_doc(bot, update):
|
| 208 |
+
rkn_processing = await update.message.edit("`Processing...`")
|
| 209 |
+
|
| 210 |
+
# Creating Directory for Metadata
|
| 211 |
+
if not os.path.isdir("Metadata"):
|
| 212 |
+
os.mkdir("Metadata")
|
| 213 |
+
|
| 214 |
+
user_id = int(update.message.chat.id)
|
| 215 |
+
new_name = update.message.text
|
| 216 |
+
new_filename_ = new_name.split(":-")[1]
|
| 217 |
+
user_data = await digital_botz.get_user_data(user_id)
|
| 218 |
+
|
| 219 |
+
try:
|
| 220 |
+
# adding prefix and suffix
|
| 221 |
+
prefix = user_data.get('prefix', None)
|
| 222 |
+
suffix = user_data.get('suffix', None)
|
| 223 |
+
new_filename = await add_prefix_suffix(new_filename_, prefix, suffix)
|
| 224 |
+
except Exception as e:
|
| 225 |
+
return await rkn_processing.edit(f"⚠️ Something went wrong can't able to set Prefix or Suffix ☹️ \n\n❄️ Contact My Creator -> @RknDeveloperr\nError: {e}")
|
| 226 |
+
|
| 227 |
+
# msg file location
|
| 228 |
+
file = update.message.reply_to_message
|
| 229 |
+
media = getattr(file, file.media.value)
|
| 230 |
+
|
| 231 |
+
# File paths for download and metadata
|
| 232 |
+
file_path = f"Renames/{new_filename}"
|
| 233 |
+
metadata_path = f"Metadata/{new_filename}"
|
| 234 |
+
|
| 235 |
+
await rkn_processing.edit("`Try To Download....`")
|
| 236 |
+
if bot.premium and bot.uploadlimit:
|
| 237 |
+
limit = user_data.get('uploadlimit', 0)
|
| 238 |
+
used = user_data.get('used_limit', 0)
|
| 239 |
+
total_used = int(used) + int(media.file_size)
|
| 240 |
+
await digital_botz.set_used_limit(user_id, total_used)
|
| 241 |
+
|
| 242 |
+
try:
|
| 243 |
+
dl_path = await bot.download_media(message=file, file_name=file_path, progress=progress_for_pyrogram, progress_args=(DOWNLOAD_TEXT, rkn_processing, time.time()))
|
| 244 |
+
except Exception as e:
|
| 245 |
+
if bot.premium and bot.uploadlimit:
|
| 246 |
+
used_remove = int(used) - int(media.file_size)
|
| 247 |
+
await digital_botz.set_used_limit(user_id, used_remove)
|
| 248 |
+
return await rkn_processing.edit(f"Download Error: {e}")
|
| 249 |
+
|
| 250 |
+
metadata_mode = await digital_botz.get_metadata_mode(user_id)
|
| 251 |
+
if metadata_mode:
|
| 252 |
+
metadata = await digital_botz.get_metadata_code(user_id)
|
| 253 |
+
if metadata:
|
| 254 |
+
await rkn_processing.edit("I Fᴏᴜɴᴅ Yᴏᴜʀ Mᴇᴛᴀᴅᴀᴛᴀ\n\n__**Pʟᴇᴀsᴇ Wᴀɪᴛ...**__\n**Aᴅᴅɪɴɢ Mᴇᴛᴀᴅᴀᴛᴀ Tᴏ Fɪʟᴇ....**")
|
| 255 |
+
if await change_metadata(dl_path, metadata_path, metadata):
|
| 256 |
+
await rkn_processing.edit("Metadata Added.....")
|
| 257 |
+
print("Metadata Added.....")
|
| 258 |
+
else:
|
| 259 |
+
await rkn_processing.edit("Failed to add metadata, uploading original file...")
|
| 260 |
+
metadata_mode = False
|
| 261 |
+
else:
|
| 262 |
+
await rkn_processing.edit("No metadata found, uploading original file...")
|
| 263 |
+
metadata_mode = False
|
| 264 |
+
else:
|
| 265 |
+
await rkn_processing.edit("`Try To Uploading....`")
|
| 266 |
+
|
| 267 |
+
duration = 0
|
| 268 |
+
try:
|
| 269 |
+
parser = createParser(file_path)
|
| 270 |
+
metadata = extractMetadata(parser)
|
| 271 |
+
if metadata and metadata.has("duration"):
|
| 272 |
+
duration = metadata.get('duration').seconds
|
| 273 |
+
if parser:
|
| 274 |
+
parser.close()
|
| 275 |
+
except Exception as e:
|
| 276 |
+
print(f"Error extracting metadata: {e}")
|
| 277 |
+
pass
|
| 278 |
+
|
| 279 |
+
ph_path = None
|
| 280 |
+
c_caption = user_data.get('caption', None)
|
| 281 |
+
c_thumb = user_data.get('file_id', None)
|
| 282 |
+
|
| 283 |
+
if c_caption:
|
| 284 |
+
try:
|
| 285 |
+
# adding custom caption
|
| 286 |
+
caption = c_caption.format(filename=new_filename, filesize=humanbytes(media.file_size), duration=convert(duration))
|
| 287 |
+
except Exception as e:
|
| 288 |
+
if bot.premium and bot.uploadlimit:
|
| 289 |
+
used_remove = int(used) - int(media.file_size)
|
| 290 |
+
await digital_botz.set_used_limit(user_id, used_remove)
|
| 291 |
+
return await rkn_processing.edit(text=f"Yᴏᴜʀ Cᴀᴩᴛɪᴏɴ Eʀʀᴏʀ Exᴄᴇᴩᴛ Kᴇyᴡᴏʀᴅ Aʀɢᴜᴍᴇɴᴛ ●> ({e})")
|
| 292 |
+
else:
|
| 293 |
+
caption = f"**{new_filename}**"
|
| 294 |
+
|
| 295 |
+
if (media.thumbs or c_thumb):
|
| 296 |
+
# downloading thumbnail path
|
| 297 |
+
try:
|
| 298 |
+
if c_thumb:
|
| 299 |
+
ph_path = await bot.download_media(c_thumb)
|
| 300 |
+
else:
|
| 301 |
+
ph_path = await bot.download_media(media.thumbs[0].file_id)
|
| 302 |
+
|
| 303 |
+
if ph_path and os.path.exists(ph_path):
|
| 304 |
+
Image.open(ph_path).convert("RGB").save(ph_path)
|
| 305 |
+
img = Image.open(ph_path)
|
| 306 |
+
img.resize((320, 320))
|
| 307 |
+
img.save(ph_path, "JPEG")
|
| 308 |
+
except Exception as e:
|
| 309 |
+
print(f"Error processing thumbnail: {e}")
|
| 310 |
+
ph_path = None
|
| 311 |
+
|
| 312 |
+
upload_type = update.data.split("#")[1]
|
| 313 |
+
|
| 314 |
+
# Use the correct file path based on metadata mode
|
| 315 |
+
final_file_path = metadata_path if metadata_mode and os.path.exists(metadata_path) else file_path
|
| 316 |
+
|
| 317 |
+
if media.file_size > 2000 * 1024 * 1024:
|
| 318 |
+
# Upload file using unified function for large files
|
| 319 |
+
filw, error = await upload_files(
|
| 320 |
+
app, Config.LOG_CHANNEL, upload_type, final_file_path,
|
| 321 |
+
ph_path, caption, duration, rkn_processing
|
| 322 |
+
)
|
| 323 |
+
|
| 324 |
+
if error:
|
| 325 |
+
if bot.premium and bot.uploadlimit:
|
| 326 |
+
used_remove = int(used) - int(media.file_size)
|
| 327 |
+
await digital_botz.set_used_limit(user_id, used_remove)
|
| 328 |
+
await remove_path(ph_path, file_path, dl_path, metadata_path)
|
| 329 |
+
return await rkn_processing.edit(f"Upload Error: {error}")
|
| 330 |
+
|
| 331 |
+
|
| 332 |
+
from_chat = filw.chat.id
|
| 333 |
+
mg_id = filw.id
|
| 334 |
+
await asyncio.sleep(2)
|
| 335 |
+
await bot.copy_message(update.from_user.id, from_chat, mg_id)
|
| 336 |
+
await bot.delete_messages(from_chat, mg_id)
|
| 337 |
+
|
| 338 |
+
else:
|
| 339 |
+
# Upload file using unified function for regular files
|
| 340 |
+
filw, error = await upload_files(
|
| 341 |
+
bot, update.message.chat.id, upload_type, final_file_path,
|
| 342 |
+
ph_path, caption, duration, rkn_processing
|
| 343 |
+
)
|
| 344 |
+
|
| 345 |
+
if error:
|
| 346 |
+
if bot.premium and bot.uploadlimit:
|
| 347 |
+
used_remove = int(used) - int(media.file_size)
|
| 348 |
+
await digital_botz.set_used_limit(user_id, used_remove)
|
| 349 |
+
await remove_path(ph_path, file_path, dl_path, metadata_path)
|
| 350 |
+
return await rkn_processing.edit(f"Upload Error: {error}")
|
| 351 |
+
|
| 352 |
+
# Clean up files
|
| 353 |
+
await remove_path(ph_path, file_path, dl_path, metadata_path)
|
| 354 |
+
return await rkn_processing.edit("Uploaded Successfully....")
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
# @RknDeveloper
|
| 359 |
+
# ✅ Team-RknDeveloper
|
| 360 |
+
# Rkn Developer
|
| 361 |
+
# Don't Remove Credit 😔
|
| 362 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 363 |
+
# Developer @RknDeveloperr
|
| 364 |
+
# Special Thanks To @ReshamOwner
|
| 365 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/force_sub.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Apache License 2.0
|
| 3 |
+
Copyright (c) 2022 @Digital_Botz
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
The above copyright notice and this permission notice shall be included in all
|
| 12 |
+
copies or substantial portions of the Software.
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 19 |
+
|
| 20 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 21 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 22 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
# pyrogram imports
|
| 26 |
+
from pyrogram import Client, filters, enums
|
| 27 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
| 28 |
+
from pyrogram.errors import UserNotParticipant
|
| 29 |
+
|
| 30 |
+
# extra imports
|
| 31 |
+
from config import Config
|
| 32 |
+
from helper.database import digital_botz
|
| 33 |
+
import datetime
|
| 34 |
+
|
| 35 |
+
async def not_subscribed(_, client, message):
|
| 36 |
+
await digital_botz.add_user(client, message)
|
| 37 |
+
if not Config.FORCE_SUB:
|
| 38 |
+
return False
|
| 39 |
+
|
| 40 |
+
try:
|
| 41 |
+
user = await client.get_chat_member(Config.FORCE_SUB, message.from_user.id)
|
| 42 |
+
return user.status not in [enums.ChatMemberStatus.MEMBER, enums.ChatMemberStatus.ADMINISTRATOR, enums.ChatMemberStatus.OWNER]
|
| 43 |
+
except UserNotParticipant:
|
| 44 |
+
return True
|
| 45 |
+
except Exception as e:
|
| 46 |
+
print(f"Error checking subscription: {e}")
|
| 47 |
+
return False
|
| 48 |
+
|
| 49 |
+
async def handle_banned_user_status(bot, message):
|
| 50 |
+
await digital_botz.add_user(bot, message)
|
| 51 |
+
user_id = message.from_user.id
|
| 52 |
+
ban_status = await digital_botz.get_ban_status(user_id)
|
| 53 |
+
if ban_status.get("is_banned", False):
|
| 54 |
+
if ( datetime.date.today() - datetime.date.fromisoformat(ban_status["banned_on"])
|
| 55 |
+
).days > ban_status["ban_duration"]:
|
| 56 |
+
await digital_botz.remove_ban(user_id)
|
| 57 |
+
else:
|
| 58 |
+
return await message.reply_text("Sorry Sir, 😔 You are Banned!.. Please Contact - @DigitalBotz")
|
| 59 |
+
await message.continue_propagation()
|
| 60 |
+
|
| 61 |
+
async def forces_sub(client, message):
|
| 62 |
+
buttons = [[InlineKeyboardButton(text="📢 Join Update Channel 📢", url=f"https://t.me/{Config.FORCE_SUB}")]]
|
| 63 |
+
text = "**Sᴏʀʀy Dᴜᴅᴇ Yᴏᴜ'ʀᴇ Nᴏᴛ Jᴏɪɴᴇᴅ My Cʜᴀɴɴᴇʟ 😐. Sᴏ Pʟᴇᴀꜱᴇ Jᴏɪɴ Oᴜʀ Uᴩᴅᴀᴛᴇ Cʜᴀɴɴᴇʟ Tᴏ Cᴄᴏɴᴛɪɴᴜᴇ**"
|
| 64 |
+
|
| 65 |
+
try:
|
| 66 |
+
user = await client.get_chat_member(Config.FORCE_SUB, message.from_user.id)
|
| 67 |
+
if user.status == enums.ChatMemberStatus.BANNED:
|
| 68 |
+
return await message.reply_text("Sᴏʀʀy Yᴏᴜ'ʀᴇ Bᴀɴɴᴇᴅ Tᴏ Uꜱᴇ Mᴇ")
|
| 69 |
+
elif user.status not in [enums.ChatMemberStatus.MEMBER, enums.ChatMemberStatus.ADMINISTRATOR]:
|
| 70 |
+
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
|
| 71 |
+
except UserNotParticipant:
|
| 72 |
+
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
|
| 73 |
+
return await message.reply_text(text=text, reply_markup=InlineKeyboardMarkup(buttons))
|
| 74 |
+
|
| 75 |
+
# (c) @RknDeveloperr
|
| 76 |
+
# Rkn Developer
|
| 77 |
+
# Don't Remove Credit 😔
|
| 78 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 79 |
+
# Developer @RknDeveloperr
|
| 80 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/metadata.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# pyrogram imports
|
| 33 |
+
from pyrogram import Client, filters
|
| 34 |
+
from pyrogram.types import Message, CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup
|
| 35 |
+
from pyrogram.errors import ListenerTimeout
|
| 36 |
+
|
| 37 |
+
# extra imports
|
| 38 |
+
from helper.database import digital_botz
|
| 39 |
+
from config import rkn
|
| 40 |
+
|
| 41 |
+
TRUE = [[InlineKeyboardButton('ᴍᴇᴛᴀᴅᴀᴛᴀ ᴏɴ', callback_data='metadata_1'),
|
| 42 |
+
InlineKeyboardButton('✅', callback_data='metadata_1')
|
| 43 |
+
],[
|
| 44 |
+
InlineKeyboardButton('Sᴇᴛ Cᴜsᴛᴏᴍ Mᴇᴛᴀᴅᴀᴛᴀ', callback_data='cutom_metadata')]]
|
| 45 |
+
FALSE = [[InlineKeyboardButton('ᴍᴇᴛᴀᴅᴀᴛᴀ ᴏғғ', callback_data='metadata_0'),
|
| 46 |
+
InlineKeyboardButton('❌', callback_data='metadata_0')
|
| 47 |
+
],[
|
| 48 |
+
InlineKeyboardButton('Sᴇᴛ Cᴜsᴛᴏᴍ Mᴇᴛᴀᴅᴀᴛᴀ', callback_data='cutom_metadata')]]
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
@Client.on_message(filters.private & filters.command('metadata'))
|
| 52 |
+
async def handle_metadata(bot: Client, message: Message):
|
| 53 |
+
RknDev = await message.reply_text("**Please Wait...**", reply_to_message_id=message.id)
|
| 54 |
+
bool_metadata = await digital_botz.get_metadata_mode(message.from_user.id)
|
| 55 |
+
user_metadata = await digital_botz.get_metadata_code(message.from_user.id)
|
| 56 |
+
|
| 57 |
+
await RknDev.edit(
|
| 58 |
+
f"Your Current Metadata:-\n\n➜ `{user_metadata}`",
|
| 59 |
+
reply_markup=InlineKeyboardMarkup(TRUE if bool_metadata else FALSE)
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
@Client.on_callback_query(filters.regex('.*?(custom_metadata|metadata).*?'))
|
| 64 |
+
async def query_metadata(bot: Client, query: CallbackQuery):
|
| 65 |
+
data = query.data
|
| 66 |
+
if data.startswith('metadata_'):
|
| 67 |
+
_bool = data.split('_')[1]
|
| 68 |
+
user_metadata = await digital_botz.get_metadata_code(query.from_user.id)
|
| 69 |
+
bool_meta = bool(eval(_bool))
|
| 70 |
+
await digital_botz.set_metadata_mode(query.from_user.id, bool_meta=not bool_meta)
|
| 71 |
+
await query.message.edit(f"Your Current Metadata:-\n\n➜ `{user_metadata}`", reply_markup=InlineKeyboardMarkup(FALSE if bool_meta else TRUE))
|
| 72 |
+
|
| 73 |
+
elif data == 'cutom_metadata':
|
| 74 |
+
await query.message.delete()
|
| 75 |
+
try:
|
| 76 |
+
metadata = await bot.ask(text=rkn.SEND_METADATA, chat_id=query.from_user.id, filters=filters.text, timeout=30, disable_web_page_preview=True)
|
| 77 |
+
RknDev = await query.message.reply_text("**Please Wait...**", reply_to_message_id=metadata.id)
|
| 78 |
+
await digital_botz.set_metadata_code(query.from_user.id, metadata_code=metadata.text)
|
| 79 |
+
await RknDev.edit("**Your Metadata Code Set Successfully ✅**")
|
| 80 |
+
except ListenerTimeout:
|
| 81 |
+
await query.message.reply_text("⚠️ Error!!\n\n**Request timed out.**\nRestart by using /metadata", reply_to_message_id=query.message.id)
|
| 82 |
+
except Exception as e:
|
| 83 |
+
print(e)
|
| 84 |
+
|
| 85 |
+
# Rkn Developer
|
| 86 |
+
# Don't Remove Credit 😔
|
| 87 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 88 |
+
# Developer @RknDeveloperr
|
| 89 |
+
# Special Thanks To @ReshamOwner
|
| 90 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/prefix_and_suffix.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# imports
|
| 33 |
+
from pyrogram import Client, filters, enums
|
| 34 |
+
from helper.database import digital_botz
|
| 35 |
+
|
| 36 |
+
# prefix commond ✨
|
| 37 |
+
@Client.on_message(filters.private & filters.command('set_prefix'))
|
| 38 |
+
async def add_prefix(client, message):
|
| 39 |
+
if len(message.command) == 1:
|
| 40 |
+
return await message.reply_text("**__Give The Prefix__\n\nExᴀᴍᴩʟᴇ:- `/set_prefix @Rkn_Bots_Updates`**")
|
| 41 |
+
prefix = message.text.split(" ", 1)[1]
|
| 42 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 43 |
+
await digital_botz.set_prefix(message.from_user.id, prefix)
|
| 44 |
+
await RknDev.edit("__**✅ ᴘʀᴇꜰɪx ꜱᴀᴠᴇᴅ**__")
|
| 45 |
+
|
| 46 |
+
@Client.on_message(filters.private & filters.command('del_prefix'))
|
| 47 |
+
async def delete_prefix(client, message):
|
| 48 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 49 |
+
prefix = await digital_botz.get_prefix(message.from_user.id)
|
| 50 |
+
if not prefix:
|
| 51 |
+
return await RknDev.edit("__**😔 ʏᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴʏ ᴘʀᴇꜰɪx**__")
|
| 52 |
+
await digital_botz.set_prefix(message.from_user.id, None)
|
| 53 |
+
await RknDev.edit("__**❌️ ᴘʀᴇꜰɪx ᴅᴇʟᴇᴛᴇᴅ**__")
|
| 54 |
+
|
| 55 |
+
@Client.on_message(filters.private & filters.command('see_prefix'))
|
| 56 |
+
async def see_prefix(client, message):
|
| 57 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 58 |
+
prefix = await digital_botz.get_prefix(message.from_user.id)
|
| 59 |
+
if prefix:
|
| 60 |
+
await RknDev.edit(f"**ʏᴏᴜʀ ᴘʀᴇꜰɪx:-**\n\n`{prefix}`")
|
| 61 |
+
else:
|
| 62 |
+
await RknDev.edit("__**😔 ʏᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴʏ ᴘʀᴇꜰɪx**__")
|
| 63 |
+
|
| 64 |
+
# SUFFIX COMMOND ✨
|
| 65 |
+
@Client.on_message(filters.private & filters.command('set_suffix'))
|
| 66 |
+
async def add_suffix(client, message):
|
| 67 |
+
if len(message.command) == 1:
|
| 68 |
+
return await message.reply_text("**__Give The Suffix__\n\nExᴀᴍᴩʟᴇ:- `/set_suffix @Rkn_Bots_Updates`**")
|
| 69 |
+
suffix = message.text.split(" ", 1)[1]
|
| 70 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 71 |
+
await digital_botz.set_suffix(message.from_user.id, suffix)
|
| 72 |
+
await RknDev.edit("__**✅ ꜱᴜꜰꜰɪx ꜱᴀᴠᴇᴅ**__")
|
| 73 |
+
|
| 74 |
+
@Client.on_message(filters.private & filters.command('del_suffix'))
|
| 75 |
+
async def delete_suffix(client, message):
|
| 76 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 77 |
+
suffix = await digital_botz.get_suffix(message.from_user.id)
|
| 78 |
+
if not suffix:
|
| 79 |
+
return await RknDev.edit("__**😔 ʏᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴʏ ꜱᴜꜰꜰɪx**__")
|
| 80 |
+
await digital_botz.set_suffix(message.from_user.id, None)
|
| 81 |
+
await RknDev.edit("__**❌️ ꜱᴜꜰꜰɪx ᴅᴇʟᴇᴛᴇᴅ**__")
|
| 82 |
+
|
| 83 |
+
@Client.on_message(filters.private & filters.command('see_suffix'))
|
| 84 |
+
async def see_suffix(client, message):
|
| 85 |
+
RknDev = await message.reply_text("Please Wait ...", reply_to_message_id=message.id)
|
| 86 |
+
suffix = await digital_botz.get_suffix(message.from_user.id)
|
| 87 |
+
if suffix:
|
| 88 |
+
await RknDev.edit(f"**ʏᴏᴜʀ ꜱᴜꜰꜰɪx:-**\n\n`{suffix}`")
|
| 89 |
+
else:
|
| 90 |
+
await RknDev.edit("__**😔 ʏᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀɴʏ ꜱᴜꜰꜰɪx**__")
|
| 91 |
+
|
| 92 |
+
# Rkn Developer
|
| 93 |
+
# Don't Remove Credit 😔
|
| 94 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 95 |
+
# Developer @RknDeveloperr
|
| 96 |
+
# Special Thanks To @ReshamOwner
|
| 97 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/start_and_cb.py
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# extra imports
|
| 33 |
+
import random, asyncio, datetime, pytz, time, psutil, shutil
|
| 34 |
+
|
| 35 |
+
# pyrogram imports
|
| 36 |
+
from pyrogram import Client, filters
|
| 37 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, ForceReply, CallbackQuery
|
| 38 |
+
|
| 39 |
+
# bots imports
|
| 40 |
+
from helper.database import digital_botz
|
| 41 |
+
from config import Config, rkn
|
| 42 |
+
from helper.utils import humanbytes
|
| 43 |
+
from plugins import __version__ as _bot_version_, __developer__, __database__, __library__, __language__, __programer__
|
| 44 |
+
from plugins.file_rename import upload_doc
|
| 45 |
+
|
| 46 |
+
upgrade_button = InlineKeyboardMarkup([[
|
| 47 |
+
InlineKeyboardButton('buy premium ✓', user_id=int(6705898491)),
|
| 48 |
+
],[
|
| 49 |
+
InlineKeyboardButton("Bᴀᴄᴋ", callback_data = "start")
|
| 50 |
+
]])
|
| 51 |
+
|
| 52 |
+
upgrade_trial_button = InlineKeyboardMarkup([[
|
| 53 |
+
InlineKeyboardButton('buy premium ✓', user_id=int(6705898491)),
|
| 54 |
+
],[
|
| 55 |
+
InlineKeyboardButton("ᴛʀɪᴀʟ - 𝟷𝟸 ʜᴏᴜʀs ✓", callback_data = "give_trial"),
|
| 56 |
+
InlineKeyboardButton("Bᴀᴄᴋ", callback_data = "start")
|
| 57 |
+
]])
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
@Client.on_message(filters.private & filters.command("start"))
|
| 62 |
+
async def start(client, message):
|
| 63 |
+
start_button = [[
|
| 64 |
+
InlineKeyboardButton('Uᴩᴅᴀ𝚃ᴇꜱ', url='https://t.me/Digital_Botz'),
|
| 65 |
+
InlineKeyboardButton('Sᴜᴩᴩᴏʀ𝚃', url='https://t.me/DigitalBotz_Support')
|
| 66 |
+
],[
|
| 67 |
+
InlineKeyboardButton('Aʙᴏυᴛ', callback_data='about'),
|
| 68 |
+
InlineKeyboardButton('Hᴇʟᴩ', callback_data='help')
|
| 69 |
+
]]
|
| 70 |
+
|
| 71 |
+
if client.premium:
|
| 72 |
+
start_button.append([InlineKeyboardButton('💸 ᴜᴘɢʀᴀᴅᴇ ᴛᴏ ᴘʀᴇᴍɪᴜᴍ 💸', callback_data='upgrade')])
|
| 73 |
+
|
| 74 |
+
user = message.from_user
|
| 75 |
+
await digital_botz.add_user(client, message)
|
| 76 |
+
if Config.RKN_PIC:
|
| 77 |
+
await message.reply_photo(Config.RKN_PIC, caption=rkn.START_TXT.format(user.mention), reply_markup=InlineKeyboardMarkup(start_button))
|
| 78 |
+
else:
|
| 79 |
+
await message.reply_text(text=rkn.START_TXT.format(user.mention), reply_markup=InlineKeyboardMarkup(start_button), disable_web_page_preview=True)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
@Client.on_message(filters.private & filters.command("myplan"))
|
| 83 |
+
async def myplan(client, message):
|
| 84 |
+
if not client.premium:
|
| 85 |
+
return # premium mode disabled ✓
|
| 86 |
+
|
| 87 |
+
user_id = message.from_user.id
|
| 88 |
+
user = message.from_user.mention
|
| 89 |
+
|
| 90 |
+
if await digital_botz.has_premium_access(user_id):
|
| 91 |
+
data = await digital_botz.get_user(user_id)
|
| 92 |
+
expiry_str_in_ist = data.get("expiry_time")
|
| 93 |
+
time_left_str = expiry_str_in_ist - datetime.datetime.now()
|
| 94 |
+
|
| 95 |
+
text = f"ᴜꜱᴇʀ :- {user}\nᴜꜱᴇʀ ɪᴅ :- <code>{user_id}</code>\n"
|
| 96 |
+
|
| 97 |
+
if client.uploadlimit:
|
| 98 |
+
await digital_botz.reset_uploadlimit_access(user_id)
|
| 99 |
+
user_data = await digital_botz.get_user_data(user_id)
|
| 100 |
+
limit = user_data.get('uploadlimit', 0)
|
| 101 |
+
used = user_data.get('used_limit', 0)
|
| 102 |
+
remain = int(limit) - int(used)
|
| 103 |
+
type = user_data.get('usertype', "Free")
|
| 104 |
+
|
| 105 |
+
text += f"ᴘʟᴀɴ :- `{type}`\nᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ ʟɪᴍɪᴛ :- `{humanbytes(limit)}`\nᴛᴏᴅᴀʏ ᴜsᴇᴅ :- `{humanbytes(used)}`\nʀᴇᴍᴀɪɴ :- `{humanbytes(remain)}`\n"
|
| 106 |
+
|
| 107 |
+
text += f"ᴛɪᴍᴇ ʟᴇꜰᴛ : {time_left_str}\nᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}"
|
| 108 |
+
|
| 109 |
+
await message.reply_text(text, quote=True)
|
| 110 |
+
|
| 111 |
+
else:
|
| 112 |
+
if client.uploadlimit:
|
| 113 |
+
user_data = await digital_botz.get_user_data(user_id)
|
| 114 |
+
limit = user_data.get('uploadlimit', 0)
|
| 115 |
+
used = user_data.get('used_limit', 0)
|
| 116 |
+
remain = int(limit) - int(used)
|
| 117 |
+
type = user_data.get('usertype', "Free")
|
| 118 |
+
|
| 119 |
+
text = f"ᴜꜱᴇʀ :- {user}\nᴜꜱᴇʀ ɪᴅ :- <code>{user_id}</code>\nᴘʟᴀɴ :- `{type}`\nᴅᴀɪʟʏ ᴜᴘʟᴏᴀᴅ ʟɪᴍɪᴛ :- `{humanbytes(limit)}`\nᴛᴏᴅᴀʏ ᴜsᴇᴅ :- `{humanbytes(used)}`\nʀᴇᴍᴀɪɴ :- `{humanbytes(remain)}`\nᴇxᴘɪʀᴇᴅ ᴅᴀᴛᴇ :- ʟɪғᴇᴛɪᴍᴇ\n\nɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴛᴀᴋᴇ ᴘʀᴇᴍɪᴜᴍ ᴛʜᴇɴ ᴄʟɪᴄᴋ ᴏɴ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ 👇"
|
| 120 |
+
|
| 121 |
+
await message.reply_text(text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💸 ᴄʜᴇᴄᴋᴏᴜᴛ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴꜱ 💸", callback_data='upgrade')]]), quote=True)
|
| 122 |
+
|
| 123 |
+
else:
|
| 124 |
+
m=await message.reply_sticker("CAACAgIAAxkBAAIBTGVjQbHuhOiboQsDm35brLGyLQ28AAJ-GgACglXYSXgCrotQHjibHgQ")
|
| 125 |
+
await message.reply_text(f"ʜᴇʏ {user},\n\nʏᴏᴜ ᴅᴏ ɴᴏᴛ ʜᴀᴠᴇ ᴀɴʏ ᴀᴄᴛɪᴠᴇ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴs, ɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴛᴀᴋᴇ ᴘʀᴇᴍɪᴜᴍ ᴛʜᴇɴ ᴄʟɪᴄᴋ ᴏɴ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ 👇",
|
| 126 |
+
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💸 ᴄʜᴇᴄᴋᴏᴜᴛ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴꜱ 💸", callback_data='upgrade')]]))
|
| 127 |
+
await asyncio.sleep(2)
|
| 128 |
+
await m.delete()
|
| 129 |
+
|
| 130 |
+
@Client.on_message(filters.private & filters.command("plans"))
|
| 131 |
+
async def plans(client, message):
|
| 132 |
+
if not client.premium:
|
| 133 |
+
return # premium mode disabled ✓
|
| 134 |
+
|
| 135 |
+
user = message.from_user
|
| 136 |
+
upgrade_msg = rkn.UPGRADE_PLAN.format(user.mention) if client.uploadlimit else rkn.UPGRADE_PREMIUM.format(user.mention)
|
| 137 |
+
|
| 138 |
+
free_trial_status = await digital_botz.get_free_trial_status(user.id)
|
| 139 |
+
if not await digital_botz.has_premium_access(user.id):
|
| 140 |
+
if not free_trial_status:
|
| 141 |
+
await message.reply_text(text=upgrade_msg, reply_markup=upgrade_trial_button, disable_web_page_preview=True)
|
| 142 |
+
else:
|
| 143 |
+
await message.reply_text(text=upgrade_msg, reply_markup=upgrade_button, disable_web_page_preview=True)
|
| 144 |
+
else:
|
| 145 |
+
await message.reply_text(text=upgrade_msg, reply_markup=upgrade_button, disable_web_page_preview=True)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
@Client.on_callback_query()
|
| 149 |
+
async def cb_handler(client, query: CallbackQuery):
|
| 150 |
+
data = query.data
|
| 151 |
+
if data == "start":
|
| 152 |
+
start_button = [[
|
| 153 |
+
InlineKeyboardButton('Uᴩᴅᴀ𝚃ᴇꜱ', url='https://t.me/Digital_Botz'),
|
| 154 |
+
InlineKeyboardButton('Sᴜᴩᴩᴏʀ𝚃', url='https://t.me/DigitalBotz_Support')
|
| 155 |
+
],[
|
| 156 |
+
InlineKeyboardButton('Aʙᴏυᴛ', callback_data='about'),
|
| 157 |
+
InlineKeyboardButton('Hᴇʟᴩ', callback_data='help')
|
| 158 |
+
]]
|
| 159 |
+
|
| 160 |
+
if client.premium:
|
| 161 |
+
start_button.append([InlineKeyboardButton('💸 ᴜᴘɢʀᴀᴅᴇ ᴛᴏ ᴘʀᴇᴍɪᴜᴍ 💸', callback_data='upgrade')])
|
| 162 |
+
|
| 163 |
+
await query.message.edit_text(
|
| 164 |
+
text=rkn.START_TXT.format(query.from_user.mention),
|
| 165 |
+
disable_web_page_preview=True,
|
| 166 |
+
reply_markup = InlineKeyboardMarkup(start_button))
|
| 167 |
+
|
| 168 |
+
elif data == "help":
|
| 169 |
+
await query.message.edit_text(
|
| 170 |
+
text=rkn.HELP_TXT,
|
| 171 |
+
disable_web_page_preview=True,
|
| 172 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 173 |
+
#⚠️ don't change source code & source link ⚠️ #
|
| 174 |
+
InlineKeyboardButton("ᴛʜᴜᴍʙɴᴀɪʟ", callback_data = "thumbnail"),
|
| 175 |
+
InlineKeyboardButton("ᴄᴀᴘᴛɪᴏɴ", callback_data = "caption")
|
| 176 |
+
],[
|
| 177 |
+
InlineKeyboardButton("ᴄᴜsᴛᴏᴍ ғɪʟᴇ ɴᴀᴍᴇ", callback_data = "custom_file_name")
|
| 178 |
+
],[
|
| 179 |
+
InlineKeyboardButton("ᴀʙᴏᴜᴛ", callback_data = "about"),
|
| 180 |
+
InlineKeyboardButton("ᴍᴇᴛᴀᴅᴀᴛᴀ", callback_data = "digital_meta_data")
|
| 181 |
+
],[
|
| 182 |
+
InlineKeyboardButton("Bᴀᴄᴋ", callback_data = "start")
|
| 183 |
+
]]))
|
| 184 |
+
|
| 185 |
+
elif data == "about":
|
| 186 |
+
about_button = [[
|
| 187 |
+
#⚠️ don't change source code & source link ⚠️ #
|
| 188 |
+
InlineKeyboardButton("𝚂ᴏᴜʀᴄᴇ", callback_data = "source_code"), #Whoever is deploying this repo is given a warning ⚠️ not to remove this repo link #first & last warning ⚠️
|
| 189 |
+
InlineKeyboardButton("ʙᴏᴛ sᴛᴀᴛᴜs", callback_data = "bot_status")
|
| 190 |
+
],[
|
| 191 |
+
InlineKeyboardButton("ʟɪᴠᴇ sᴛᴀᴛᴜs", callback_data = "live_status")
|
| 192 |
+
]]
|
| 193 |
+
if client.premium:
|
| 194 |
+
about_button[-1].append(InlineKeyboardButton("ᴜᴘɢʀᴀᴅᴇ", callback_data = "upgrade"))
|
| 195 |
+
about_button.append([InlineKeyboardButton("Bᴀᴄᴋ", callback_data = "start")])
|
| 196 |
+
else:
|
| 197 |
+
about_button[-1].append(InlineKeyboardButton("Bᴀᴄᴋ", callback_data = "start"))
|
| 198 |
+
|
| 199 |
+
await query.message.edit_text(
|
| 200 |
+
text=rkn.ABOUT_TXT.format(client.mention, __developer__, __programer__, __library__, __language__, __database__, _bot_version_),
|
| 201 |
+
disable_web_page_preview = True,
|
| 202 |
+
reply_markup=InlineKeyboardMarkup(about_button))
|
| 203 |
+
|
| 204 |
+
elif data == "upgrade":
|
| 205 |
+
if not client.premium:
|
| 206 |
+
return await query.message.delete()
|
| 207 |
+
|
| 208 |
+
user = query.from_user
|
| 209 |
+
upgrade_msg = rkn.UPGRADE_PLAN.format(user.mention) if client.uploadlimit else rkn.UPGRADE_PREMIUM.format(user.mention)
|
| 210 |
+
|
| 211 |
+
free_trial_status = await digital_botz.get_free_trial_status(query.from_user.id)
|
| 212 |
+
if not await digital_botz.has_premium_access(query.from_user.id):
|
| 213 |
+
if not free_trial_status:
|
| 214 |
+
await query.message.edit_text(text=upgrade_msg, disable_web_page_preview=True, reply_markup=upgrade_trial_button)
|
| 215 |
+
else:
|
| 216 |
+
await query.message.edit_text(text=upgrade_msg, disable_web_page_preview=True, reply_markup=upgrade_button)
|
| 217 |
+
else:
|
| 218 |
+
await query.message.edit_text(text=upgrade_msg, disable_web_page_preview=True, reply_markup=upgrade_button)
|
| 219 |
+
|
| 220 |
+
elif data == "give_trial":
|
| 221 |
+
if not client.premium:
|
| 222 |
+
return await query.message.delete()
|
| 223 |
+
|
| 224 |
+
await query.message.delete()
|
| 225 |
+
free_trial_status = await digital_botz.get_free_trial_status(query.from_user.id)
|
| 226 |
+
if not free_trial_status:
|
| 227 |
+
await digital_botz.give_free_trial(query.from_user.id)
|
| 228 |
+
new_text = "**ʏᴏᴜʀ ᴘʀᴇᴍɪᴜᴍ ᴛʀɪᴀʟ ʜᴀs ʙᴇᴇɴ ᴀᴅᴅᴇᴅ ғᴏʀ 𝟷𝟸 ʜᴏᴜʀs.\n\nʏᴏᴜ ᴄᴀɴ ᴜsᴇ ꜰʀᴇᴇ ᴛʀᴀɪʟ ꜰᴏʀ 𝟷𝟸 ʜᴏᴜʀs ꜰʀᴏᴍ ɴᴏᴡ 😀\n\nआप अब से 𝟷𝟸 घण्टा के लिए निःशुल्क ट्रायल का उपयोग कर सकते हैं 😀**"
|
| 229 |
+
else:
|
| 230 |
+
new_text = "**🤣 ʏᴏᴜ ᴀʟʀᴇᴀᴅʏ ᴜsᴇᴅ ғʀᴇᴇ ɴᴏᴡ ɴᴏ ᴍᴏʀᴇ ғʀᴇᴇ ᴛʀᴀɪʟ. ᴘʟᴇᴀsᴇ ʙᴜʏ sᴜʙsᴄʀɪᴘᴛɪᴏɴ ʜᴇʀᴇ ᴀʀᴇ ᴏᴜʀ 👉 /plans**"
|
| 231 |
+
await client.send_message(query.from_user.id, text=new_text)
|
| 232 |
+
|
| 233 |
+
elif data == "thumbnail":
|
| 234 |
+
await query.message.edit_text(
|
| 235 |
+
text=rkn.THUMBNAIL,
|
| 236 |
+
disable_web_page_preview=True,
|
| 237 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 238 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "help")]]))
|
| 239 |
+
|
| 240 |
+
elif data == "caption":
|
| 241 |
+
await query.message.edit_text(
|
| 242 |
+
text=rkn.CAPTION,
|
| 243 |
+
disable_web_page_preview=True,
|
| 244 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 245 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "help")]]))
|
| 246 |
+
|
| 247 |
+
elif data == "custom_file_name":
|
| 248 |
+
await query.message.edit_text(
|
| 249 |
+
text=rkn.CUSTOM_FILE_NAME,
|
| 250 |
+
disable_web_page_preview=True,
|
| 251 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 252 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "help")]]))
|
| 253 |
+
|
| 254 |
+
elif data == "digital_meta_data":
|
| 255 |
+
await query.message.edit_text(
|
| 256 |
+
text=rkn.DIGITAL_METADATA,
|
| 257 |
+
disable_web_page_preview=True,
|
| 258 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 259 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "help")]]))
|
| 260 |
+
|
| 261 |
+
elif data == "bot_status":
|
| 262 |
+
total_users = await digital_botz.total_users_count()
|
| 263 |
+
if client.premium:
|
| 264 |
+
total_premium_users = await digital_botz.total_premium_users_count()
|
| 265 |
+
else:
|
| 266 |
+
total_premium_users = "Disabled ✅"
|
| 267 |
+
|
| 268 |
+
uptime = time.strftime("%Hh%Mm%Ss", time.gmtime(time.time() - client.uptime))
|
| 269 |
+
sent = humanbytes(psutil.net_io_counters().bytes_sent)
|
| 270 |
+
recv = humanbytes(psutil.net_io_counters().bytes_recv)
|
| 271 |
+
await query.message.edit_text(
|
| 272 |
+
text=rkn.BOT_STATUS.format(uptime, total_users, total_premium_users, sent, recv),
|
| 273 |
+
disable_web_page_preview=True,
|
| 274 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 275 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "about")]]))
|
| 276 |
+
|
| 277 |
+
elif data == "live_status":
|
| 278 |
+
currentTime = time.strftime("%Hh%Mm%Ss", time.gmtime(time.time() - client.uptime))
|
| 279 |
+
total, used, free = shutil.disk_usage(".")
|
| 280 |
+
total = humanbytes(total)
|
| 281 |
+
used = humanbytes(used)
|
| 282 |
+
free = humanbytes(free)
|
| 283 |
+
sent = humanbytes(psutil.net_io_counters().bytes_sent)
|
| 284 |
+
recv = humanbytes(psutil.net_io_counters().bytes_recv)
|
| 285 |
+
cpu_usage = psutil.cpu_percent()
|
| 286 |
+
ram_usage = psutil.virtual_memory().percent
|
| 287 |
+
disk_usage = psutil.disk_usage('/').percent
|
| 288 |
+
await query.message.edit_text(
|
| 289 |
+
text=rkn.LIVE_STATUS.format(currentTime, cpu_usage, ram_usage, total, used, disk_usage, free, sent, recv),
|
| 290 |
+
disable_web_page_preview=True,
|
| 291 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 292 |
+
InlineKeyboardButton(" Bᴀᴄᴋ", callback_data = "about")]]))
|
| 293 |
+
|
| 294 |
+
elif data == "source_code":
|
| 295 |
+
await query.message.edit_text(
|
| 296 |
+
text=rkn.DEV_TXT,
|
| 297 |
+
disable_web_page_preview=True,
|
| 298 |
+
reply_markup=InlineKeyboardMarkup([[
|
| 299 |
+
#⚠️ don't change source code & source link ⚠️ #
|
| 300 |
+
#Whoever is deploying this repo is given a warning ⚠️ not to remove this repo link #first & last warning ⚠️
|
| 301 |
+
InlineKeyboardButton("💞 Sᴏᴜʀᴄᴇ Cᴏᴅᴇ 💞", url="https://github.com/DigitalBotz/Digital-Rename-Bot")
|
| 302 |
+
],[
|
| 303 |
+
InlineKeyboardButton("🔒 Cʟᴏꜱᴇ", callback_data = "close"),
|
| 304 |
+
InlineKeyboardButton("◀️ Bᴀᴄᴋ", callback_data = "start")
|
| 305 |
+
]])
|
| 306 |
+
)
|
| 307 |
+
|
| 308 |
+
elif data.startswith("upload"):
|
| 309 |
+
await upload_doc(client, query)
|
| 310 |
+
|
| 311 |
+
elif data == "close":
|
| 312 |
+
try:
|
| 313 |
+
await query.message.delete()
|
| 314 |
+
await query.message.reply_to_message.delete()
|
| 315 |
+
await query.message.continue_propagation()
|
| 316 |
+
except:
|
| 317 |
+
await query.message.delete()
|
| 318 |
+
await query.message.continue_propagation()
|
| 319 |
+
|
| 320 |
+
# (c) @RknDeveloperr
|
| 321 |
+
# Rkn Developer
|
| 322 |
+
# Don't Remove Credit 😔
|
| 323 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 324 |
+
# Developer @RknDeveloperr
|
| 325 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/thumb_and_cap.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz & @Rkn_Bots_Updates
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# imports
|
| 33 |
+
from pyrogram import Client, filters
|
| 34 |
+
from helper.database import digital_botz
|
| 35 |
+
|
| 36 |
+
@Client.on_message(filters.private & filters.command('set_caption'))
|
| 37 |
+
async def add_caption(client, message):
|
| 38 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 39 |
+
if len(message.command) == 1:
|
| 40 |
+
return await rkn.edit("**__Gɪᴠᴇ Tʜᴇ Cᴀᴩᴛɪᴏɴ__\n\nExᴀᴍᴩʟᴇ:- `/set_caption {filename}\n\n💾 Sɪᴢᴇ: {filesize}\n\n⏰ Dᴜʀᴀᴛɪᴏɴ: {duration}\n\bBy: @Rkn_Bots_Updates`**")
|
| 41 |
+
caption = message.text.split(" ", 1)[1]
|
| 42 |
+
await digital_botz.set_caption(message.from_user.id, caption=caption)
|
| 43 |
+
await rkn.edit("__**✅ Cᴀᴩᴛɪᴏɴ Sᴀᴠᴇᴅ**__")
|
| 44 |
+
|
| 45 |
+
@Client.on_message(filters.private & filters.command(['del_caption', 'delete_caption', 'delcaption']))
|
| 46 |
+
async def delete_caption(client, message):
|
| 47 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 48 |
+
caption = await digital_botz.get_caption(message.from_user.id)
|
| 49 |
+
if not caption:
|
| 50 |
+
return await rkn.edit("__**😔 Yᴏᴜ Dᴏɴ'ᴛ Hᴀᴠᴇ Aɴy Cᴀᴩᴛɪᴏɴ**__")
|
| 51 |
+
await digital_botz.set_caption(message.from_user.id, caption=None)
|
| 52 |
+
await rkn.edit("__**❌️ Cᴀᴩᴛɪᴏɴ Dᴇʟᴇᴛᴇᴅ**__")
|
| 53 |
+
|
| 54 |
+
@Client.on_message(filters.private & filters.command(['see_caption', 'view_caption']))
|
| 55 |
+
async def see_caption(client, message):
|
| 56 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 57 |
+
caption = await digital_botz.get_caption(message.from_user.id)
|
| 58 |
+
if caption:
|
| 59 |
+
await rkn.edit(f"**Yᴏᴜ'ʀᴇ Cᴀᴩᴛɪᴏɴ:-**\n\n`{caption}`")
|
| 60 |
+
else:
|
| 61 |
+
await rkn.edit("__**😔 Yᴏᴜ Dᴏɴ'ᴛ Hᴀᴠᴇ Aɴy Cᴀᴩᴛɪᴏɴ**__")
|
| 62 |
+
|
| 63 |
+
@Client.on_message(filters.private & filters.command(['view_thumb', 'viewthumb']))
|
| 64 |
+
async def viewthumb(client, message):
|
| 65 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 66 |
+
thumb = await digital_botz.get_thumbnail(message.from_user.id)
|
| 67 |
+
if thumb:
|
| 68 |
+
await client.send_photo(chat_id=message.chat.id, photo=thumb)
|
| 69 |
+
await rkn.delete()
|
| 70 |
+
else:
|
| 71 |
+
await rkn.edit("😔 __**Yᴏᴜ Dᴏɴ'ᴛ Hᴀᴠᴇ Aɴy Tʜᴜᴍʙɴᴀɪʟ**__")
|
| 72 |
+
|
| 73 |
+
@Client.on_message(filters.private & filters.command(['del_thumb', 'delete_thumb', 'delthumb']))
|
| 74 |
+
async def removethumb(client, message):
|
| 75 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 76 |
+
thumb = await digital_botz.get_thumbnail(message.from_user.id)
|
| 77 |
+
if thumb:
|
| 78 |
+
await digital_botz.set_thumbnail(message.from_user.id, file_id=None)
|
| 79 |
+
await rkn.edit("❌️ __**Tʜᴜᴍʙɴᴀɪʟ Dᴇʟᴇᴛᴇᴅ**__")
|
| 80 |
+
return
|
| 81 |
+
await rkn.edit("😔 __**Yᴏᴜ Dᴏɴ'ᴛ Hᴀᴠᴇ Aɴy Tʜᴜᴍʙɴᴀɪʟ**__")
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
@Client.on_message(filters.private & filters.photo)
|
| 85 |
+
async def addthumbs(client, message):
|
| 86 |
+
rkn = await message.reply_text("__**ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ**__")
|
| 87 |
+
await digital_botz.set_thumbnail(message.from_user.id, file_id=message.photo.file_id)
|
| 88 |
+
await rkn.edit("✅️ __**Tʜᴜᴍʙɴᴀɪʟ Sᴀᴠᴇᴅ**__")
|
| 89 |
+
|
| 90 |
+
# (c) @RknDeveloperr
|
| 91 |
+
# Rkn Developer
|
| 92 |
+
# Don't Remove Credit 😔
|
| 93 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 94 |
+
# Developer @RknDeveloperr
|
| 95 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
plugins/web_support.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# (c) @RknDeveloperr
|
| 2 |
+
# Rkn Developer
|
| 3 |
+
# Don't Remove Credit 😔
|
| 4 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 5 |
+
# Developer @RknDeveloperr
|
| 6 |
+
# Special Thanks To @ReshamOwner
|
| 7 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
| 8 |
+
"""
|
| 9 |
+
Apache License 2.0
|
| 10 |
+
Copyright (c) 2022 @Digital_Botz
|
| 11 |
+
|
| 12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 14 |
+
in the Software without restriction, including without limitation the rights
|
| 15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 16 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
furnished to do so, subject to the following conditions:
|
| 18 |
+
The above copyright notice and this permission notice shall be included in all
|
| 19 |
+
copies or substantial portions of the Software.
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
+
|
| 27 |
+
Telegram Link : https://t.me/Digital_Botz
|
| 28 |
+
Repo Link : https://github.com/DigitalBotz/Digital-Rename-Bot
|
| 29 |
+
License Link : https://github.com/DigitalBotz/Digital-Rename-Bot/blob/main/LICENSE
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
from aiohttp import web
|
| 33 |
+
import json
|
| 34 |
+
import time
|
| 35 |
+
import psutil
|
| 36 |
+
import shutil
|
| 37 |
+
import os
|
| 38 |
+
import base64
|
| 39 |
+
from config import Config
|
| 40 |
+
from plugins import __version__
|
| 41 |
+
from helper.utils import humanbytes
|
| 42 |
+
from helper.database import digital_botz
|
| 43 |
+
|
| 44 |
+
# Ensure templates directory exists
|
| 45 |
+
os.makedirs('templates', exist_ok=True)
|
| 46 |
+
|
| 47 |
+
async def get_status():
|
| 48 |
+
# Calculate your bot status metrics
|
| 49 |
+
total_users = await digital_botz.total_users_count()
|
| 50 |
+
if Config.PREMIUM_MODE:
|
| 51 |
+
total_premium_users = await digital_botz.total_premium_users_count()
|
| 52 |
+
else:
|
| 53 |
+
total_premium_users = "Disabled ✅"
|
| 54 |
+
|
| 55 |
+
currentTime = time.strftime("%Hh%Mm%Ss", time.gmtime(time.time() - Config.BOT_UPTIME))
|
| 56 |
+
total, used, free = shutil.disk_usage(".")
|
| 57 |
+
total = humanbytes(total)
|
| 58 |
+
used = humanbytes(used)
|
| 59 |
+
free = humanbytes(free)
|
| 60 |
+
sent = humanbytes(psutil.net_io_counters().bytes_sent)
|
| 61 |
+
recv = humanbytes(psutil.net_io_counters().bytes_recv)
|
| 62 |
+
cpu_usage = psutil.cpu_percent()
|
| 63 |
+
ram_usage = psutil.virtual_memory().percent
|
| 64 |
+
disk_usage = psutil.disk_usage('/').percent
|
| 65 |
+
|
| 66 |
+
return {
|
| 67 |
+
"status": "Operational",
|
| 68 |
+
"version": __version__,
|
| 69 |
+
"total_users": total_users,
|
| 70 |
+
"total_premium_users": total_premium_users,
|
| 71 |
+
"uptime": currentTime,
|
| 72 |
+
"cpu_usage": cpu_usage,
|
| 73 |
+
"ram_usage": ram_usage,
|
| 74 |
+
"disk_usage": disk_usage,
|
| 75 |
+
"total_disk": total,
|
| 76 |
+
"used_disk": used,
|
| 77 |
+
"free_disk": free,
|
| 78 |
+
"sent": sent,
|
| 79 |
+
"recv": recv
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
DigitalRenameBot = web.RouteTableDef()
|
| 83 |
+
|
| 84 |
+
@DigitalRenameBot.get("/", allow_head=True)
|
| 85 |
+
async def root_route_handler(request):
|
| 86 |
+
# Get real-time status data - CORRECTED: use get_status() instead of get_bot_status() and get_live_status()
|
| 87 |
+
status_data = await get_status()
|
| 88 |
+
|
| 89 |
+
# Render template with actual data
|
| 90 |
+
with open('templates/welcome.html', 'r', encoding='utf-8') as f:
|
| 91 |
+
template_content = f.read()
|
| 92 |
+
|
| 93 |
+
# Replace placeholders with actual data - CORRECTED: use status_data dictionary
|
| 94 |
+
html_content = template_content
|
| 95 |
+
html_content = html_content.replace('{{bot_status}}', status_data['status'])
|
| 96 |
+
html_content = html_content.replace('{{bot_version}}', status_data['version'])
|
| 97 |
+
html_content = html_content.replace('{{total_users}}', str(status_data['total_users']))
|
| 98 |
+
html_content = html_content.replace('{{premium_users}}', str(status_data['total_premium_users']))
|
| 99 |
+
html_content = html_content.replace('{{bot_uptime}}', status_data['uptime'])
|
| 100 |
+
html_content = html_content.replace('{{data_sent}}', status_data['sent'])
|
| 101 |
+
html_content = html_content.replace('{{data_recv}}', status_data['recv'])
|
| 102 |
+
|
| 103 |
+
html_content = html_content.replace('{{system_uptime}}', status_data['uptime'])
|
| 104 |
+
html_content = html_content.replace('{{cpu_usage}}', str(status_data['cpu_usage']))
|
| 105 |
+
html_content = html_content.replace('{{ram_usage}}', str(status_data['ram_usage']))
|
| 106 |
+
html_content = html_content.replace('{{disk_usage}}', str(status_data['disk_usage']))
|
| 107 |
+
html_content = html_content.replace('{{total_disk}}', status_data['total_disk'])
|
| 108 |
+
html_content = html_content.replace('{{used_disk}}', status_data['used_disk'])
|
| 109 |
+
html_content = html_content.replace('{{free_disk}}', status_data['free_disk'])
|
| 110 |
+
html_content = html_content.replace('{{system_sent}}', status_data['sent'])
|
| 111 |
+
html_content = html_content.replace('{{system_recv}}', status_data['recv'])
|
| 112 |
+
|
| 113 |
+
# Add current timestamp for cache busting
|
| 114 |
+
html_content = html_content.replace('{{timestamp}}', str(int(time.time())))
|
| 115 |
+
|
| 116 |
+
return web.Response(text=html_content, content_type='text/html')
|
| 117 |
+
|
| 118 |
+
async def web_server():
|
| 119 |
+
web_app = web.Application(client_max_size=30000000)
|
| 120 |
+
web_app.add_routes(DigitalRenameBot)
|
| 121 |
+
return web_app
|
| 122 |
+
|
| 123 |
+
# Rkn Developer
|
| 124 |
+
# Don't Remove Credit 😔
|
| 125 |
+
# Telegram Channel @RknDeveloper & @Rkn_Botz
|
| 126 |
+
# Developer @RknDeveloperr
|
| 127 |
+
# Update Channel @Digital_Botz & @DigitalBotz_Support
|
render.yaml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
- type: web
|
| 3 |
+
plan: free
|
| 4 |
+
name: Digital-test
|
| 5 |
+
env: python
|
| 6 |
+
buildCommand: pip install -r requirements.txt
|
| 7 |
+
startCommand: python3 bot.py
|
| 8 |
+
repo: https://github.com/DigitalBotz/Digital-test.git
|
| 9 |
+
branch: main
|
| 10 |
+
autoDeploy: false
|
| 11 |
+
envVars:
|
| 12 |
+
- key: PYTHON_VERSION
|
| 13 |
+
value: 3.11.9
|
| 14 |
+
- key: BOT_TOKEN
|
| 15 |
+
sync: false
|
| 16 |
+
- key: API_ID
|
| 17 |
+
sync: false
|
| 18 |
+
- key: API_HASH
|
| 19 |
+
sync: false
|
| 20 |
+
- key: FORCE_SUB
|
| 21 |
+
sync: false
|
| 22 |
+
- key: LOG_CHANNEL
|
| 23 |
+
sync: false
|
| 24 |
+
- key: DB_NAME
|
| 25 |
+
sync: false
|
| 26 |
+
- key: DB_URL
|
| 27 |
+
sync: false
|
| 28 |
+
- key: RKN_PIC
|
| 29 |
+
sync: false
|
| 30 |
+
- key: ADMIN
|
| 31 |
+
sync: false
|
| 32 |
+
- key: STRING_SESSION
|
| 33 |
+
sync: false
|
| 34 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pyrofork==2.3.69
|
| 2 |
+
TgCrypto-pyrofork==1.2.8
|
| 3 |
+
motor==3.7.1
|
| 4 |
+
dnspython==2.8.0
|
| 5 |
+
hachoir==3.3.0
|
| 6 |
+
Pillow==12.1.0
|
| 7 |
+
aiohttp==3.13.3
|
| 8 |
+
pytz==2025.2
|
| 9 |
+
psutil==7.2.1
|
| 10 |
+
ffmpeg-python
|
| 11 |
+
ffmpeg
|
runtime.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
python-3.13
|
templates/welcome.html
ADDED
|
@@ -0,0 +1,619 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Digital Botz ™- Bot Status</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 8 |
+
<style>
|
| 9 |
+
/* Base styles */
|
| 10 |
+
* {
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 0;
|
| 13 |
+
box-sizing: border-box;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
body, html {
|
| 17 |
+
height: 100%;
|
| 18 |
+
font-family: 'Orbitron', 'Courier New', monospace;
|
| 19 |
+
background: #0a0a16;
|
| 20 |
+
color: #ffffff;
|
| 21 |
+
overflow-x: hidden;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/* Background effects */
|
| 25 |
+
.background {
|
| 26 |
+
position: fixed;
|
| 27 |
+
top: 0;
|
| 28 |
+
left: 0;
|
| 29 |
+
width: 100%;
|
| 30 |
+
height: 100%;
|
| 31 |
+
z-index: -1;
|
| 32 |
+
overflow: hidden;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
.grid-lines {
|
| 36 |
+
position: absolute;
|
| 37 |
+
top: 0;
|
| 38 |
+
left: 0;
|
| 39 |
+
width: 100%;
|
| 40 |
+
height: 100%;
|
| 41 |
+
background-image:
|
| 42 |
+
linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
|
| 43 |
+
linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
|
| 44 |
+
background-size: 40px 40px;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.glow-effect {
|
| 48 |
+
position: absolute;
|
| 49 |
+
width: 400px;
|
| 50 |
+
height: 400px;
|
| 51 |
+
border-radius: 50%;
|
| 52 |
+
background: radial-gradient(circle, rgba(0, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
|
| 53 |
+
top: 20%;
|
| 54 |
+
left: 10%;
|
| 55 |
+
animation: float 15s infinite ease-in-out;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.glow-effect-2 {
|
| 59 |
+
position: absolute;
|
| 60 |
+
width: 300px;
|
| 61 |
+
height: 300px;
|
| 62 |
+
border-radius: 50%;
|
| 63 |
+
background: radial-gradient(circle, rgba(255, 0, 128, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
|
| 64 |
+
bottom: 10%;
|
| 65 |
+
right: 10%;
|
| 66 |
+
animation: float 12s infinite ease-in-out reverse;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
@keyframes float {
|
| 70 |
+
0%, 100% { transform: translate(0, 0) rotate(0deg); }
|
| 71 |
+
25% { transform: translate(20px, 30px) rotate(5deg); }
|
| 72 |
+
50% { transform: translate(-15px, 20px) rotate(-5deg); }
|
| 73 |
+
75% { transform: translate(10px, -15px) rotate(3deg); }
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/* Loading Animation Styles */
|
| 77 |
+
.loading-screen {
|
| 78 |
+
position: fixed;
|
| 79 |
+
top: 0;
|
| 80 |
+
left: 0;
|
| 81 |
+
width: 100%;
|
| 82 |
+
height: 100%;
|
| 83 |
+
background: #0a0a16;
|
| 84 |
+
display: flex;
|
| 85 |
+
flex-direction: column;
|
| 86 |
+
justify-content: center;
|
| 87 |
+
align-items: center;
|
| 88 |
+
z-index: 9999;
|
| 89 |
+
transition: opacity 0.5s ease;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.loading-logo {
|
| 93 |
+
font-size: 3rem;
|
| 94 |
+
font-weight: 900;
|
| 95 |
+
text-transform: uppercase;
|
| 96 |
+
letter-spacing: 4px;
|
| 97 |
+
background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00, #00ff00);
|
| 98 |
+
background-size: 300% 300%;
|
| 99 |
+
-webkit-background-clip: text;
|
| 100 |
+
-webkit-text-fill-color: transparent;
|
| 101 |
+
animation: gradientShift 4s ease infinite;
|
| 102 |
+
margin-bottom: 2rem;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.loading-spinner {
|
| 106 |
+
width: 50px;
|
| 107 |
+
height: 50px;
|
| 108 |
+
border: 3px solid rgba(0, 255, 255, 0.3);
|
| 109 |
+
border-top: 3px solid #00ffff;
|
| 110 |
+
border-radius: 50%;
|
| 111 |
+
animation: spin 1s linear infinite;
|
| 112 |
+
margin-bottom: 1rem;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.loading-text {
|
| 116 |
+
color: #00ffff;
|
| 117 |
+
font-size: 1rem;
|
| 118 |
+
letter-spacing: 2px;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
@keyframes spin {
|
| 122 |
+
0% { transform: rotate(0deg); }
|
| 123 |
+
100% { transform: rotate(360deg); }
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/* Main container */
|
| 127 |
+
.container {
|
| 128 |
+
display: flex;
|
| 129 |
+
flex-direction: column;
|
| 130 |
+
justify-content: center;
|
| 131 |
+
align-items: center;
|
| 132 |
+
min-height: 100vh;
|
| 133 |
+
padding: 2rem;
|
| 134 |
+
position: relative;
|
| 135 |
+
z-index: 1;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/* Logo and branding */
|
| 139 |
+
.logo-container {
|
| 140 |
+
margin-bottom: 2rem;
|
| 141 |
+
text-align: center;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.logo {
|
| 145 |
+
font-size: 4.5rem;
|
| 146 |
+
font-weight: 900;
|
| 147 |
+
text-transform: uppercase;
|
| 148 |
+
letter-spacing: 6px;
|
| 149 |
+
background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00, #00ff00);
|
| 150 |
+
background-size: 300% 300%;
|
| 151 |
+
-webkit-background-clip: text;
|
| 152 |
+
-webkit-text-fill-color: transparent;
|
| 153 |
+
animation: gradientShift 4s ease infinite, glitch 2s infinite;
|
| 154 |
+
position: relative;
|
| 155 |
+
margin-bottom: 0.5rem;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.tagline {
|
| 159 |
+
font-size: 1.2rem;
|
| 160 |
+
color: #00ffff;
|
| 161 |
+
letter-spacing: 3px;
|
| 162 |
+
text-transform: uppercase;
|
| 163 |
+
font-weight: 300;
|
| 164 |
+
margin-top: 0.5rem;
|
| 165 |
+
text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
/* Status panels container */
|
| 169 |
+
.panels-container {
|
| 170 |
+
display: flex;
|
| 171 |
+
flex-wrap: wrap;
|
| 172 |
+
gap: 2rem;
|
| 173 |
+
justify-content: center;
|
| 174 |
+
width: 100%;
|
| 175 |
+
max-width: 1200px;
|
| 176 |
+
margin: 2rem 0;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/* Status panel */
|
| 180 |
+
.status-panel {
|
| 181 |
+
background: rgba(10, 15, 30, 0.7);
|
| 182 |
+
backdrop-filter: blur(10px);
|
| 183 |
+
border: 1px solid rgba(0, 255, 255, 0.3);
|
| 184 |
+
border-radius: 15px;
|
| 185 |
+
padding: 2rem;
|
| 186 |
+
flex: 1;
|
| 187 |
+
min-width: 300px;
|
| 188 |
+
max-width: 500px;
|
| 189 |
+
box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
|
| 190 |
+
position: relative;
|
| 191 |
+
overflow: hidden;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
.status-panel::before {
|
| 195 |
+
content: '';
|
| 196 |
+
position: absolute;
|
| 197 |
+
top: 0;
|
| 198 |
+
left: 0;
|
| 199 |
+
width: 100%;
|
| 200 |
+
height: 3px;
|
| 201 |
+
background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00);
|
| 202 |
+
animation: gradientShift 3s ease infinite;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
.status-header {
|
| 206 |
+
display: flex;
|
| 207 |
+
align-items: center;
|
| 208 |
+
justify-content: space-between;
|
| 209 |
+
margin-bottom: 1.5rem;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
.status-title {
|
| 213 |
+
font-size: 1.8rem;
|
| 214 |
+
font-weight: 700;
|
| 215 |
+
text-transform: uppercase;
|
| 216 |
+
letter-spacing: 2px;
|
| 217 |
+
color: #ffffff;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.live-indicator {
|
| 221 |
+
display: flex;
|
| 222 |
+
align-items: center;
|
| 223 |
+
background: rgba(0, 255, 0, 0.2);
|
| 224 |
+
padding: 0.4rem 1rem;
|
| 225 |
+
border-radius: 20px;
|
| 226 |
+
border: 1px solid rgba(0, 255, 0, 0.5);
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.pulse {
|
| 230 |
+
width: 12px;
|
| 231 |
+
height: 12px;
|
| 232 |
+
background: #00ff00;
|
| 233 |
+
border-radius: 50%;
|
| 234 |
+
margin-right: 8px;
|
| 235 |
+
animation: pulse 2s infinite;
|
| 236 |
+
box-shadow: 0 0 10px #00ff00;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
@keyframes pulse {
|
| 240 |
+
0% { transform: scale(0.9); opacity: 1; }
|
| 241 |
+
50% { transform: scale(1.2); opacity: 0.7; }
|
| 242 |
+
100% { transform: scale(0.9); opacity: 1; }
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.status-details {
|
| 246 |
+
display: grid;
|
| 247 |
+
grid-template-columns: 1fr 1fr;
|
| 248 |
+
gap: 1.5rem;
|
| 249 |
+
margin-bottom: 1.5rem;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
.status-item {
|
| 253 |
+
background: rgba(0, 20, 40, 0.5);
|
| 254 |
+
padding: 1rem;
|
| 255 |
+
border-radius: 10px;
|
| 256 |
+
border-left: 3px solid #00ffff;
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
.status-label {
|
| 260 |
+
font-size: 0.9rem;
|
| 261 |
+
color: #88ffff;
|
| 262 |
+
margin-bottom: 0.5rem;
|
| 263 |
+
text-transform: uppercase;
|
| 264 |
+
letter-spacing: 1px;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
.status-value {
|
| 268 |
+
font-size: 1.2rem;
|
| 269 |
+
font-weight: 700;
|
| 270 |
+
color: #ffffff;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.status-uptime {
|
| 274 |
+
background: rgba(0, 20, 40, 0.5);
|
| 275 |
+
padding: 1rem;
|
| 276 |
+
border-radius: 10px;
|
| 277 |
+
border-left: 3px solid #ff00ff;
|
| 278 |
+
margin-top: 1rem;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
/* System stats */
|
| 282 |
+
.system-stats {
|
| 283 |
+
display: grid;
|
| 284 |
+
grid-template-columns: 1fr 1fr;
|
| 285 |
+
gap: 1.5rem;
|
| 286 |
+
margin-top: 1.5rem;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
.system-item {
|
| 290 |
+
background: rgba(0, 20, 40, 0.5);
|
| 291 |
+
padding: 1rem;
|
| 292 |
+
border-radius: 10px;
|
| 293 |
+
border-left: 3px solid #ffff00;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
/* Progress bars */
|
| 297 |
+
.progress-container {
|
| 298 |
+
margin-top: 0.5rem;
|
| 299 |
+
height: 8px;
|
| 300 |
+
background: rgba(255, 255, 255, 0.1);
|
| 301 |
+
border-radius: 4px;
|
| 302 |
+
overflow: hidden;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
.progress-bar {
|
| 306 |
+
height: 100%;
|
| 307 |
+
border-radius: 4px;
|
| 308 |
+
transition: width 0.5s ease;
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
.cpu-progress {
|
| 312 |
+
background: linear-gradient(90deg, #ff00ff, #ff5500);
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
.ram-progress {
|
| 316 |
+
background: linear-gradient(90deg, #00ffff, #00ff00);
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
.disk-progress {
|
| 320 |
+
background: linear-gradient(90deg, #ffff00, #ffaa00);
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
/* Action buttons */
|
| 324 |
+
.actions {
|
| 325 |
+
display: flex;
|
| 326 |
+
justify-content: center;
|
| 327 |
+
gap: 1.5rem;
|
| 328 |
+
margin-top: 2rem;
|
| 329 |
+
flex-wrap: wrap;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
.btn {
|
| 333 |
+
display: inline-flex;
|
| 334 |
+
align-items: center;
|
| 335 |
+
justify-content: center;
|
| 336 |
+
padding: 0.9rem 1.8rem;
|
| 337 |
+
font-size: 1rem;
|
| 338 |
+
font-weight: 600;
|
| 339 |
+
color: white;
|
| 340 |
+
text-transform: uppercase;
|
| 341 |
+
text-decoration: none;
|
| 342 |
+
border-radius: 50px;
|
| 343 |
+
background: linear-gradient(90deg, #6a11cb, #2575fc);
|
| 344 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
| 345 |
+
transition: all 0.3s ease;
|
| 346 |
+
position: relative;
|
| 347 |
+
overflow: hidden;
|
| 348 |
+
letter-spacing: 1px;
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
.btn::before {
|
| 352 |
+
content: '';
|
| 353 |
+
position: absolute;
|
| 354 |
+
top: 0;
|
| 355 |
+
left: -100%;
|
| 356 |
+
width: 100%;
|
| 357 |
+
height: 100%;
|
| 358 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
| 359 |
+
transition: 0.5s;
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
.btn:hover::before {
|
| 363 |
+
left: 100%;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
.btn:hover {
|
| 367 |
+
transform: translateY(-5px);
|
| 368 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
.btn-telegram {
|
| 372 |
+
background: linear-gradient(90deg, #0088cc, #34b7f1);
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.btn-github {
|
| 376 |
+
background: linear-gradient(90deg, #333, #6e5494);
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.btn i {
|
| 380 |
+
margin-right: 8px;
|
| 381 |
+
font-size: 1.2rem;
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
/* Animations */
|
| 385 |
+
@keyframes gradientShift {
|
| 386 |
+
0% { background-position: 0% 50%; }
|
| 387 |
+
50% { background-position: 100% 50%; }
|
| 388 |
+
100% { background-position: 0% 50%; }
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
@keyframes glitch {
|
| 392 |
+
0% {
|
| 393 |
+
text-shadow: 2px 2px 0px #ff00ff, -2px -2px 0px #00ffff;
|
| 394 |
+
}
|
| 395 |
+
25% {
|
| 396 |
+
text-shadow: -2px -2px 0px #ff00ff, 2px 2px 0px #00ffff;
|
| 397 |
+
}
|
| 398 |
+
50% {
|
| 399 |
+
text-shadow: 2px -2px 0px #ff00ff, -2px 2px 0px #00ffff;
|
| 400 |
+
}
|
| 401 |
+
75% {
|
| 402 |
+
text-shadow: -2px 2px 0px #ff00ff, 2px -2px 0px #00ffff;
|
| 403 |
+
}
|
| 404 |
+
100% {
|
| 405 |
+
text-shadow: 2px 2px 0px #ff00ff, -2px -2px 0px #00ffff;
|
| 406 |
+
}
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
/* Footer */
|
| 410 |
+
.footer {
|
| 411 |
+
margin-top: 3rem;
|
| 412 |
+
text-align: center;
|
| 413 |
+
color: #88ffff;
|
| 414 |
+
font-size: 0.9rem;
|
| 415 |
+
letter-spacing: 1px;
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
.footer a {
|
| 419 |
+
color: #ff00ff;
|
| 420 |
+
text-decoration: none;
|
| 421 |
+
transition: color 0.3s;
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
.footer a:hover {
|
| 425 |
+
color: #ffff00;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
/* Responsive Design */
|
| 429 |
+
@media (max-width: 768px) {
|
| 430 |
+
.logo {
|
| 431 |
+
font-size: 3.5rem;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
.status-details, .system-stats {
|
| 435 |
+
grid-template-columns: 1fr;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
.actions {
|
| 439 |
+
flex-direction: column;
|
| 440 |
+
align-items: center;
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
.btn {
|
| 444 |
+
width: 100%;
|
| 445 |
+
max-width: 250px;
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
@media (max-width: 480px) {
|
| 450 |
+
.logo {
|
| 451 |
+
font-size: 2.5rem;
|
| 452 |
+
letter-spacing: 3px;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
.tagline {
|
| 456 |
+
font-size: 1rem;
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
.status-panel {
|
| 460 |
+
padding: 1.5rem;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
.status-title {
|
| 464 |
+
font-size: 1.5rem;
|
| 465 |
+
}
|
| 466 |
+
}
|
| 467 |
+
</style>
|
| 468 |
+
</head>
|
| 469 |
+
<body>
|
| 470 |
+
<!-- Loading Screen -->
|
| 471 |
+
<div class="loading-screen" id="loadingScreen">
|
| 472 |
+
<div class="loading-logo">Digital Botz ™</div>
|
| 473 |
+
<div class="loading-spinner"></div>
|
| 474 |
+
<div class="loading-text">Initializing Status Dashboard...</div>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<!-- Background effects -->
|
| 478 |
+
<div class="background">
|
| 479 |
+
<div class="grid-lines"></div>
|
| 480 |
+
<div class="glow-effect"></div>
|
| 481 |
+
<div class="glow-effect-2"></div>
|
| 482 |
+
</div>
|
| 483 |
+
|
| 484 |
+
<!-- Main Content -->
|
| 485 |
+
<div class="container">
|
| 486 |
+
<div class="logo-container">
|
| 487 |
+
<div class="logo">Digital Botz ™</div>
|
| 488 |
+
<div class="tagline">Advanced Automation Solutions</div>
|
| 489 |
+
</div>
|
| 490 |
+
|
| 491 |
+
<div class="panels-container">
|
| 492 |
+
<!-- Bot Status Panel -->
|
| 493 |
+
<div class="status-panel">
|
| 494 |
+
<div class="status-header">
|
| 495 |
+
<div class="status-title">Bot Status</div>
|
| 496 |
+
<div class="live-indicator">
|
| 497 |
+
<div class="pulse"></div>
|
| 498 |
+
<span>LIVE</span>
|
| 499 |
+
</div>
|
| 500 |
+
</div>
|
| 501 |
+
|
| 502 |
+
<div class="status-details">
|
| 503 |
+
<div class="status-item">
|
| 504 |
+
<div class="status-label">Status</div>
|
| 505 |
+
<div class="status-value">{{bot_status}}</div>
|
| 506 |
+
</div>
|
| 507 |
+
<div class="status-item">
|
| 508 |
+
<div class="status-label">Version</div>
|
| 509 |
+
<div class="status-value">{{bot_version}}</div>
|
| 510 |
+
</div>
|
| 511 |
+
<div class="status-item">
|
| 512 |
+
<div class="status-label">Users</div>
|
| 513 |
+
<div class="status-value">{{total_users}}</div>
|
| 514 |
+
</div>
|
| 515 |
+
<div class="status-item">
|
| 516 |
+
<div class="status-label">Premium Users</div>
|
| 517 |
+
<div class="status-value">{{premium_users}}</div>
|
| 518 |
+
</div>
|
| 519 |
+
</div>
|
| 520 |
+
|
| 521 |
+
<div class="status-uptime">
|
| 522 |
+
<div class="status-label">Uptime</div>
|
| 523 |
+
<div class="status-value">{{bot_uptime}}</div>
|
| 524 |
+
</div>
|
| 525 |
+
</div>
|
| 526 |
+
|
| 527 |
+
<!-- System Status Panel -->
|
| 528 |
+
<div class="status-panel">
|
| 529 |
+
<div class="status-header">
|
| 530 |
+
<div class="status-title">System Status</div>
|
| 531 |
+
<div class="live-indicator">
|
| 532 |
+
<div class="pulse"></div>
|
| 533 |
+
<span>LIVE</span>
|
| 534 |
+
</div>
|
| 535 |
+
</div>
|
| 536 |
+
|
| 537 |
+
<div class="status-details">
|
| 538 |
+
<div class="status-item">
|
| 539 |
+
<div class="status-label">Uptime</div>
|
| 540 |
+
<div class="status-value">{{system_uptime}}</div>
|
| 541 |
+
</div>
|
| 542 |
+
<div class="status-item">
|
| 543 |
+
<div class="status-label">CPU Usage</div>
|
| 544 |
+
<div class="status-value">{{cpu_usage}}%</div>
|
| 545 |
+
<div class="progress-container">
|
| 546 |
+
<div class="progress-bar cpu-progress" style="width: {{cpu_usage}}%"></div>
|
| 547 |
+
</div>
|
| 548 |
+
</div>
|
| 549 |
+
<div class="status-item">
|
| 550 |
+
<div class="status-label">RAM Usage</div>
|
| 551 |
+
<div class="status-value">{{ram_usage}}%</div>
|
| 552 |
+
<div class="progress-container">
|
| 553 |
+
<div class="progress-bar ram-progress" style="width: {{ram_usage}}%"></div>
|
| 554 |
+
</div>
|
| 555 |
+
</div>
|
| 556 |
+
<div class="status-item">
|
| 557 |
+
<div class="status-label">Disk Usage</div>
|
| 558 |
+
<div class="status-value">{{disk_usage}}%</div>
|
| 559 |
+
<div class="progress-container">
|
| 560 |
+
<div class="progress-bar disk-progress" style="width: {{disk_usage}}%"></div>
|
| 561 |
+
</div>
|
| 562 |
+
</div>
|
| 563 |
+
</div>
|
| 564 |
+
|
| 565 |
+
<div class="system-stats">
|
| 566 |
+
<div class="system-item">
|
| 567 |
+
<div class="status-label">Total Disk</div>
|
| 568 |
+
<div class="status-value">{{total_disk}}</div>
|
| 569 |
+
</div>
|
| 570 |
+
<div class="system-item">
|
| 571 |
+
<div class="status-label">Used Disk</div>
|
| 572 |
+
<div class="status-value">{{used_disk}}</div>
|
| 573 |
+
</div>
|
| 574 |
+
<div class="system-item">
|
| 575 |
+
<div class="status-label">Free Disk</div>
|
| 576 |
+
<div class="status-value">{{free_disk}}</div>
|
| 577 |
+
</div>
|
| 578 |
+
<div class="system-item">
|
| 579 |
+
<div class="status-label">Data Sent</div>
|
| 580 |
+
<div class="status-value">{{system_sent}}</div>
|
| 581 |
+
</div>
|
| 582 |
+
<div class="system-item">
|
| 583 |
+
<div class="status-label">Data Received</div>
|
| 584 |
+
<div class="status-value">{{system_recv}}</div>
|
| 585 |
+
</div>
|
| 586 |
+
</div>
|
| 587 |
+
</div>
|
| 588 |
+
</div>
|
| 589 |
+
|
| 590 |
+
<div class="actions">
|
| 591 |
+
<a href="https://t.me/Digital_Botz" class="btn btn-telegram">
|
| 592 |
+
<i class="fab fa-telegram-plane"></i> Join Telegram
|
| 593 |
+
</a>
|
| 594 |
+
<a href="https://github.com/RknDeveloper" class="btn btn-github">
|
| 595 |
+
<i class="fab fa-github"></i> GitHub
|
| 596 |
+
</a>
|
| 597 |
+
</div>
|
| 598 |
+
|
| 599 |
+
<div class="footer">
|
| 600 |
+
<p>© 2023 RknDeveloper | Powered by <a href="https://t.me/Digital_Botz">Digital Botz™</a> | Repo: <a href="https://github.com/DigitalBotz/Digital-Rename-Bot">Digital-Rename-Bot</a></p>
|
| 601 |
+
<p>Special Thanks To <a href="https://t.me/Shivshankar_Official">Shivshankar Official</a></p>
|
| 602 |
+
</div>
|
| 603 |
+
</div>
|
| 604 |
+
|
| 605 |
+
<script>
|
| 606 |
+
// Hide loading screen after page load
|
| 607 |
+
window.addEventListener('load', function() {
|
| 608 |
+
setTimeout(() => {
|
| 609 |
+
document.getElementById('loadingScreen').style.opacity = '0';
|
| 610 |
+
setTimeout(() => {
|
| 611 |
+
document.getElementById('loadingScreen').style.display = 'none';
|
| 612 |
+
}, 500);
|
| 613 |
+
}, 1000);
|
| 614 |
+
});
|
| 615 |
+
|
| 616 |
+
// Auto refresh REMOVED as requested
|
| 617 |
+
</script>
|
| 618 |
+
</body>
|
| 619 |
+
</html>
|