Kanhshsh commited on
Commit
b00d2c6
·
verified ·
1 Parent(s): 0d984e8

Upload 60 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10.8-slim-buster
2
+
3
+ RUN apt update && apt upgrade -y
4
+ RUN apt install git -y
5
+ COPY requirements.txt /requirements.txt
6
+
7
+ RUN cd /
8
+ RUN pip3 install -U pip && pip3 install -U -r requirements.txt
9
+ RUN mkdir /TheMovieProviderBot
10
+ WORKDIR /TheMovieProviderBot
11
+ COPY start.sh /start.sh
12
+ CMD ["/bin/bash", "/start.sh"]
LICENSE ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
Procfile ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ web: python3 bot.py
2
+ worker: python3 bot.py
README.md CHANGED
@@ -1,12 +1,8 @@
1
- ---
2
- title: File
3
- emoji: ⚡
4
- colorFrom: red
5
- colorTo: purple
6
- sdk: gradio
7
- sdk_version: 5.33.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
1
+ # TheMovieProviderBot Hugging Face Space
 
 
 
 
 
 
 
 
 
2
 
3
+ This Space provides a frontend to interact with your bot and download setup files.
4
+
5
+ ## Usage
6
+ - Clone the original bot: https://github.com/HarshalPurohitEdits/TheMovieProviderBot.git
7
+ - Replace the `bot` directory with your customized files
8
+ - Deploy to Hugging Face
Script.py ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class script(object):
2
+ START_TXT = """ʜᴇʏ {}, {}\n\nɪ ᴀᴍ ᴛʜᴇ ᴍᴏꜱᴛ ᴘᴏᴡᴇʀꜰᴜʟ ᴀᴜᴛᴏ ꜰɪʟᴛᴇʀ ʙᴏᴛ ᴡɪᴛʜ ᴘʀᴇᴍɪᴜᴍ ꜰᴇᴀᴛᴜʀᴇꜱ.\n\nᴍᴀɴᴛᴀɪɴᴇᴅ ʙʏ : <a href="https://t.me/DeletedFromEarth">ʜᴘ</a>"""
3
+
4
+ GSTART_TXT = """ʜᴇʏ {},\n\nɪ ᴀᴍ ᴛʜᴇ ᴍᴏꜱᴛ ᴘᴏᴡᴇʀꜰᴜʟ ᴀᴜᴛᴏ ꜰɪʟᴛᴇʀ ʙᴏᴛ ᴡɪᴛʜ ᴘʀᴇᴍɪᴜᴍ ꜰᴇᴀᴛᴜʀᴇꜱ.\n\nᴍᴀɴᴛᴀɪɴᴇᴅ ʙʏ : <a href="https://t.me/DeletedFromEarth">ʜᴘ</a>"""
5
+
6
+ HELP_TXT = """<b>ʜᴇʏ {},
7
+
8
+ ᴡᴇ ʜᴀᴠᴇ ᴅᴇᴠɪᴅᴇᴅ ʙᴏᴛ ᴄᴏᴍᴍᴀɴᴅꜱ ꜰᴏʀ ɢʀᴏᴜᴘ ᴏᴡɴᴇʀꜱ ᴀɴᴅ ʙᴏᴛ ᴜꜱᴇʀꜱ.</b>"""
9
+
10
+ ABOUT_TXT = """<b>‣ ᴍʏ ɴᴀᴍᴇ : {}\n‣ ᴄʀᴇᴀᴛᴏʀ : <a href='https://t.me/DeletedFromEarth'>Hᴀʀꜱʜᴀʟ ❤️‍🔥</a>\n‣ ʟɪʙʀᴀʀʏ : ᴘʏʀᴏɢʀᴀᴍ\n‣ ʟᴀɴɢᴜᴀɢᴇ : ᴘʏᴛʜᴏɴ\n‣ ᴅᴀᴛᴀ ʙᴀsᴇ : ᴍᴏɴɢᴏ ᴅʙ\n‣ ʜᴏsᴛᴇᴅ ᴏɴ : ʜᴇʀᴏᴋᴜ\n‣ ʙᴜɪʟᴅ sᴛᴀᴛᴜs : ᴠ4.2 [sᴛᴀʙʟᴇ]</b>"""
11
+
12
+ CHANNELS = """
13
+ <b>⚡ ɢʀᴏᴜᴘs & ᴄʜᴀɴɴᴇʟs ɪɴғᴏ ⚡
14
+
15
+ ▫ ᴀʟʟ ɴᴇᴡ ᴍᴏᴠɪᴇs & sᴇʀɪᴇs.
16
+ ▫ ғᴀsᴛᴇsᴛ ʙᴏᴛs ᴀʀᴇ ᴀᴅᴅᴇᴅ.
17
+ ▫ ғʀᴇᴇ & ᴇᴀsʏ ᴛᴏ ᴜsᴇ.
18
+ ▫ 𝟸𝟺x𝟽 sᴇʀᴠɪᴄᴇs ᴀᴠᴀɪʟᴀʙʟᴇ.</b>"""
19
+
20
+ STATUS_TXT = """<b>
21
+ ‣ ᴛᴏᴛᴀʟ ꜰɪʟᴇꜱ : <code>{}</code>
22
+ ‣ ᴛᴏᴛᴀʟ ᴜꜱᴇʀꜱ : <code>{}</code>
23
+ ‣ ᴛᴏᴛᴀʟ ɢʀᴏᴜᴘꜱ : <code>{}</code>
24
+ ‣ ᴜꜱᴇᴅ ꜱᴛᴏʀᴀɢᴇ : <code>{}</code>
25
+ ‣ ꜰʀᴇᴇ ꜱᴛᴏʀᴀɢᴇ : <code>{}</code>
26
+ </b>"""
27
+
28
+ LOG_TEXT_G = """#NewGroup
29
+
30
+ Gʀᴏᴜᴘ = {}
31
+ Iᴅ = <code>{}</code>
32
+ Tᴏᴛᴀʟ Mᴇᴍʙᴇʀs = <code>{}</code>
33
+ Aᴅᴅᴇᴅ Bʏ - {}
34
+
35
+ Bʏ @TheMovieProviderBot"""
36
+
37
+ LOG_TEXT_P = """#NewUser
38
+
39
+ Iᴅ - <code>{}</code>
40
+ Nᴀᴍᴇ - {}
41
+
42
+ Bʏ @TheMovieProviderBot"""
43
+
44
+ ALRT_TXT = """ʜᴇʟʟᴏ {},
45
+ ᴛʜɪꜱ ɪꜱ ɴᴏᴛ ʏᴏᴜʀ ᴍᴏᴠɪᴇ ʀᴇǫᴜᴇꜱᴛ,
46
+ ʀᴇǫᴜᴇꜱᴛ ʏᴏᴜʀ'ꜱ..."""
47
+
48
+ OLD_ALRT_TXT = """ʜᴇʏ {},
49
+ ʏᴏᴜ ᴀʀᴇ ᴜꜱɪɴɢ ᴏɴᴇ ᴏꜰ ᴍʏ ᴏʟᴅ ᴍᴇꜱꜱᴀɢᴇꜱ,
50
+ ᴘʟᴇᴀꜱᴇ ꜱᴇɴᴅ ᴛʜᴇ ʀᴇǫᴜᴇꜱᴛ ᴀɢᴀɪɴ."""
51
+
52
+ CUDNT_FND = """Sᴘᴇʟʟɪɴɢ Mɪꜱᴛᴀᴋᴇ Bʀᴏ ‼️\nᴅᴏɴ'ᴛ ᴡᴏʀʀʏ 😊 Cʜᴏᴏꜱᴇ ᴛʜᴇ ᴄᴏʀʀᴇᴄᴛ ᴏɴᴇ ʙᴇʟᴏᴡ 👇"""
53
+
54
+ I_CUDNT = """<b>sᴏʀʀʏ ɴᴏ ꜰɪʟᴇs ᴡᴇʀᴇ ꜰᴏᴜɴᴅ ꜰᴏʀ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ {} 😕
55
+
56
+ ᴍᴏᴠɪᴇ ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ʀᴇᴀsᴏɴ :
57
+
58
+ 1) ᴏ.ᴛ.ᴛ ᴏʀ ᴅᴠᴅ ɴᴏᴛ ʀᴇʟᴇᴀsᴇᴅ
59
+
60
+ 2) ᴛʏᴘᴇ ɴᴀᴍᴇ ᴡɪᴛʜ ʏᴇᴀʀ
61
+
62
+ 3) ᴍᴏᴠɪᴇ ɪs ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ɪɴ ᴛʜᴇ ᴅᴀᴛᴀʙᴀsᴇ ʀᴇᴘᴏʀᴛ ᴛᴏ ᴀᴅᴍɪɴs @HpMovieRequest</b>"""
63
+
64
+ I_CUD_NT = """<b>ɪ ᴄᴏᴜʟᴅɴ'ᴛ ꜰɪɴᴅ ᴀɴʏ ᴍᴏᴠɪᴇ ʀᴇʟᴀᴛᴇᴅ ᴛᴏ {}.
65
+
66
+ ᴍᴏᴠɪᴇ ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ʀᴇᴀsᴏɴ :
67
+
68
+ 1) ᴏ.ᴛ.ᴛ ᴏʀ ᴅᴠᴅ ɴᴏᴛ ʀᴇʟᴇᴀsᴇᴅ
69
+
70
+ 2) ᴛʏᴘᴇ ɴᴀᴍᴇ ᴡɪᴛʜ ʏᴇᴀʀ
71
+
72
+ 3) ᴍᴏᴠɪᴇ ɪs ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ɪɴ ᴛʜᴇ ᴅᴀᴛᴀʙᴀsᴇ ʀᴇᴘᴏʀᴛ ᴛᴏ ᴀᴅᴍɪɴs @HpMovieRequest</b>"""
73
+
74
+ MVE_NT_FND = """<b>sᴏʀʀʏ ɴᴏ ꜰɪʟᴇs ᴡᴇʀᴇ ꜰᴏᴜɴᴅ ꜰᴏʀ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ 😕
75
+
76
+ ᴍᴏᴠɪᴇ ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ʀᴇᴀsᴏɴ :
77
+
78
+ 1) ᴏ.ᴛ.ᴛ ᴏʀ ᴅᴠᴅ ɴᴏᴛ ʀᴇʟᴇᴀsᴇᴅ
79
+
80
+ 2) ᴛʏᴘᴇ ɴᴀᴍᴇ ᴡɪᴛʜ ʏᴇᴀʀ
81
+
82
+ 3) ᴍᴏᴠɪᴇ ɪs ɴᴏᴛ ᴀᴠᴀɪʟᴀʙʟᴇ ɪɴ ᴛʜᴇ ᴅᴀᴛᴀʙᴀsᴇ ʀᴇᴘᴏʀᴛ ᴛᴏ ᴀᴅᴍɪɴs @HpMovieRequest</b>"""
83
+
84
+
85
+ TOP_ALRT_MSG = """ꜱᴇᴀʀᴄʜɪɴɢ ꜰᴏʀ ǫᴜᴇʀʏ ɪɴ ᴍʏ ᴅᴀᴛᴀʙᴀꜱᴇ..."""
86
+
87
+ MELCOW_ENG = """<b>👋 ʜᴇʏ {},\n\n🍁 ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ\n🌟 {} \n\n🔍 ʜᴇʀᴇ ʏᴏᴜ ᴄᴀɴ ꜱᴇᴀʀᴄʜ ʏᴏᴜʀ ꜰᴀᴠᴏᴜʀɪᴛᴇ ᴍᴏᴠɪᴇꜱ ᴏʀ ꜱᴇʀɪᴇꜱ ʙʏ ᴊᴜꜱᴛ ᴛʏᴘɪɴɢ ɪᴛ'ꜱ ɴᴀᴍᴇ 🔎\n\n⚠️ ɪꜰ ʏᴏᴜ'ʀᴇ ʜᴀᴠɪɴɢ ᴀɴʏ ᴘʀᴏʙʟᴇᴍ ʀᴇɢᴀʀᴅɪɴɢ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴏʀ ꜱᴏᴍᴇᴛʜɪɴɢ ᴇʟꜱᴇ ᴛʜᴇɴ ᴍᴇꜱꜱᴀɢᴇ ʜᴇʀᴇ 👇</b>"""
88
+
89
+ DISCLAIMER_TXT = """
90
+ <b>ᴛʜɪꜱ ɪꜱ ᴀɴ ᴏᴘᴇɴ ꜱᴏᴜʀᴄᴇ ᴘʀᴏᴊᴇᴄᴛ.
91
+
92
+ ᴀʟʟ ᴛʜᴇ ꜰɪʟᴇꜱ ɪɴ ᴛʜɪꜱ ʙᴏᴛ ᴀʀᴇ ꜰʀᴇᴇʟʏ ᴀᴠᴀɪʟᴀʙʟᴇ ᴏɴ ᴛʜᴇ ɪɴᴛᴇʀɴᴇᴛ ᴏʀ ᴘᴏꜱᴛᴇᴅ ʙʏ ꜱᴏᴍᴇʙᴏᴅʏ ᴇʟꜱᴇ. ᴊᴜꜱᴛ ꜰᴏʀ ᴇᴀꜱʏ ꜱᴇᴀʀᴄʜɪɴɢ ᴛʜɪꜱ ʙᴏᴛ ɪꜱ ɪɴᴅᴇxɪɴɢ ꜰɪʟᴇꜱ ᴡʜɪᴄʜ ᴀʀᴇ ��ʟʀᴇᴀᴅʏ ᴜᴘʟᴏᴀᴅᴇᴅ ᴏɴ ᴛᴇʟᴇɢʀᴀᴍ. ᴡᴇ ʀᴇꜱᴘᴇᴄᴛ ᴀʟʟ ᴛʜᴇ ᴄᴏᴘʏʀɪɢʜᴛ ʟᴀᴡꜱ ᴀɴᴅ ᴡᴏʀᴋꜱ ɪɴ ᴄᴏᴍᴘʟɪᴀɴᴄᴇ ᴡɪᴛʜ ᴅᴍᴄᴀ ᴀɴᴅ ᴇᴜᴄᴅ. ɪꜰ ᴀɴʏᴛʜɪɴɢ ɪꜱ ᴀɢᴀɪɴꜱᴛ ʟᴀᴡ ᴘʟᴇᴀꜱᴇ ᴄᴏɴᴛᴀᴄᴛ ᴍᴇ ꜱᴏ ᴛʜᴀᴛ ɪᴛ ᴄᴀɴ ʙᴇ ʀᴇᴍᴏᴠᴇᴅ ᴀꜱᴀᴘ. ɪᴛ ɪꜱ ꜰᴏʀʙɪʙʙᴇɴ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ, ꜱᴛʀᴇᴀᴍ, ʀᴇᴘʀᴏᴅᴜᴄᴇ, ꜱʜᴀʀᴇ ᴏʀ ᴄᴏɴꜱᴜᴍᴇ ᴄᴏɴᴛᴇɴᴛ ᴡɪᴛʜᴏᴜᴛ ᴇxᴘʟɪᴄɪᴛ ᴘᴇʀᴍɪꜱꜱɪᴏɴ ꜰʀᴏᴍ ᴛʜᴇ ᴄᴏɴᴛᴇɴᴛ ᴄʀᴇᴀᴛᴏʀ ᴏʀ ʟᴇɢᴀʟ ᴄᴏᴘʏʀɪɢʜᴛ ʜᴏʟᴅᴇʀ. ɪꜰ ʏᴏᴜ ʙᴇʟɪᴇᴠᴇ ᴛʜɪꜱ ʙᴏᴛ ɪꜱ ᴠɪᴏʟᴀᴛɪɴɢ ʏᴏᴜʀ ɪɴᴛᴇʟʟᴇᴄᴛᴜᴀʟ ᴘʀᴏᴘᴇʀᴛʏ, ᴄᴏɴᴛᴀᴄᴛ ᴛʜᴇ ʀᴇꜱᴘᴇᴄᴛɪᴠᴇ ᴄʜᴀɴɴᴇʟꜱ ꜰᴏʀ ʀᴇᴍᴏᴠᴀʟ. ᴛʜᴇ ʙᴏᴛ ᴅᴏᴇꜱ ɴᴏᴛ ᴏᴡɴ ᴀɴʏ ᴏꜰ ᴛʜᴇꜱᴇ ᴄᴏɴᴛᴇɴᴛꜱ, ɪᴛ ᴏɴʟʏ ɪɴᴅᴇx ᴛʜᴇ ꜰɪʟᴇꜱ ꜰʀᴏᴍ ᴛᴇʟᴇɢʀᴀᴍ.
93
+
94
+ 🌿 ᴍᴀɪɴᴛᴀɪɴᴇᴅ ʙʏ : <a href='https://t.me/DeletedFromEarth'>ʜᴘ</a></b>"""
95
+
96
+ USERS_TXT = """👋 ʜᴇʏ {},
97
+
98
+ 📚 ʜᴇʀᴇ ᴀʀᴇ ᴍʏ ᴄᴏᴍᴍᴀɴᴅꜱ ʟɪꜱᴛ ꜰᴏʀ ᴀʟʟ ʙᴏᴛ ᴜꜱᴇʀꜱ ⇊
99
+
100
+ • /batch - ᴄʀᴇᴀᴛᴇ ᴀ ʙᴀᴛᴄʜ ʟɪɴᴋ ᴏғ ᴍᴜʟᴛɪᴘʟᴇ ғɪʟᴇs.
101
+ • /link - ᴄʀᴇᴀᴛᴇ ᴀ sɪɴɢʟᴇ ғɪʟᴇ sᴛᴏʀᴇ ʟɪɴᴋ.
102
+ • /pbatch - ᴊᴜsᴛ ʟɪᴋᴇ <code>/batch</code>, ʙᴜᴛ ᴛʜᴇ ғɪʟᴇs ᴡɪʟʟ ʙᴇ sᴇɴᴅ ᴡɪᴛʜ ғᴏʀᴡᴀʀᴅ ʀᴇsᴛʀɪᴄᴛɪᴏɴs.
103
+ • /plink - ᴊᴜsᴛ ʟɪᴋᴇ <code>/link</code>, ʙᴜᴛ ᴛʜᴇ ғɪʟᴇ ᴡɪʟʟ ʙᴇ sᴇɴᴅ ᴡɪᴛʜ ғᴏʀᴡᴀʀᴅ ʀᴇsᴛʀɪᴄᴛɪᴏɴ.
104
+ • /id - ɢᴇᴛ ɪᴅ ᴏꜰ ᴀ ꜱᴘᴇᴄɪꜰɪᴇᴅ ᴜꜱᴇʀ.
105
+ • /info - ɢᴇᴛ ɪɴꜰᴏʀᴍᴀᴛɪᴏɴ ᴀʙᴏᴜᴛ ᴀ ᴜꜱᴇʀ.
106
+ • /imdb - ɢᴇᴛ ᴛʜᴇ ꜰɪʟᴍ ɪɴꜰᴏʀᴍᴀᴛɪᴏɴ ꜰʀᴏᴍ ɪᴍᴅʙ ꜱᴏᴜʀᴄᴇ.
107
+ • /search - ɢᴇᴛ ᴛʜᴇ ꜰɪʟᴍ ɪɴꜰᴏʀᴍᴀᴛɪᴏɴ ꜰʀᴏᴍ ᴠᴀʀɪᴏᴜꜱ ꜱᴏᴜʀᴄᴇꜱ.
108
+ • /stats - ɢᴇᴛ ꜱᴛᴀᴛᴜꜱ ᴏꜰ ꜰɪʟᴇꜱ ɪɴ ᴅʙ.
109
+ • /request - sᴇɴᴅ ᴀ Mᴏᴠɪᴇ/Sᴇʀɪᴇs ʀᴇᴏ̨ᴜᴇsᴛ ᴛᴏ ʙᴏᴛ ᴀᴅᴍɪɴs. ( ᴏɴʟʏ ᴡᴏʀᴋs ᴏɴ sᴜᴘᴘᴏʀᴛ ɢʀᴏᴜᴘ )
110
+ • /plan - ᴄʜᴇᴄᴋ ᴀᴠᴀɪʟᴀʙʟᴇ ᴘʀᴇᴍɪᴜᴍ ᴍᴇᴍʙᴇʀꜱʜɪᴘ ᴘʟᴀɴꜱ.
111
+ • /myplan - ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴄᴜʀʀᴜɴᴛ ᴘʟᴀɴ."""
112
+
113
+ GROUP_TXT = """👋 ʜᴇʏ {},
114
+
115
+ 📚 ʜᴇʀᴇ ᴀʀᴇ ᴍʏ ᴄᴏᴍᴍᴀɴᴅꜱ ʟɪꜱᴛ ꜰᴏʀ ᴀʟʟ ɢʀᴏᴜᴘ ᴏᴡɴᴇʀꜱ ⇊
116
+
117
+ • /connect - ᴄᴏɴɴᴇᴄᴛ ᴀ ᴘᴀʀᴛɪᴄᴜʟᴀʀ ᴄʜᴀᴛ ᴛᴏ ʏᴏᴜʀ ᴘᴍ.
118
+ • /disconnect - ᴅɪꜱᴄᴏɴɴᴇᴄᴛ ꜰʀᴏᴍ ᴀ ᴄʜᴀᴛ.
119
+ • /shortlink - ᴄᴏɴɴᴇᴄᴛ ʏᴏᴜʀ ꜱʜᴏʀᴛɴᴇʀ ᴡᴇʙꜱɪᴛᴇ.
120
+ • /set_tutorial - ꜱᴇᴛ ʏᴏᴜʀ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ᴠɪᴅᴇᴏ.
121
+ • /remove_tutorial - ꜱᴇᴛ ʏᴏᴜʀ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ᴠɪᴅᴇᴏ.
122
+ • /shortlink_info - ᴄʜᴇᴄᴋ ʏᴏᴜʀ ɢʀᴏᴜᴘ ɪɴꜰᴏʀᴍᴀᴛɪᴏɴ.
123
+ • /setshortlinkon - ᴏɴ ꜱʜᴏʀᴛʟɪɴᴋ ꜰᴏʀ ʏᴏᴜʀ ɢʀᴏᴜᴘ.
124
+ • /setshortlinkoff - ᴏꜰꜰ ꜱʜᴏʀᴛʟɪɴᴋ ꜰᴏʀ ʏᴏᴜʀ ɢʀᴏᴜᴘ.
125
+ • /connections - ʟɪꜱᴛ ᴀʟʟ ʏᴏᴜʀ ᴄᴏɴɴᴇᴄᴛɪᴏɴꜱ.
126
+ • /settings - ᴄʜᴀɴɢᴇ sᴇᴛᴛɪɴɢs ᴀs ʏᴏᴜʀ ᴡɪsʜ.
127
+ • /filter - ᴀᴅᴅ ᴀ ꜰɪʟᴛᴇʀ ɪɴ ᴀ ɢʀᴏᴜᴘ.
128
+ • /filters - ʟɪꜱᴛ ᴀʟʟ ᴛʜᴇ ꜰɪʟᴛᴇʀꜱ ᴏꜰ ᴀ ɢʀᴏᴜᴘ.
129
+ • /del - ᴅᴇʟᴇᴛᴇ ᴀ ꜱᴘᴇᴄɪꜰɪᴄ ꜰɪʟᴛᴇʀ ɪɴ ᴀ ɢʀᴏᴜᴘ.
130
+ • /delall - ᴅᴇʟᴇᴛᴇ ᴛʜᴇ ᴡʜᴏʟᴇ ꜰɪʟᴛᴇʀꜱ ɪɴ ᴀ ɢʀᴏᴜᴘ.
131
+ • /purge - ᴅᴇʟᴇᴛᴇ ᴀʟʟ ᴍᴇssᴀɢᴇs ꜰʀᴏᴍ ᴛʜᴇ ʀᴇᴘʟɪᴇᴅ ᴛᴏ ᴍᴇssᴀɢᴇ, ᴛᴏ ᴛʜᴇ ᴄᴜʀʀᴇɴᴛ ᴍᴇssᴀɢᴇ."""
132
+
133
+ ADMIC_TXT = """👋 ʜᴇʏ {},
134
+
135
+ 📚 ʜᴇʀᴇ ᴀʀᴇ ᴍʏ ᴄᴏᴍᴍᴀɴᴅꜱ ʟɪꜱᴛ ꜰᴏʀ ᴀʟʟ ʙᴏᴛ ᴀᴅᴍɪɴꜱ ⇊
136
+
137
+ • /logs - <code>ɢᴇᴛ ᴛʜᴇ ʀᴇᴄᴇɴᴛ ᴇʀʀᴏʀꜱ.</code>
138
+ • /delete - <code>ᴅᴇʟᴇᴛᴇ ᴀ ꜱᴘᴇᴄɪꜰɪᴄ ꜰɪʟᴇ ꜰʀᴏᴍ ᴅʙ.</code>
139
+ • /users - <code>ɢᴇᴛ ʟɪꜱᴛ ᴏꜰ ᴍʏ ᴜꜱᴇʀꜱ ᴀɴᴅ ɪᴅꜱ.</code>
140
+ • /chats - <code>ɢᴇᴛ ʟɪꜱᴛ ᴏꜰ ᴍʏ ᴄʜᴀᴛꜱ ᴀɴᴅ ɪᴅꜱ.</code>
141
+ • /leave - <code>ʟᴇᴀᴠᴇ ꜰʀᴏᴍ ᴀ ᴄʜᴀᴛ.</code>
142
+ • /disable - <code>ᴅɪꜱᴀʙʟᴇ ᴀ ᴄʜᴀᴛ.</code>
143
+ • /ban - <code>ʙᴀɴ ᴀ ᴜꜱᴇʀ.</code>
144
+ • /unban - <code>ᴜɴʙᴀɴ ᴀ ᴜꜱᴇʀ.</code>
145
+ • /channel - <code>ɢᴇᴛ ʟɪꜱᴛ ᴏꜰ ᴛᴏᴛᴀʟ ᴄᴏɴɴᴇᴄᴛᴇᴅ ɢʀᴏᴜᴘꜱ.</code>
146
+ • /broadcast - <code>ʙʀᴏᴀᴅᴄᴀꜱᴛ ᴀ ᴍᴇꜱꜱᴀɢᴇ ᴛᴏ ᴀʟʟ ᴜꜱᴇʀꜱ.</code>
147
+ • /grp_broadcast - <code>ʙʀᴏᴀᴅᴄᴀsᴛ ᴀ ᴍᴇssᴀɢᴇ ᴛᴏ ᴀʟʟ ᴄᴏɴɴᴇᴄᴛᴇᴅ ɢʀᴏᴜᴘs.</code>
148
+ • /gfilter - <code>ᴀᴅᴅ ɢʟᴏʙᴀʟ ғɪʟᴛᴇʀs.</code>
149
+ • /gfilters - <code>ᴠɪᴇᴡ ʟɪsᴛ ᴏғ ᴀʟʟ ɢʟᴏʙᴀʟ ғɪʟᴛᴇʀs.</code>
150
+ • /delg - <code>ᴅᴇʟᴇᴛᴇ ᴀ sᴘᴇᴄɪғɪᴄ ɢʟᴏʙᴀʟ ғɪʟᴛᴇʀ.</code>
151
+ • /delallg - <code>ᴅᴇʟᴇᴛᴇ ᴀʟʟ Gғɪʟᴛᴇʀs ғʀᴏᴍ ᴛʜᴇ ʙᴏᴛ's ᴅᴀᴛᴀʙᴀsᴇ.</code>
152
+ • /deletefiles - <code>ᴅᴇʟᴇᴛᴇ CᴀᴍRɪᴘ ᴀɴᴅ PʀᴇDVD ғɪʟᴇs ғʀᴏᴍ ᴛʜᴇ ʙᴏᴛ's ᴅᴀᴛᴀʙᴀsᴇ.</code>
153
+ • /send - <code>ꜱᴇɴᴅ ᴍᴇꜱꜱᴀɢᴇ ᴛᴏ ᴀ ᴘᴀʀᴛɪᴄᴜʟᴀʀ ᴜꜱᴇʀ.</code>
154
+ • /add_premium - <code>ᴀᴅᴅ ᴀɴʏ ᴜꜱᴇʀ ᴛᴏ ᴘʀᴇᴍɪᴜᴍ.</code>
155
+ • /remove_premium - <code>ʀᴇᴍᴏᴠᴇ ᴀɴʏ ᴜꜱᴇʀ ꜰʀᴏᴍ ᴘʀᴇᴍɪᴜᴍ.</code>
156
+ • /premium_users - <code>ɢᴇᴛ ʟɪꜱᴛ ᴏꜰ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀꜱ.</code>
157
+ • /get_premium - <code>ɢᴇᴛ ɪɴꜰᴏ ᴏꜰ ᴀɴʏ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ.</code>
158
+ • /restart - <code>ʀᴇꜱᴛᴀʀᴛ ᴛʜᴇ ʙᴏᴛ.</code>"""
159
+
160
+ SHORTLINK_INFO = """<b>
161
+ ❗<u>ʜᴏᴡ ᴛᴏ ᴇᴀʀɴ ᴍᴏɴᴇʏ ᴜꜱɪɴɢ ʙᴏᴛ</u>❗
162
+
163
+ ★ ɴᴏᴡ ʏᴏᴜ ᴄᴀɴ ꜱᴛᴀʀᴛ ᴇᴀʀɴɪɴɢ 💸 ᴍᴏɴᴇʏ ᴛᴏᴅᴀʏ ᴡɪᴛʜ ᴏᴜʀ ꜱɪᴍᴘʟᴇ ᴀɴᴅ ᴇᴀꜱʏ-ᴛᴏ-ᴜꜱᴇ ʙᴏᴛ!
164
+
165
+ ›› ꜱᴛᴇᴘ 1 : ᴀᴅᴅ ᴛʜɪꜱ ʙᴏᴛ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ ᴀꜱ ᴀɴ ᴀᴅᴍɪɴ...
166
+
167
+ ›› ꜱᴛᴇᴘ 2 : ᴜꜱᴇ /connect ɪɴ ʏᴏᴜʀ ɢʀᴏᴜᴘ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ʙᴏᴛ ᴛᴏ ʏᴏᴜʀ ᴘᴍ.
168
+
169
+ ›› ꜱᴛᴇᴘ 3 : ᴄʟɪᴄᴋ ᴏɴ ɴᴇxᴛ ʙᴜᴛᴛᴏɴ ᴛᴏ ᴋɴᴏᴡ ʜᴏᴡ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ꜱʜᴏʀᴛʟɪɴᴋ ᴡᴇʙꜱɪᴛᴇ ᴡɪᴛʜ ᴛʜɪs ʙᴏᴛ.
170
+
171
+ ★ ᴅᴏɴ'ᴛ ᴡᴀɪᴛ ᴀɴʏ ʟᴏɴɢᴇʀ ᴛᴏ ꜱᴛᴀʀᴛ ᴇᴀʀɴɪɴɢ ᴍᴏɴᴇʏ ꜰʀᴏᴍ ʏᴏᴜʀ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ. ᴀᴅᴅ ᴏᴜʀ ʙᴏᴛ ᴛᴏᴅᴀʏ ᴀɴᴅ ꜱᴛᴀʀᴛ ᴍᴀᴋɪɴɢ ᴍᴏɴᴇʏ 💰! </b>
172
+ """
173
+
174
+ SHORTLINK_INFO2 = """<b>
175
+ ❗<u>ʜᴏᴡ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ʏᴏᴜʀ sʜᴏʀᴛɴᴇʀ</u>❗
176
+
177
+ ›› ꜱᴛᴇᴘ 4 : ɪꜰ ʏᴏᴜ ᴅᴏɴ'ᴛ ᴜꜱɪɴɢ ᴀɴʏ ꜱʜᴏʀᴛɴᴇʀ ᴡᴇʙꜱɪᴛᴇ ᴛʜᴇɴ ᴍᴀᴋᴇ ᴀᴄᴄᴏᴜɴᴛ ꜰɪʀꜱᴛ ᴏɴ instantearn.in (ʏᴏᴜ ᴄᴀɴ ᴀʟꜱᴏ ᴜꜱᴇ ᴏᴛʜᴇʀ ʟɪɴᴋ ꜱʜᴏʀᴛɴᴇʀ ᴡᴇʙꜱɪᴛᴇ).
178
+
179
+ ›› ꜱᴛᴇᴘ 5 : ᴄᴏᴘʏ ʏᴏᴜʀ ᴀᴘɪ ꜰʀᴏᴍ ᴡᴇʙꜱɪᴛᴇ ᴀɴᴅ ᴛʜᴇɴ, ꜱɪᴍᴘʟʏ ꜱᴇᴛ ʏᴏᴜʀ ᴡᴇʙꜱɪᴛᴇ ᴀɴᴅ ᴀᴘɪ ᴜꜱɪɴɢ ᴛʜᴇ /shortlink ᴄᴏᴍᴍᴀɴᴅ.
180
+
181
+ › ʟɪᴋᴇ ᴛʜɪꜱ :</b> <code>/shortlink instantearn.in 1502a197c85d59929d50f1cba1d5e6f967d1e962</code>
182
+
183
+ <b>›› ꜱᴛᴇᴘ 6 : ᴄʟɪᴄᴋ ᴏɴ ɴᴇxᴛ ʙᴜᴛᴛᴏɴ ᴛᴏ ᴋɴᴏᴡ ʜᴏᴡ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ʏᴏᴜʀ ᴛᴜᴛᴏʀɪᴀʟ ᴡɪᴛʜ ᴛʜɪs ʙᴏᴛ.
184
+
185
+ ★ ᴛʜɪꜱ ʙᴏᴛ ᴡɪʟʟ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ᴄᴏɴᴠᴇʀᴛꜱ ʟɪɴᴋꜱ ᴡɪᴛʜ ʏᴏᴜʀ ᴀᴘɪ ᴀɴᴅ ᴡɪʟʟ ᴘʀᴏᴠɪᴅᴇ ʏᴏᴜʀ ʟɪɴᴋꜱ.</b>
186
+ """
187
+ SHORTLINK_INFO3 = """<b>
188
+ ❗<u>ʜᴏᴡ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ʏᴏᴜʀ ᴛᴜᴛᴏʀɪᴀʟ</u>❗
189
+
190
+ ›› ꜱᴛᴇᴘ 7 : ᴜꜱᴇ /set_tutorial ᴛᴏ ᴀᴅᴅ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ᴠɪᴅᴇᴏ ꜰᴏʀ ʏᴏᴜʀ ꜱʜᴏʀᴛɴᴇʀ ᴡᴇʙꜱɪᴛᴇ.
191
+
192
+ › ʟɪᴋᴇ ᴛʜɪꜱ :</b> <code>/set_tutorial https://t.me/HowToOpenLinkHP</code>
193
+
194
+ <b>›› ꜱᴛᴇᴘ 8 : ɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴄʜᴇᴄᴋ ᴡʜɪᴄʜ sʜᴏʀᴛᴇɴᴇʀ ʏᴏᴜ ʜᴀᴠᴇ ᴄᴏɴɴᴇᴄᴛᴇᴅ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ ᴛʜᴇɴ sᴇɴᴅ /shortlink_info ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ.
195
+
196
+ ★ ᴛʜᴀᴛ'ꜱ ɪᴛ, ɴᴏᴡ ʏᴏᴜ ᴄᴀɴ ᴇᴀʀɴ ᴀ ʟᴏᴛ ᴍᴏɴᴇʏ 💸 ᴜꜱɪɴɢ ᴛʜɪs ʙᴏᴛ.</b>
197
+ """
198
+
199
+ SELECT = """
200
+ ➢ ᴄʟɪᴄᴋ ᴏɴ "ǫᴜᴀʟɪᴛʏ" ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ꜰɪʟᴇ ɪɴ ʏᴏᴜʀ ᴅᴇꜱɪʀᴇᴅ ǫᴜᴀʟɪᴛʏ.
201
+ ➢ ᴄʟɪᴄᴋ ᴏɴ "ʟᴀɴɢᴜᴀɢᴇ" ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ꜰɪʟᴇ ɪɴ ʏᴏᴜʀ ᴅᴇꜱɪʀᴇᴅ ʟᴀɴɢᴜᴀɢᴇ.
202
+ ➢ ᴄʟɪᴄᴋ ᴏɴ "ꜱᴇᴀꜱᴏɴ" ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ꜰɪʟᴇ ɪɴ ʏᴏᴜʀ ᴅᴇꜱɪʀᴇᴅ ꜱᴇᴀꜱᴏɴ.
203
+
204
+ ➢ ᴄʟɪᴄᴋ ���ɴ "♨️ ꜱᴇɴᴅ ᴀʟʟ ꜰɪʟᴇꜱ ♨️" ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ᴀʟʟ ꜰɪʟᴇꜱ ɪɴ ᴀ ꜱɪɴɢʟᴇ ᴄʟɪᴄᴋ.
205
+
206
+ ✯ ᴍᴀɪɴᴛᴀɪɴᴇᴅ ʙʏ : ʜᴘ
207
+ """
208
+
209
+ REQINFO = """➢ ᴄʟɪᴄᴋ "ǫᴜᴀʟɪᴛʏ" ᴀɴᴅ ᴄʜᴀɴɢᴇ ǫᴜᴀʟɪᴛʏ.
210
+ ➢ ᴄʟɪᴄᴋ "ʟᴀɴɢᴜᴀɢᴇ" ᴀɴᴅ ᴄʜᴀɴɢᴇ ʟᴀɴɢᴜᴀɢᴇ.
211
+ ➢ ᴄʟɪᴄᴋ "ꜱᴇᴀꜱᴏɴ" ᴀɴᴅ ᴄʜᴀɴɢᴇ ꜱᴇᴀꜱᴏɴ.
212
+ ➢ ᴄʟɪᴄᴋ "♨️ ꜱᴇɴᴅ ᴀʟʟ ꜰɪʟᴇꜱ ♨️" ᴀɴᴅ ɢᴇᴛ ᴀʟʟ ꜰɪʟᴇꜱ."""
213
+
214
+ SINFO = """
215
+ ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯
216
+ ꜱᴇʀɪᴇꜱ ʀᴇǫᴜᴇꜱᴛ ꜰᴏʀᴍᴀᴛ
217
+ ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯
218
+
219
+ ɢᴏ ᴛᴏ ɢᴏᴏɢʟᴇ ➠ ᴛʏᴘᴇ ꜱᴇʀɪᴇꜱ ɴᴀᴍᴇ ➠ ᴄᴏᴘʏ ᴄᴏʀʀᴇᴄᴛ ɴᴀᴍᴇ ➠ ᴘᴀꜱᴛᴇ ᴛʜɪꜱ ɢʀᴏᴜᴘ
220
+
221
+ ᴇxᴀᴍᴘʟᴇ : Loki S01E01
222
+
223
+ 🚯 ᴅᴏɴᴛ ᴜꜱᴇ ➠ ':(!,./)"""
224
+
225
+ NORSLTS = """
226
+ #NoResults
227
+
228
+ Iᴅ : <code>{}</code>
229
+ Nᴀᴍᴇ : {}
230
+
231
+ Mᴇꜱꜱᴀɢᴇ : <b>{}</b>"""
232
+
233
+ # PLESE DO NOT REMOVE ANY CREDITS ❤️‍🩹
234
+ CREDITS_TXT = """<b>
235
+ ❤️‍🩹 <u>ꜱᴘᴇᴄɪᴀʟ ᴛʜᴀɴᴋꜱ ᴛᴏ ᴇᴠᴇʀʏᴏɴᴇ</u>
236
+
237
+ • ᴍᴀɪɴ ᴏᴡɴᴇʀ : <a href="https://t.me/DeletedFromEarth">Hᴀʀꜱʜᴀʟ ❤️‍🔥</a>
238
+ • ʙᴀꜱᴇ ʀᴇᴘᴏ : <a href="https://t.me/creatorbeatz">Jᴏᴇʟ ᠰ TɢX</a>
239
+ • sᴛʀᴇᴀᴍ ғᴇᴀᴛᴜʀᴇ : <a href="https://t.me/LazyDeveloperr">LazyDeveloper</a>
240
+ • sᴛʀᴇᴀᴍ ᴡᴇʙꜱɪᴛᴇ : <a href="https://t.me/Biisal">Bɪɪsᴀʟ</a>
241
+ • ᴘʀᴇᴍɪᴜᴍ ᴄᴏᴅᴇꜱ : <a href="https://t.me/Rk_botowner">Rɪꜱʜɪᴋᴇꜱʜ</a>
242
+ • ᴡᴇʟᴄᴏᴍᴇ ᴀɴɪᴍᴀᴛɪᴏɴ : <a href="https://t.me/Xavier_707">𝑿𝒂𝒗𝒊𝒆𝒓</a>
243
+ • ꜱᴛʀᴇᴀᴍ ꜱʜᴏʀᴛʟɪɴᴋ : <a href="https://t.me/Mr_SPIDY">⚝𝗠𝗿.𝗦𝗣𝗜𝗗𝗬⚝</a>
244
+
245
+ ɪ ᴀᴍ ꜱᴏʀʀʏ ɪꜰ ɪ ꜰᴏʀɢᴏᴛ ꜱᴏᴍᴇᴏɴᴇ 🫂
246
+ ᴛʜᴀɴᴋ ʏᴏᴜ ꜰᴏʀ ʜᴇʟᴘɪɴɢ ɪɴ ᴛʜɪꜱ ᴀᴍᴀᴢɪɴɢ ʀᴏʟʟᴇʀ ᴄᴏᴀꜱᴛᴇʀ ᴊᴏᴜʀɴᴇʏ 🚀</b>
247
+ """
248
+ # PLEASE DO NOT REMOVE ANY CREDITS ❤️‍🩹
249
+
250
+ CAPTION = """ 📂 <i><a href="https://telegram.me/HP_MOVIES_WORLD">{file_name}</a></i>\n\n"""
251
+
252
+ IMDB_TEMPLATE_TXT = """
253
+ <b>ʜᴇʏ {message.from_user.mention}, ʜᴇʀᴇ ɪꜱ ᴛʜᴇ ʀᴇꜱᴜʟᴛꜱ ꜰᴏʀ ʏᴏᴜʀ ǫᴜᴇʀʏ {search}.
254
+
255
+ 🧿 {title}</b>
256
+
257
+ <b>⭐ {rating} | ⏰ {runtime} Minutes
258
+ 📆 {release_date}
259
+ 🕵️ {director}
260
+
261
+ ● {languages}
262
+ ● {genres}
263
+
264
+ 📖 {plot}
265
+
266
+ 💗 ᴘᴏᴡᴇʀᴇᴅ ʙʏ : {message.chat.title}</b>
267
+ """
268
+
269
+
270
+ RESTART_TXT = """
271
+ <b>Bᴏᴛ Rᴇsᴛᴀʀᴛᴇᴅ !
272
+
273
+ 📅 Dᴀᴛᴇ : <code>{}</code>
274
+ ⏰ Tɪᴍᴇ : <code>{}</code>
275
+ 🌐 Tɪᴍᴇᴢᴏɴᴇ : <code>Asia/Kolkata</code>
276
+ 🛠️ Bᴜɪʟᴅ Sᴛᴀᴛᴜs: <code>v4.2 [ Sᴛᴀʙʟᴇ ]</code>
277
+
278
+ Bʏ @TheMovieProviderBot</b>"""
279
+
280
+ LOGO = """
281
+
282
+ BOT WORKING PROPERLY"""
283
+
284
+ #PLANS
285
+
286
+ PAGE_TXT = """ᴡʜʏ ᴀʀᴇ ʏᴏᴜ ꜱᴏ ᴄᴜʀɪᴏᴜꜱ ⁉️"""
287
+
288
+ PURCHASE_TXT = """ꜱᴇʟᴇᴄᴛ ʏᴏᴜʀ ᴘᴀʏᴍᴇɴᴛ ᴍᴇᴛʜᴏᴅ."""
289
+
290
+ PREMIUM_TEXT = """<b>👋 ʜᴇʏ {},
291
+
292
+ 🎖️ <u>ᴀᴠᴀɪʟᴀʙʟᴇ ᴘʟᴀɴs</u>
293
+
294
+ ● <code>10₹</code> ➛ <u>ʙʀᴏɴᴢᴇ ᴘʟᴀɴ</u> » <code>7 ᴅᴀʏꜱ</code>
295
+ ● <code>60₹</code> ➛ <u>ꜱɪʟᴠᴇʀ ᴘʟᴀɴ</u> » <code>30 ᴅᴀʏꜱ</code>
296
+ ● <code>180₹</code> ➛ <u>ɢᴏʟᴅ ᴘʟᴀɴ</u> » <code>90 ᴅᴀʏꜱ</code>
297
+ ● <code>250₹</code> ➛ <u>ᴘʟᴀᴛɪɴᴜᴍ ᴘʟᴀɴ</u> » <code>180 ᴅᴀʏꜱ</code>
298
+ ● <code>400₹</code> ➛ <u>ᴅɪᴀᴍᴏɴᴅ ᴘʟᴀɴ</u> » <code>365 ᴅᴀʏꜱ</code>
299
+
300
+ 💵 ᴜᴘɪ ɪᴅ - <code>harshal.purohit@paytm</code>
301
+ 📸 ǫʀ ᴄᴏᴅᴇ - <a href='https://telegra.ph/Payment-Information-01-03'>ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ꜱᴄᴀɴ</a>
302
+
303
+ ⚜️ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan
304
+
305
+ ‼️ ᴍᴜsᴛ sᴇɴᴅ sᴄʀᴇᴇɴsʜᴏᴛ ᴀғᴛᴇʀ ᴘᴀʏᴍᴇɴᴛ.</b>"""
306
+
307
+ CPREMIUM_TEXT = """<b>👋 ʜᴇʏ {},
308
+
309
+ 🎖️ <u>ᴀᴠᴀɪʟᴀʙʟᴇ ᴘʟᴀɴs</u> :
310
+
311
+ ● <code>10₹</code> ➛ <u>ʙʀᴏɴᴢᴇ ᴘʟᴀɴ</u> » <code>7 ᴅᴀʏꜱ</code>
312
+ ● <code>60₹</code> ➛ <u>ꜱɪʟᴠᴇʀ ᴘʟᴀɴ</u> » <code>30 ᴅᴀʏꜱ</code>
313
+ ● <code>180₹</code> ➛ <u>ɢᴏʟᴅ ᴘʟᴀɴ</u> » <code>90 ᴅᴀʏꜱ</code>
314
+ ● <code>250₹</code> ➛ <u>ᴘʟᴀᴛɪɴᴜᴍ ᴘʟᴀɴ</u> » <code>180 ᴅᴀʏꜱ</code>
315
+ ● <code>400₹</code> ➛ <u>ᴅɪᴀᴍᴏɴᴅ ᴘʟᴀɴ</u> » <code>365 ᴅᴀʏꜱ</code>
316
+
317
+ 💵 ᴜᴘɪ ɪᴅ - <code>harshal.purohit@paytm</code>
318
+ 📸 ǫʀ ᴄᴏᴅᴇ - <a href='https://telegra.ph/Payment-Information-01-03'>ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ꜱᴄᴀɴ</a>
319
+
320
+ ⚜️ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan
321
+
322
+ ‼️ ᴍᴜsᴛ sᴇɴᴅ sᴄʀᴇᴇɴsʜᴏᴛ ᴀғᴛᴇʀ ᴘᴀʏᴍᴇɴᴛ.</b>"""
323
+
324
+ PLAN_TXT = """<b>👋 ʜᴇʏ {},
325
+
326
+ 🎁 <u>ᴘʀᴇᴍɪᴜᴍ ғᴇᴀᴛᴜʀᴇs</u> :
327
+
328
+ ○ ɴᴏ ɴᴇᴇᴅ ᴛᴏ ᴏᴘᴇɴ ʟɪɴᴋꜱ
329
+ ○ ᴅɪʀᴇᴄᴛ ғɪʟᴇs
330
+ ○ ᴀᴅ-ғʀᴇᴇ ᴇxᴘᴇʀɪᴇɴᴄᴇ
331
+ ○ ʜɪɢʜ-sᴘᴇᴇᴅ ᴅᴏᴡɴʟᴏᴀᴅ ʟɪɴᴋ
332
+ ○ ᴍᴜʟᴛɪ-ᴘʟᴀʏᴇʀ sᴛʀᴇᴀᴍɪɴɢ ʟɪɴᴋs
333
+ ○ ᴜɴʟɪᴍɪᴛᴇᴅ ᴍᴏᴠɪᴇs & sᴇʀɪᴇs
334
+ ○ ꜰᴜʟʟ ᴀᴅᴍɪɴ sᴜᴘᴘᴏʀᴛ
335
+ ○ ʀᴇǫᴜᴇsᴛ ᴡɪʟʟ ʙᴇ ᴄᴏᴍᴘʟᴇᴛᴇᴅ ɪɴ 1ʜ [ ɪꜰ ᴀᴠᴀɪʟᴀʙʟᴇ ]
336
+
337
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
338
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan
339
+
340
+ ‼️ ᴀғᴛᴇʀ sᴇɴᴅɪɴɢ ᴀ sᴄʀᴇᴇɴsʜᴏᴛ ᴘʟᴇᴀsᴇ ɢɪᴠᴇ ᴜs sᴏᴍᴇ ᴛɪᴍᴇ ᴛᴏ ᴀᴅᴅ ʏᴏᴜ ɪɴ ᴛʜᴇ ᴘʀᴇᴍɪᴜᴍ ʟɪsᴛ.</b>"""
341
+
342
+ FREE_TXT = """<b>👋 ʜᴇʏ {},
343
+
344
+ 🎉 <u>ꜰʀᴇᴇ ᴛʀɪᴀʟ</u> 🎉
345
+ ❗ ᴏɴʟʏ ꜰᴏʀ 5 ᴍɪɴᴜᴛᴇꜱ
346
+
347
+ ○ ɴᴏ ɴᴇᴇᴅ ᴛᴏ ᴏᴘᴇɴ ʟɪɴᴋꜱ
348
+ ○ ᴍᴜʟᴛɪ-ᴘʟᴀʏᴇʀ sᴛʀᴇᴀᴍɪɴɢ ʟɪɴᴋs
349
+ ○ ᴀᴅ-ғʀᴇᴇ ᴇxᴘᴇʀɪᴇɴᴄᴇ
350
+
351
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
352
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
353
+
354
+ BRONZE_TXT = """<b>👋 ʜᴇʏ {},
355
+
356
+ 🥉 <u>ʙʀᴏɴᴄᴇ ᴘʟᴀɴ</u>
357
+ ⏰ 7 ᴅᴀʏꜱ
358
+ 💸 ᴘʟᴀɴ ᴘʀɪᴄᴇ ➛ 10₹
359
+
360
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
361
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
362
+
363
+ SILVER_TXT = """<b>👋 ʜᴇʏ {},
364
+
365
+ 🥈 <u>ꜱɪʟᴠᴇʀ ᴘʟᴀɴ</u>
366
+ ⏰ 30 ᴅᴀʏꜱ
367
+ 💸 ᴘʟᴀɴ ᴘʀɪᴄᴇ ➛ 60₹
368
+
369
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
370
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
371
+
372
+ GOLD_TXT = """<b>👋 ʜᴇʏ {},
373
+
374
+ 🥇 <u>ɢᴏʟᴅ ᴘʟᴀɴ</u>
375
+ ⏰ 90 ᴅᴀʏꜱ
376
+ 💸 ᴘʟᴀɴ ᴘʀɪᴄᴇ ➛ 180₹
377
+
378
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
379
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
380
+
381
+ PLATINUM_TXT = """<b>👋 ʜᴇʏ {},
382
+
383
+ 🏅 <u>ᴘʟᴀᴛɪɴᴜᴍ ᴘʟᴀɴ</u>
384
+ ⏰ 180 ᴅᴀʏꜱ
385
+ 💸 ᴘʟᴀɴ ᴘʀɪᴄᴇ ➛ 250₹
386
+
387
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
388
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
389
+
390
+ DIAMOND_TXT = """<b>👋 ʜᴇʏ {},
391
+
392
+ 💎 <u>ᴅɪᴀᴍᴏɴᴅ ᴘʟᴀɴ</u>
393
+ ⏰ 365 ᴅᴀʏꜱ
394
+ 💸 ᴘʟᴀɴ ᴘʀɪᴄᴇ ➛ 400₹
395
+
396
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
397
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
398
+
399
+ OTHER_TXT = """<b>👋 ʜᴇʏ {},
400
+
401
+ 🎁 <u>ᴏᴛʜᴇʀ ᴘʟᴀɴ</u>
402
+ ⏰ ᴄᴜꜱᴛᴏᴍɪꜱᴇᴅ ᴅᴀʏꜱ
403
+ 💸 ᴀᴄᴄᴏʀᴅɪɴɢ ᴛᴏ ᴅᴀʏꜱ ʏᴏᴜ ᴄʜᴏᴏꜱᴇ
404
+
405
+ 🏆 ɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴀ ɴᴇᴡ ᴘʟᴀɴ ᴀᴘᴀʀᴛ ꜰʀᴏᴍ ᴛʜᴇ ɢɪᴠᴇɴ ᴘʟᴀɴ, ᴛʜᴇɴ ʏᴏᴜ ᴄᴀɴ ᴛᴀʟᴋ ᴛᴏ ᴏᴜʀ <a href='https://t.me/DeletedFromEarth'>ᴏᴡɴᴇʀ</a> ᴅɪʀᴇᴄᴛʟʏ ʙʏ ᴄʟɪᴄᴋɪɴɢ ᴏɴ ᴛʜᴇ ᴄᴏɴᴛᴀᴄᴛ ʙᴜᴛᴛᴏɴ ɢɪᴠᴇɴ ʙᴇʟᴏᴡ.
406
+
407
+ 👨‍💻 ᴄᴏɴᴛᴀᴄᴛ ᴛʜᴇ ᴏᴡɴᴇʀ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ᴏᴛʜᴇʀ ᴘʟᴀɴ.
408
+
409
+ ➛ ᴜꜱᴇ /plan ᴛᴏ ꜱᴇᴇ ᴀʟʟ ᴏᴜʀ ᴘʟᴀɴꜱ ᴀᴛ ᴏɴᴄᴇ.
410
+ ➛ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan</b>"""
411
+
412
+ UPI_TXT = """<b>👋 ʜᴇʏ {},
413
+
414
+ ⚜️ ᴘᴀʏ ᴀᴍᴍᴏᴜɴᴛ ᴀᴄᴄᴏʀᴅɪɴɢ ᴛᴏ ʏᴏᴜʀ ᴘʟᴀɴ ᴀɴᴅ ᴇɴᴊᴏʏ ᴘʀᴇᴍɪᴜᴍ ᴍᴇᴍʙᴇʀꜱʜɪᴘ !
415
+
416
+ 💵 ᴜᴘɪ ɪᴅ - <code>harshal.purohit@paytm</code>
417
+
418
+ ‼️ ᴍᴜsᴛ sᴇɴᴅ sᴄʀᴇᴇɴsʜᴏᴛ ᴀғᴛᴇʀ ᴘᴀʏᴍᴇɴᴛ.</b>"""
419
+
420
+ QR_TXT = """<b>👋 ʜᴇʏ {},
421
+
422
+ ⚜️ ᴘᴀʏ ᴀᴍᴍᴏᴜɴᴛ ᴀᴄᴄᴏʀᴅɪɴɢ ᴛᴏ ʏᴏᴜʀ ᴘʟᴀɴ ᴀɴᴅ ᴇɴᴊᴏʏ ᴘʀᴇᴍɪᴜᴍ ᴍᴇᴍʙᴇʀꜱʜɪᴘ !
423
+
424
+ 📸 ǫʀ ᴄᴏᴅᴇ - <a href='https://telegra.ph/Payment-Information-01-03'>ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ꜱᴄᴀɴ</a>
425
+
426
+ ‼️ ᴍᴜsᴛ sᴇɴᴅ sᴄʀᴇᴇɴsʜᴏᴛ ᴀғᴛᴇʀ ᴘᴀʏᴍᴇɴᴛ.</b>"""
427
+
428
+ PREPLANS_TXT = """<b>👋 ʜᴇʏ {},
429
+
430
+ 🎖️ <u>ᴀᴠᴀɪʟᴀʙʟᴇ ᴘʟᴀɴs</u> :
431
+
432
+ ● <code>10₹</code> ➛ <u>ʙʀᴏɴᴢᴇ ᴘʟᴀɴ</u> » <code>7 ᴅᴀʏꜱ</code>
433
+ ● <code>60₹</code> ➛ <u>ꜱɪʟᴠᴇʀ ᴘʟᴀɴ</u> » <code>30 ᴅᴀʏꜱ</code>
434
+ ● <code>180₹</code> ➛ <u>ɢᴏʟᴅ ᴘʟᴀɴ</u> » <code>90 ᴅᴀʏꜱ</code>
435
+ ● <code>250₹</code> ➛ <u>ᴘʟᴀᴛɪɴᴜᴍ ᴘʟᴀɴ</u> » <code>180 ᴅᴀʏꜱ</code>
436
+ ● <code>400₹</code> ➛ <u>ᴅɪᴀᴍᴏɴᴅ ᴘʟᴀɴ</u> » <code>365 ᴅᴀʏꜱ</code>
437
+
438
+ 💵 ᴜᴘɪ ɪᴅ - <code>harshal.purohit@paytm</code>
439
+ 📸 ǫʀ ᴄᴏᴅᴇ - <a href='https://telegra.ph/Payment-Information-01-03'>ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ꜱᴄᴀɴ</a>
440
+
441
+ ⚜️ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴀᴄᴛɪᴠᴇ ᴘʟᴀɴ ʙʏ ᴜꜱɪɴɢ : /myplan
442
+
443
+ ‼️ ᴍᴜsᴛ sᴇɴᴅ sᴄʀᴇᴇɴsʜᴏᴛ ᴀғᴛᴇʀ ᴘᴀʏᴍᴇɴᴛ.</b>"""
444
+
445
+ DEVELOPER_TXT = """
446
+ special Thanks To ❤️ Developer -
447
+
448
+ -Dev [Owner of this bot ]<a href='https://t.me/DeletedFromEarth'>HP</a>
449
+ """
app.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "TheMovieProviderBot",
3
+ "description": "When you going to send file on telegram channel this bot will save that in database, So you can search that easily in inline mode",
4
+ "stack": "container",
5
+ "keywords": [
6
+ "telegram",
7
+ "auto-filter",
8
+ "filter",
9
+ "best",
10
+ "indian",
11
+ "pyrogram",
12
+ "media",
13
+ "search",
14
+ "channel",
15
+ "index",
16
+ "inline"
17
+ ],
18
+ "website": "https://github.com/HarshalPurohitEdits/TheMovieProviderBot",
19
+ "repository": "https://github.com/HarshalPurohitEdits/TheMovieProviderBot",
20
+ "env": {
21
+ "BOT_TOKEN": {
22
+ "description": "Your bot token.",
23
+ "required": true
24
+ },
25
+ "API_ID": {
26
+ "description": "Get this value from https://my.telegram.org",
27
+ "required": true
28
+ },
29
+ "API_HASH": {
30
+ "description": "Get this value from https://my.telegram.org",
31
+ "required": true
32
+ },
33
+ "CHANNELS": {
34
+ "description": "Username or ID of channel or group. Separate multiple IDs by space.",
35
+ "required": false
36
+ },
37
+ "ADMINS": {
38
+ "description": "Username or ID of Admin. Separate multiple Admins by space.",
39
+ "required": true
40
+ },
41
+ "PICS": {
42
+ "description": "Add some telegraph link of pictures .",
43
+ "required": false
44
+ },
45
+ "LOG_CHANNEL": {
46
+ "description": "Bot Logs,Give a channel id with -100xxxxxxx",
47
+ "required": true
48
+ },
49
+ "AUTH_USERS": {
50
+ "description": "Username or ID of users to give access of inline search. Separate multiple users by space.\nLeave it empty if you don't want to restrict bot usage.",
51
+ "required": false
52
+ },
53
+ "AUTH_CHANNEL": {
54
+ "description": "ID of channel.Make sure bot is admin in this channel. Without subscribing this channel users cannot use bot.",
55
+ "required": false
56
+ },
57
+ "DATABASE_URI": {
58
+ "description": "mongoDB URI. Get this value from https://www.mongodb.com.",
59
+ "required": true
60
+ },
61
+ "DATABASE_NAME": {
62
+ "description": "Name of the database in mongoDB.",
63
+ "required": false
64
+ },
65
+ "COLLECTION_NAME": {
66
+ "description": "Name of the collections. Defaults to Telegram_files. If you are using the same database, then use different collection name for each bot",
67
+ "value": "Telegram_files",
68
+ "required": false
69
+ }
70
+ },
71
+ "addons": [],
72
+ "buildpacks": [{
73
+ "url": "heroku/python"
74
+ }],
75
+ "formation": {
76
+ "worker": {
77
+ "quantity": 1,
78
+ "size": "eco"
79
+ }
80
+ }
81
+ }
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def launch_bot():
4
+ return "The Movie Provider Bot is running in the background. Interact via Telegram."
5
+
6
+ with gr.Blocks() as demo:
7
+ gr.Markdown("# 🎬 TheMovieProviderBot Interface")
8
+ gr.Markdown("Interact with the bot on Telegram.")
9
+ gr.File(label="📦 Download Bot Files", value="static/setup.zip")
10
+ gr.Button("Start Bot").click(launch_bot)
11
+
12
+ demo.launch()
bot.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import sys
3
+ import glob
4
+ import importlib
5
+ from pathlib import Path
6
+ from pyrogram import idle
7
+ import logging
8
+ import logging.config
9
+
10
+ # Get logging configurations
11
+ logging.config.fileConfig('logging.conf')
12
+ logging.getLogger().setLevel(logging.INFO)
13
+ logging.getLogger("pyrogram").setLevel(logging.ERROR)
14
+ logging.getLogger("imdbpy").setLevel(logging.ERROR)
15
+ logging.basicConfig(
16
+ level=logging.INFO,
17
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
18
+ )
19
+ logging.getLogger("aiohttp").setLevel(logging.ERROR)
20
+ logging.getLogger("aiohttp.web").setLevel(logging.ERROR)
21
+
22
+
23
+ from pyrogram import Client, __version__
24
+ from pyrogram.raw.all import layer
25
+ from database.ia_filterdb import Media
26
+ from database.users_chats_db import db
27
+ from info import *
28
+ from utils import temp
29
+ from typing import Union, Optional, AsyncGenerator
30
+ from pyrogram import types
31
+ from Script import script
32
+ from datetime import date, datetime
33
+ import pytz
34
+ from aiohttp import web
35
+ from plugins import web_server
36
+
37
+ import asyncio
38
+ from pyrogram import idle
39
+ from lazybot import LazyPrincessBot
40
+ from util.keepalive import ping_server
41
+ from lazybot.clients import initialize_clients
42
+
43
+
44
+ ppath = "plugins/*.py"
45
+ files = glob.glob(ppath)
46
+ LazyPrincessBot.start()
47
+ loop = asyncio.get_event_loop()
48
+
49
+
50
+ async def Lazy_start():
51
+ print('\n')
52
+ print('Initalizing The Movie Provider Bot')
53
+ bot_info = await LazyPrincessBot.get_me()
54
+ LazyPrincessBot.username = bot_info.username
55
+ await initialize_clients()
56
+ for name in files:
57
+ with open(name) as a:
58
+ patt = Path(a.name)
59
+ plugin_name = patt.stem.replace(".py", "")
60
+ plugins_dir = Path(f"plugins/{plugin_name}.py")
61
+ import_path = "plugins.{}".format(plugin_name)
62
+ spec = importlib.util.spec_from_file_location(import_path, plugins_dir)
63
+ load = importlib.util.module_from_spec(spec)
64
+ spec.loader.exec_module(load)
65
+ sys.modules["plugins." + plugin_name] = load
66
+ print("The Movie Provider Imported => " + plugin_name)
67
+ if ON_HEROKU:
68
+ asyncio.create_task(ping_server())
69
+ b_users, b_chats = await db.get_banned()
70
+ temp.BANNED_USERS = b_users
71
+ temp.BANNED_CHATS = b_chats
72
+ await Media.ensure_indexes()
73
+ me = await LazyPrincessBot.get_me()
74
+ temp.ME = me.id
75
+ temp.U_NAME = me.username
76
+ temp.B_NAME = me.first_name
77
+ LazyPrincessBot.username = '@' + me.username
78
+ logging.info(f"{me.first_name} with for Pyrogram v{__version__} (Layer {layer}) started on {me.username}.")
79
+ logging.info(LOG_STR)
80
+ logging.info(script.LOGO)
81
+ tz = pytz.timezone('Asia/Kolkata')
82
+ today = date.today()
83
+ now = datetime.now(tz)
84
+ time = now.strftime("%H:%M:%S %p")
85
+ await LazyPrincessBot.send_message(chat_id=LOG_CHANNEL, text=script.RESTART_TXT.format(today, time))
86
+ app = web.AppRunner(await web_server())
87
+ await app.setup()
88
+ bind_address = "0.0.0.0"
89
+ await web.TCPSite(app, bind_address, PORT).start()
90
+ await idle()
91
+
92
+
93
+ if __name__ == '__main__':
94
+ try:
95
+ loop.run_until_complete(Lazy_start())
96
+ except KeyboardInterrupt:
97
+ logging.info('Service Stopped Bye 👋')
bot/main.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ def run_bot():
2
+ print("This would start your Telegram bot.")
database/connections_mdb.py ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymongo
2
+
3
+ from info import DATABASE_URI, DATABASE_NAME
4
+
5
+ import logging
6
+ logger = logging.getLogger(__name__)
7
+ logger.setLevel(logging.ERROR)
8
+
9
+ myclient = pymongo.MongoClient(DATABASE_URI)
10
+ mydb = myclient[DATABASE_NAME]
11
+ mycol = mydb['CONNECTION']
12
+
13
+
14
+ async def add_connection(group_id, user_id):
15
+ query = mycol.find_one(
16
+ { "_id": user_id },
17
+ { "_id": 0, "active_group": 0 }
18
+ )
19
+ if query is not None:
20
+ group_ids = [x["group_id"] for x in query["group_details"]]
21
+ if group_id in group_ids:
22
+ return False
23
+
24
+ group_details = {
25
+ "group_id" : group_id
26
+ }
27
+
28
+ data = {
29
+ '_id': user_id,
30
+ 'group_details' : [group_details],
31
+ 'active_group' : group_id,
32
+ }
33
+
34
+ if mycol.count_documents( {"_id": user_id} ) == 0:
35
+ try:
36
+ mycol.insert_one(data)
37
+ return True
38
+ except:
39
+ logger.exception('Some error occurred!', exc_info=True)
40
+
41
+ else:
42
+ try:
43
+ mycol.update_one(
44
+ {'_id': user_id},
45
+ {
46
+ "$push": {"group_details": group_details},
47
+ "$set": {"active_group" : group_id}
48
+ }
49
+ )
50
+ return True
51
+ except:
52
+ logger.exception('Some error occurred!', exc_info=True)
53
+
54
+
55
+ async def active_connection(user_id):
56
+
57
+ query = mycol.find_one(
58
+ { "_id": user_id },
59
+ { "_id": 0, "group_details": 0 }
60
+ )
61
+ if not query:
62
+ return None
63
+
64
+ group_id = query['active_group']
65
+ return int(group_id) if group_id != None else None
66
+
67
+
68
+ async def all_connections(user_id):
69
+ query = mycol.find_one(
70
+ { "_id": user_id },
71
+ { "_id": 0, "active_group": 0 }
72
+ )
73
+ if query is not None:
74
+ return [x["group_id"] for x in query["group_details"]]
75
+ else:
76
+ return None
77
+
78
+
79
+ async def if_active(user_id, group_id):
80
+ query = mycol.find_one(
81
+ { "_id": user_id },
82
+ { "_id": 0, "group_details": 0 }
83
+ )
84
+ return query is not None and query['active_group'] == group_id
85
+
86
+
87
+ async def make_active(user_id, group_id):
88
+ update = mycol.update_one(
89
+ {'_id': user_id},
90
+ {"$set": {"active_group" : group_id}}
91
+ )
92
+ return update.modified_count != 0
93
+
94
+
95
+ async def make_inactive(user_id):
96
+ update = mycol.update_one(
97
+ {'_id': user_id},
98
+ {"$set": {"active_group" : None}}
99
+ )
100
+ return update.modified_count != 0
101
+
102
+
103
+ async def delete_connection(user_id, group_id):
104
+
105
+ try:
106
+ update = mycol.update_one(
107
+ {"_id": user_id},
108
+ {"$pull" : { "group_details" : {"group_id":group_id} } }
109
+ )
110
+ if update.modified_count == 0:
111
+ return False
112
+ query = mycol.find_one(
113
+ { "_id": user_id },
114
+ { "_id": 0 }
115
+ )
116
+ if len(query["group_details"]) >= 1:
117
+ if query['active_group'] == group_id:
118
+ prvs_group_id = query["group_details"][len(query["group_details"]) - 1]["group_id"]
119
+
120
+ mycol.update_one(
121
+ {'_id': user_id},
122
+ {"$set": {"active_group" : prvs_group_id}}
123
+ )
124
+ else:
125
+ mycol.update_one(
126
+ {'_id': user_id},
127
+ {"$set": {"active_group" : None}}
128
+ )
129
+ return True
130
+ except Exception as e:
131
+ logger.exception(f'Some error occurred! {e}', exc_info=True)
132
+ return False
133
+
database/filters_mdb.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymongo
2
+ from info import DATABASE_URI, DATABASE_NAME
3
+ from pyrogram import enums
4
+ import logging
5
+ logger = logging.getLogger(__name__)
6
+ logger.setLevel(logging.ERROR)
7
+
8
+ myclient = pymongo.MongoClient(DATABASE_URI)
9
+ mydb = myclient[DATABASE_NAME]
10
+
11
+
12
+
13
+ async def add_filter(grp_id, text, reply_text, btn, file, alert):
14
+ mycol = mydb[str(grp_id)]
15
+ # mycol.create_index([('text', 'text')])
16
+
17
+ data = {
18
+ 'text':str(text),
19
+ 'reply':str(reply_text),
20
+ 'btn':str(btn),
21
+ 'file':str(file),
22
+ 'alert':str(alert)
23
+ }
24
+
25
+ try:
26
+ mycol.update_one({'text': str(text)}, {"$set": data}, upsert=True)
27
+ except:
28
+ logger.exception('Some error occured!', exc_info=True)
29
+
30
+
31
+ async def find_filter(group_id, name):
32
+ mycol = mydb[str(group_id)]
33
+
34
+ query = mycol.find( {"text":name})
35
+ # query = mycol.find( { "$text": {"$search": name}})
36
+ try:
37
+ for file in query:
38
+ reply_text = file['reply']
39
+ btn = file['btn']
40
+ fileid = file['file']
41
+ try:
42
+ alert = file['alert']
43
+ except:
44
+ alert = None
45
+ return reply_text, btn, alert, fileid
46
+ except:
47
+ return None, None, None, None
48
+
49
+
50
+ async def get_filters(group_id):
51
+ mycol = mydb[str(group_id)]
52
+
53
+ texts = []
54
+ query = mycol.find()
55
+ try:
56
+ for file in query:
57
+ text = file['text']
58
+ texts.append(text)
59
+ except:
60
+ pass
61
+ return texts
62
+
63
+
64
+ async def delete_filter(message, text, group_id):
65
+ mycol = mydb[str(group_id)]
66
+
67
+ myquery = {'text':text }
68
+ query = mycol.count_documents(myquery)
69
+ if query == 1:
70
+ mycol.delete_one(myquery)
71
+ await message.reply_text(
72
+ f"'`{text}`' deleted. I'll not respond to that filter anymore.",
73
+ quote=True,
74
+ parse_mode=enums.ParseMode.MARKDOWN
75
+ )
76
+ else:
77
+ await message.reply_text("Couldn't find that filter!", quote=True)
78
+
79
+
80
+ async def del_all(message, group_id, title):
81
+ if str(group_id) not in mydb.list_collection_names():
82
+ await message.edit_text(f"Nothing to remove in {title}!")
83
+ return
84
+
85
+ mycol = mydb[str(group_id)]
86
+ try:
87
+ mycol.drop()
88
+ await message.edit_text(f"All filters from {title} has been removed")
89
+ except:
90
+ await message.edit_text("Couldn't remove all filters from group!")
91
+ return
92
+
93
+
94
+ async def count_filters(group_id):
95
+ mycol = mydb[str(group_id)]
96
+
97
+ count = mycol.count()
98
+ return False if count == 0 else count
99
+
100
+
101
+ async def filter_stats():
102
+ collections = mydb.list_collection_names()
103
+
104
+ if "CONNECTION" in collections:
105
+ collections.remove("CONNECTION")
106
+
107
+ totalcount = 0
108
+ for collection in collections:
109
+ mycol = mydb[collection]
110
+ count = mycol.count()
111
+ totalcount += count
112
+
113
+ totalcollections = len(collections)
114
+
115
+ return totalcollections, totalcount
database/gfilters_mdb.py ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymongo
2
+ from info import DATABASE_URI, DATABASE_NAME
3
+ from pyrogram import enums
4
+ import logging
5
+ logger = logging.getLogger(__name__)
6
+ logger.setLevel(logging.ERROR)
7
+
8
+ myclient = pymongo.MongoClient(DATABASE_URI)
9
+ mydb = myclient[DATABASE_NAME]
10
+
11
+
12
+
13
+ async def add_gfilter(gfilters, text, reply_text, btn, file, alert):
14
+ mycol = mydb[str(gfilters)]
15
+ # mycol.create_index([('text', 'text')])
16
+
17
+ data = {
18
+ 'text':str(text),
19
+ 'reply':str(reply_text),
20
+ 'btn':str(btn),
21
+ 'file':str(file),
22
+ 'alert':str(alert)
23
+ }
24
+
25
+ try:
26
+ mycol.update_one({'text': str(text)}, {"$set": data}, upsert=True)
27
+ except:
28
+ logger.exception('Some error occured!', exc_info=True)
29
+
30
+
31
+ async def find_gfilter(gfilters, name):
32
+ mycol = mydb[str(gfilters)]
33
+
34
+ query = mycol.find( {"text":name})
35
+ # query = mycol.find( { "$text": {"$search": name}})
36
+ try:
37
+ for file in query:
38
+ reply_text = file['reply']
39
+ btn = file['btn']
40
+ fileid = file['file']
41
+ try:
42
+ alert = file['alert']
43
+ except:
44
+ alert = None
45
+ return reply_text, btn, alert, fileid
46
+ except:
47
+ return None, None, None, None
48
+
49
+
50
+ async def get_gfilters(gfilters):
51
+ mycol = mydb[str(gfilters)]
52
+
53
+ texts = []
54
+ query = mycol.find()
55
+ try:
56
+ for file in query:
57
+ text = file['text']
58
+ texts.append(text)
59
+ except:
60
+ pass
61
+ return texts
62
+
63
+
64
+ async def delete_gfilter(message, text, gfilters):
65
+ mycol = mydb[str(gfilters)]
66
+
67
+ myquery = {'text':text }
68
+ query = mycol.count_documents(myquery)
69
+ if query == 1:
70
+ mycol.delete_one(myquery)
71
+ await message.reply_text(
72
+ f"'`{text}`' deleted. I'll not respond to that gfilter anymore.",
73
+ quote=True,
74
+ parse_mode=enums.ParseMode.MARKDOWN
75
+ )
76
+ else:
77
+ await message.reply_text("Couldn't find that gfilter!", quote=True)
78
+
79
+ async def del_allg(message, gfilters):
80
+ if str(gfilters) not in mydb.list_collection_names():
81
+ await message.edit_text("Nothing to Remove !")
82
+ return
83
+
84
+ mycol = mydb[str(gfilters)]
85
+ try:
86
+ mycol.drop()
87
+ await message.edit_text(f"All gfilters has been removed !")
88
+ except:
89
+ await message.edit_text("Couldn't remove all gfilters !")
90
+ return
91
+
92
+ async def count_gfilters(gfilters):
93
+ mycol = mydb[str(gfilters)]
94
+
95
+ count = mycol.count()
96
+ return False if count == 0 else count
97
+
98
+
99
+ async def gfilter_stats():
100
+ collections = mydb.list_collection_names()
101
+
102
+ if "CONNECTION" in collections:
103
+ collections.remove("CONNECTION")
104
+
105
+ totalcount = 0
106
+ for collection in collections:
107
+ mycol = mydb[collection]
108
+ count = mycol.count()
109
+ totalcount += count
110
+
111
+ totalcollections = len(collections)
112
+
113
+ return totalcollections, totalcount
database/ia_filterdb.py ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ from struct import pack
3
+ import re
4
+ import base64
5
+ from pyrogram.file_id import FileId
6
+ from pymongo.errors import DuplicateKeyError
7
+ from umongo import Instance, Document, fields
8
+ from motor.motor_asyncio import AsyncIOMotorClient
9
+ from marshmallow.exceptions import ValidationError
10
+ from info import DATABASE_URI, DATABASE_NAME, COLLECTION_NAME, USE_CAPTION_FILTER, MAX_B_TN
11
+ from utils import get_settings, save_group_settings
12
+
13
+ logger = logging.getLogger(__name__)
14
+ logger.setLevel(logging.INFO)
15
+
16
+
17
+ client = AsyncIOMotorClient(DATABASE_URI)
18
+ db = client[DATABASE_NAME]
19
+ instance = Instance.from_db(db)
20
+
21
+ @instance.register
22
+ class Media(Document):
23
+ file_id = fields.StrField(attribute='_id')
24
+ file_ref = fields.StrField(allow_none=True)
25
+ file_name = fields.StrField(required=True)
26
+ file_size = fields.IntField(required=True)
27
+ file_type = fields.StrField(allow_none=True)
28
+ mime_type = fields.StrField(allow_none=True)
29
+ caption = fields.StrField(allow_none=True)
30
+
31
+ class Meta:
32
+ indexes = ('$file_name', )
33
+ collection_name = COLLECTION_NAME
34
+
35
+
36
+ async def save_file(media):
37
+ """Save file in database"""
38
+
39
+ # TODO: Find better way to get same file_id for same media to avoid duplicates
40
+ file_id, file_ref = unpack_new_file_id(media.file_id)
41
+ file_name = re.sub(r"(_|\-|\.|\+)", " ", str(media.file_name))
42
+ try:
43
+ file = Media(
44
+ file_id=file_id,
45
+ file_ref=file_ref,
46
+ file_name=file_name,
47
+ file_size=media.file_size,
48
+ file_type=media.file_type,
49
+ mime_type=media.mime_type,
50
+ caption=media.caption.html if media.caption else None,
51
+ )
52
+ except ValidationError:
53
+ logger.exception('Error occurred while saving file in database')
54
+ return False, 2
55
+ else:
56
+ try:
57
+ await file.commit()
58
+ except DuplicateKeyError:
59
+ logger.warning(
60
+ f'{getattr(media, "file_name", "NO_FILE")} is already saved in database'
61
+ )
62
+
63
+ return False, 0
64
+ else:
65
+ logger.info(f'{getattr(media, "file_name", "NO_FILE")} is saved to database')
66
+ return True, 1
67
+
68
+
69
+
70
+ async def get_search_results(chat_id, query, file_type=None, max_results=10, offset=0, filter=False):
71
+ """For given query return (results, next_offset)"""
72
+ if chat_id is not None:
73
+ settings = await get_settings(int(chat_id))
74
+ try:
75
+ if settings['max_btn']:
76
+ max_results = 10
77
+ else:
78
+ max_results = int(MAX_B_TN)
79
+ except KeyError:
80
+ await save_group_settings(int(chat_id), 'max_btn', False)
81
+ settings = await get_settings(int(chat_id))
82
+ if settings['max_btn']:
83
+ max_results = 10
84
+ else:
85
+ max_results = int(MAX_B_TN)
86
+ query = query.strip()
87
+ #if filter:
88
+ #better ?
89
+ #query = query.replace(' ', r'(\s|\.|\+|\-|_)')
90
+ #raw_pattern = r'(\s|_|\-|\.|\+)' + query + r'(\s|_|\-|\.|\+)'
91
+ if not query:
92
+ raw_pattern = '.'
93
+ elif ' ' not in query:
94
+ raw_pattern = r'(\b|[\.\+\-_])' + query + r'(\b|[\.\+\-_])'
95
+ else:
96
+ raw_pattern = query.replace(' ', r'.*[\s\.\+\-_]')
97
+
98
+ try:
99
+ regex = re.compile(raw_pattern, flags=re.IGNORECASE)
100
+ except:
101
+ return []
102
+
103
+ if USE_CAPTION_FILTER:
104
+ filter = {'$or': [{'file_name': regex}, {'caption': regex}]}
105
+ else:
106
+ filter = {'file_name': regex}
107
+
108
+ if file_type:
109
+ filter['file_type'] = file_type
110
+
111
+ total_results = await Media.count_documents(filter)
112
+ next_offset = offset + max_results
113
+
114
+ if next_offset > total_results:
115
+ next_offset = ''
116
+
117
+ cursor = Media.find(filter)
118
+ # Sort by recent
119
+ cursor.sort('$natural', -1)
120
+ # Slice files according to offset and max results
121
+ cursor.skip(offset).limit(max_results)
122
+ # Get list of files
123
+ files = await cursor.to_list(length=max_results)
124
+
125
+ return files, next_offset, total_results
126
+
127
+ async def get_bad_files(query, file_type=None, filter=False):
128
+ """For given query return (results, next_offset)"""
129
+ query = query.strip()
130
+ #if filter:
131
+ #better ?
132
+ #query = query.replace(' ', r'(\s|\.|\+|\-|_)')
133
+ #raw_pattern = r'(\s|_|\-|\.|\+)' + query + r'(\s|_|\-|\.|\+)'
134
+ if not query:
135
+ raw_pattern = '.'
136
+ elif ' ' not in query:
137
+ raw_pattern = r'(\b|[\.\+\-_])' + query + r'(\b|[\.\+\-_])'
138
+ else:
139
+ raw_pattern = query.replace(' ', r'.*[\s\.\+\-_]')
140
+
141
+ try:
142
+ regex = re.compile(raw_pattern, flags=re.IGNORECASE)
143
+ except:
144
+ return []
145
+
146
+ if USE_CAPTION_FILTER:
147
+ filter = {'$or': [{'file_name': regex}, {'caption': regex}]}
148
+ else:
149
+ filter = {'file_name': regex}
150
+
151
+ if file_type:
152
+ filter['file_type'] = file_type
153
+
154
+ total_results = await Media.count_documents(filter)
155
+
156
+ cursor = Media.find(filter)
157
+ # Sort by recent
158
+ cursor.sort('$natural', -1)
159
+ # Get list of files
160
+ files = await cursor.to_list(length=total_results)
161
+
162
+ return files, total_results
163
+
164
+ async def get_file_details(query):
165
+ filter = {'file_id': query}
166
+ cursor = Media.find(filter)
167
+ filedetails = await cursor.to_list(length=1)
168
+ return filedetails
169
+
170
+
171
+ def encode_file_id(s: bytes) -> str:
172
+ r = b""
173
+ n = 0
174
+
175
+ for i in s + bytes([22]) + bytes([4]):
176
+ if i == 0:
177
+ n += 1
178
+ else:
179
+ if n:
180
+ r += b"\x00" + bytes([n])
181
+ n = 0
182
+
183
+ r += bytes([i])
184
+
185
+ return base64.urlsafe_b64encode(r).decode().rstrip("=")
186
+
187
+
188
+ def encode_file_ref(file_ref: bytes) -> str:
189
+ return base64.urlsafe_b64encode(file_ref).decode().rstrip("=")
190
+
191
+
192
+ def unpack_new_file_id(new_file_id):
193
+ """Return file_id, file_ref"""
194
+ decoded = FileId.decode(new_file_id)
195
+ file_id = encode_file_id(
196
+ pack(
197
+ "<iiqq",
198
+ int(decoded.file_type),
199
+ decoded.dc_id,
200
+ decoded.media_id,
201
+ decoded.access_hash
202
+ )
203
+ )
204
+ file_ref = encode_file_ref(decoded.file_reference)
205
+ return file_id, file_ref
database/users_chats_db.py ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://github.com/odysseusmax/animated-lamp/blob/master/bot/database/database.py
2
+ import motor.motor_asyncio
3
+ from info import DATABASE_NAME, DATABASE_URI, IMDB, IMDB_TEMPLATE, MELCOW_NEW_USERS, P_TTI_SHOW_OFF, SINGLE_BUTTON, SPELL_CHECK_REPLY, PROTECT_CONTENT, AUTO_DELETE, MAX_BTN, AUTO_FFILTER, SHORTLINK_API, SHORTLINK_URL, IS_SHORTLINK, TUTORIAL, IS_TUTORIAL
4
+ import datetime
5
+ import pytz
6
+
7
+ class Database:
8
+
9
+ def __init__(self, uri, database_name):
10
+ self._client = motor.motor_asyncio.AsyncIOMotorClient(uri)
11
+ self.db = self._client[database_name]
12
+ self.col = self.db.users
13
+ self.grp = self.db.groups
14
+ self.users = self.db.uersz
15
+ self.req = self.db.requests
16
+
17
+ async def find_join_req(self, id):
18
+ return bool(await self.req.find_one({'id': id}))
19
+
20
+ async def add_join_req(self, id):
21
+ await self.req.insert_one({'id': id})
22
+ async def del_join_req(self):
23
+ await self.req.drop()
24
+
25
+ def new_user(self, id, name):
26
+ return dict(
27
+ id = id,
28
+ name = name,
29
+ ban_status=dict(
30
+ is_banned=False,
31
+ ban_reason="",
32
+ ),
33
+ )
34
+
35
+
36
+ def new_group(self, id, title):
37
+ return dict(
38
+ id = id,
39
+ title = title,
40
+ chat_status=dict(
41
+ is_disabled=False,
42
+ reason="",
43
+ ),
44
+ )
45
+
46
+ async def add_user(self, id, name):
47
+ user = self.new_user(id, name)
48
+ await self.col.insert_one(user)
49
+
50
+ async def is_user_exist(self, id):
51
+ user = await self.col.find_one({'id':int(id)})
52
+ return bool(user)
53
+
54
+ async def total_users_count(self):
55
+ count = await self.col.count_documents({})
56
+ return count
57
+
58
+ async def remove_ban(self, id):
59
+ ban_status = dict(
60
+ is_banned=False,
61
+ ban_reason=''
62
+ )
63
+ await self.col.update_one({'id': id}, {'$set': {'ban_status': ban_status}})
64
+
65
+ async def ban_user(self, user_id, ban_reason="No Reason"):
66
+ ban_status = dict(
67
+ is_banned=True,
68
+ ban_reason=ban_reason
69
+ )
70
+ await self.col.update_one({'id': user_id}, {'$set': {'ban_status': ban_status}})
71
+
72
+ async def get_ban_status(self, id):
73
+ default = dict(
74
+ is_banned=False,
75
+ ban_reason=''
76
+ )
77
+ user = await self.col.find_one({'id':int(id)})
78
+ if not user:
79
+ return default
80
+ return user.get('ban_status', default)
81
+
82
+ async def get_all_users(self):
83
+ return self.col.find({})
84
+
85
+
86
+ async def delete_user(self, user_id):
87
+ await self.col.delete_many({'id': int(user_id)})
88
+
89
+
90
+ async def get_banned(self):
91
+ users = self.col.find({'ban_status.is_banned': True})
92
+ chats = self.grp.find({'chat_status.is_disabled': True})
93
+ b_chats = [chat['id'] async for chat in chats]
94
+ b_users = [user['id'] async for user in users]
95
+ return b_users, b_chats
96
+
97
+
98
+
99
+ async def add_chat(self, chat, title):
100
+ chat = self.new_group(chat, title)
101
+ await self.grp.insert_one(chat)
102
+
103
+
104
+ async def get_chat(self, chat):
105
+ chat = await self.grp.find_one({'id':int(chat)})
106
+ return False if not chat else chat.get('chat_status')
107
+
108
+
109
+ async def re_enable_chat(self, id):
110
+ chat_status=dict(
111
+ is_disabled=False,
112
+ reason="",
113
+ )
114
+ await self.grp.update_one({'id': int(id)}, {'$set': {'chat_status': chat_status}})
115
+
116
+ async def update_settings(self, id, settings):
117
+ await self.grp.update_one({'id': int(id)}, {'$set': {'settings': settings}})
118
+
119
+
120
+ async def get_settings(self, id):
121
+ default = {
122
+ 'button': SINGLE_BUTTON,
123
+ 'botpm': P_TTI_SHOW_OFF,
124
+ 'file_secure': PROTECT_CONTENT,
125
+ 'imdb': IMDB,
126
+ 'spell_check': SPELL_CHECK_REPLY,
127
+ 'welcome': MELCOW_NEW_USERS,
128
+ 'auto_delete': AUTO_DELETE,
129
+ 'auto_ffilter': AUTO_FFILTER,
130
+ 'max_btn': MAX_BTN,
131
+ 'template': IMDB_TEMPLATE,
132
+ 'shortlink': SHORTLINK_URL,
133
+ 'shortlink_api': SHORTLINK_API,
134
+ 'is_shortlink': IS_SHORTLINK,
135
+ 'tutorial': TUTORIAL,
136
+ 'is_tutorial': IS_TUTORIAL
137
+ }
138
+ chat = await self.grp.find_one({'id':int(id)})
139
+ if chat:
140
+ return chat.get('settings', default)
141
+ return default
142
+
143
+
144
+ async def disable_chat(self, chat, reason="No Reason"):
145
+ chat_status=dict(
146
+ is_disabled=True,
147
+ reason=reason,
148
+ )
149
+ await self.grp.update_one({'id': int(chat)}, {'$set': {'chat_status': chat_status}})
150
+
151
+
152
+ async def total_chat_count(self):
153
+ count = await self.grp.count_documents({})
154
+ return count
155
+
156
+
157
+ async def get_all_chats(self):
158
+ return self.grp.find({})
159
+
160
+
161
+ async def get_db_size(self):
162
+ return (await self.db.command("dbstats"))['dataSize']
163
+
164
+ async def get_user(self, user_id):
165
+ user_data = await self.users.find_one({"id": user_id})
166
+ return user_data
167
+ async def update_user(self, user_data):
168
+ await self.users.update_one({"id": user_data["id"]}, {"$set": user_data}, upsert=True)
169
+
170
+ async def has_premium_access(self, user_id):
171
+ user_data = await self.get_user(user_id)
172
+ if user_data:
173
+ expiry_time = user_data.get("expiry_time")
174
+ if expiry_time is None:
175
+ # User previously used the free trial, but it has ended.
176
+ return False
177
+ elif isinstance(expiry_time, datetime.datetime) and datetime.datetime.now() <= expiry_time:
178
+ return True
179
+ else:
180
+ await self.users.update_one({"id": user_id}, {"$set": {"expiry_time": None}})
181
+ return False
182
+
183
+ async def update_user(self, user_data):
184
+ await self.users.update_one({"id": user_data["id"]}, {"$set": user_data}, upsert=True)
185
+
186
+ async def update_one(self, filter_query, update_data):
187
+ try:
188
+ # Assuming self.client and self.users are set up properly
189
+ result = await self.users.update_one(filter_query, update_data)
190
+ return result.matched_count == 1
191
+ except Exception as e:
192
+ print(f"Error updating document: {e}")
193
+ return False
194
+
195
+ async def get_expired(self, current_time):
196
+ expired_users = []
197
+ if data := self.users.find({"expiry_time": {"$lt": current_time}}):
198
+ async for user in data:
199
+ expired_users.append(user)
200
+ return expired_users
201
+
202
+ async def remove_premium_access(self, user_id):
203
+ return await self.update_one(
204
+ {"id": user_id}, {"$set": {"expiry_time": None}}
205
+ )
206
+
207
+ async def check_trial_status(self, user_id):
208
+ user_data = await self.get_user(user_id)
209
+ if user_data:
210
+ return user_data.get("has_free_trial", False)
211
+ return False
212
+
213
+ async def give_free_trial(self, user_id):
214
+ #await set_free_trial_status(user_id)
215
+ user_id = user_id
216
+ seconds = 5*60
217
+ expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
218
+ user_data = {"id": user_id, "expiry_time": expiry_time, "has_free_trial": True}
219
+ await self.users.update_one({"id": user_id}, {"$set": user_data}, upsert=True)
220
+
221
+ db = Database(DATABASE_URI, DATABASE_NAME)
docker-compose.yml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.8"
2
+ services:
3
+ worker:
4
+ build: .
5
+ environment:
6
+ BOT_TOKEN: $BOT_TOKEN
7
+ API_ID: $API_ID
8
+ API_HASH: $API_HASH
9
+ CHANNELS: $CHANNELS
10
+ ADMINS: $ADMINS
11
+ LOG_CHANNEL: $LOG_CHANNEL
12
+ DATABASE_NAME: $DATABASE_NAME
13
+ DATABASE_URI: $DATABASE_URI
14
+ HEROKU_API_KEY: $HEROKU_API_KEY
env.sample ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ BOT_TOKEN=your_bot_token
2
+ API_ID=your_api_id
3
+ API_HASH=your_api_hash
4
+ DATABASE_URI=your_mongodb_uri
5
+ DATABASE_NAME=your_db_name
6
+ CHANNELS=-1001234567890
7
+ ADMINS=123456789
8
+ LOG_CHANNEL=-1009876543210
heroku.yml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ build:
2
+ docker:
3
+ worker: Dockerfile
huggingface.yml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ title: "TheMovieProviderBot Interface"
2
+ sdk: "gradio"
3
+ app_file: "app.py"
4
+ python_version: "3.10"
info.py ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ from os import environ,getenv
3
+ from Script import script
4
+
5
+ id_pattern = re.compile(r'^.\d+$')
6
+ def is_enabled(value, default):
7
+ if value.lower() in ["true", "yes", "1", "enable", "y"]:
8
+ return True
9
+ elif value.lower() in ["false", "no", "0", "disable", "n"]:
10
+ return False
11
+ else:
12
+ return default
13
+
14
+ # Bot information
15
+ SESSION = environ.get('SESSION', 'Media_search')
16
+ API_ID = int(environ.get('API_ID', ''))
17
+ API_HASH = environ.get('API_HASH', '')
18
+ BOT_TOKEN = environ.get('BOT_TOKEN', "")
19
+
20
+ # Bot settings
21
+ CACHE_TIME = int(environ.get('CACHE_TIME', 300))
22
+ USE_CAPTION_FILTER = bool(environ.get('USE_CAPTION_FILTER', True))
23
+
24
+ PICS = (environ.get('PICS', 'https://telegra.ph/file/65fe86fc02a73f6fcf0ce.jpg https://telegra.ph/file/6fa70325813885809a64a.jpg https://telegra.ph/file/e06afc1e7abbcd8d4213a.jpg https://telegra.ph/file/3f4040b320d9b7840200a.jpg https://telegra.ph/file/3950fad740fb8ea894df7.jpg')).split() #SAMPLE PIC
25
+ NOR_IMG = environ.get("NOR_IMG", "https://graph.org/file/e20b5fdaf217252964202.jpg")
26
+ MELCOW_VID = environ.get("MELCOW_VID", "https://telegra.ph/file/85d361ab4cb6511006022.mp4")
27
+ SPELL_IMG = environ.get("SPELL_IMG", "https://telegra.ph/file/86b7b7e2aa7e38f328902.jpg")
28
+ SUBSCRIPTION = (environ.get('SUBSCRIPTION', 'https://telegra.ph/file/734170f40b8169830d821.jpg'))
29
+ CODE = (environ.get('CODE', 'https://telegra.ph/file/72f425007b22d28bd935e.jpg'))
30
+
31
+ #stream link shortner
32
+ STREAM_SITE = (environ.get('STREAM_SITE', 'ziplinker.net'))
33
+ STREAM_API = (environ.get('STREAM_API', 'ae0832f39e24094a0661626a792e6a2b8880e310'))
34
+ STREAMHTO = (environ.get('STREAMHTO', 'https://t.me/HowToOpenLinkHP/69'))
35
+
36
+ # Admins, Channels & Users
37
+ ADMINS = [int(admin) if id_pattern.search(admin) else admin for admin in environ.get('ADMINS', '').split()]
38
+ CHANNELS = [int(ch) if id_pattern.search(ch) else ch for ch in environ.get('CHANNELS', '').split()] #Channel id for auto indexing ( make sure bot is admin )
39
+ auth_users = [int(user) if id_pattern.search(user) else user for user in environ.get('AUTH_USERS', '').split()]
40
+ AUTH_USERS = (auth_users + ADMINS) if auth_users else []
41
+ PREMIUM_USER = [int(user) if id_pattern.search(user) else user for user in environ.get('PREMIUM_USER', '').split()]
42
+ auth_channel = environ.get('AUTH_CHANNEL', '') #Channel / Group Id for force sub ( make sure bot is admin )
43
+ auth_grp = environ.get('AUTH_GROUP')
44
+ AUTH_CHANNEL = int(auth_channel) if auth_channel and id_pattern.search(auth_channel) else None
45
+ AUTH_GROUPS = [int(ch) for ch in auth_grp.split()] if auth_grp else None
46
+ support_chat_id = environ.get('SUPPORT_CHAT_ID', '') # support group id ( make sure bot is admin )
47
+ reqst_channel = environ.get('REQST_CHANNEL_ID', '') # request channel id ( make sure bot is admin )
48
+ REQST_CHANNEL = int(reqst_channel) if reqst_channel and id_pattern.search(reqst_channel) else None
49
+ SUPPORT_CHAT_ID = int(support_chat_id) if support_chat_id and id_pattern.search(support_chat_id) else None
50
+ NO_RESULTS_MSG = bool(environ.get("NO_RESULTS_MSG", False)) # True if you want no results messages in Log Channel
51
+
52
+ # MongoDB information
53
+ DATABASE_URI = environ.get('DATABASE_URI', "")
54
+ DATABASE_NAME = environ.get('DATABASE_NAME', "")
55
+ COLLECTION_NAME = environ.get('COLLECTION_NAME', 'Telegram_files')
56
+
57
+ # Verify
58
+ VERIFY = bool(environ.get('VERIFY', False)) # Verification On ( True ) / Off ( False )
59
+ HOWTOVERIFY = environ.get('HOWTOVERIFY', url='https://t.me/') # How to open tutorial link for verification
60
+
61
+ # Others
62
+ SHORTLINK_URL = environ.get('SHORTLINK_URL', 'instantearn.in')
63
+ SHORTLINK_API = environ.get('SHORTLINK_API', '1502a197c85d59929d50f1cba1d5e6f967d1e962')
64
+ IS_SHORTLINK = bool(environ.get('IS_SHORTLINK', False))
65
+ DELETE_CHANNELS = [int(dch) if id_pattern.search(dch) else dch for dch in environ.get('DELETE_CHANNELS', '0').split()]
66
+ MAX_B_TN = environ.get("MAX_B_TN", "5")
67
+ MAX_BTN = is_enabled((environ.get('MAX_BTN', "True")), True)
68
+ PORT = environ.get("PORT", "8080")
69
+ GRP_LNK = environ.get('GRP_LNK', 'https://t.me/')
70
+ CHNL_LNK = environ.get('CHNL_LNK', 'https://t.me/')
71
+ TUTORIAL = environ.get('TUTORIAL', 'https://t.me/') # Tutorial video link for opening shortlink website
72
+ IS_TUTORIAL = bool(environ.get('IS_TUTORIAL', True))
73
+ MSG_ALRT = environ.get('MSG_ALRT', 'ᴍᴀɪɴᴛᴀɪɴᴇᴅ ʙʏ : ʜᴘ')
74
+ LOG_CHANNEL = int(environ.get('LOG_CHANNEL', '')) #Log channel id ( make sure bot is admin )
75
+ SUPPORT_CHAT = environ.get('SUPPORT_CHAT', 'https://t.me/') #Support group link ( make sure bot is admin )
76
+ P_TTI_SHOW_OFF = is_enabled((environ.get('P_TTI_SHOW_OFF', "False")), False)
77
+ IMDB = is_enabled((environ.get('IMDB', "False")), False)
78
+ AUTO_FFILTER = is_enabled((environ.get('AUTO_FFILTER', "True")), True)
79
+ AUTO_DELETE = is_enabled((environ.get('AUTO_DELETE', "True")), True)
80
+ SINGLE_BUTTON = is_enabled((environ.get('SINGLE_BUTTON', "True")), True)
81
+ CUSTOM_FILE_CAPTION = environ.get("CUSTOM_FILE_CAPTION", f"{script.CAPTION}")
82
+ BATCH_FILE_CAPTION = environ.get("BATCH_FILE_CAPTION", CUSTOM_FILE_CAPTION)
83
+ IMDB_TEMPLATE = environ.get("IMDB_TEMPLATE", f"{script.IMDB_TEMPLATE_TXT}")
84
+ LONG_IMDB_DESCRIPTION = is_enabled(environ.get("LONG_IMDB_DESCRIPTION", "False"), False)
85
+ SPELL_CHECK_REPLY = is_enabled(environ.get("SPELL_CHECK_REPLY", "True"), True)
86
+ MAX_LIST_ELM = environ.get("MAX_LIST_ELM", None)
87
+ INDEX_REQ_CHANNEL = int(environ.get('INDEX_REQ_CHANNEL', LOG_CHANNEL))
88
+ FILE_STORE_CHANNEL = [int(ch) for ch in (environ.get('FILE_STORE_CHANNEL', '')).split()]
89
+ MELCOW_NEW_USERS = is_enabled((environ.get('MELCOW_NEW_USERS', "True")), True)
90
+ PROTECT_CONTENT = is_enabled((environ.get('PROTECT_CONTENT', "True")), True)
91
+ PUBLIC_FILE_STORE = is_enabled((environ.get('PUBLIC_FILE_STORE', "True")), True)
92
+
93
+ LANGUAGES = ["malayalam", "", "tamil", "", "english", "", "hindi", "", "telugu", "", "kannada", "", "gujarati", "", "marathi", "", "punjabi", ""]
94
+
95
+ SEASONS = ["season 1" , "season 2" , "season 3" , "season 4", "season 5" , "season 6" , "season 7" , "season 8" , "season 9" , "season 10"]
96
+
97
+ QUALITIES = ["360P", "", "480P", "", "720P", "", "1080P", "", "1440P", "", "2160P", ""]
98
+
99
+ # Online Stream and Download
100
+ NO_PORT = bool(environ.get('NO_PORT', False))
101
+ APP_NAME = None
102
+ if 'DYNO' in environ:
103
+ ON_HEROKU = True
104
+ APP_NAME = environ.get('APP_NAME')
105
+ else:
106
+ ON_HEROKU = False
107
+ BIND_ADRESS = str(getenv('WEB_SERVER_BIND_ADDRESS', '0.0.0.0'))
108
+ FQDN = str(getenv('FQDN', BIND_ADRESS)) if not ON_HEROKU or getenv('FQDN') else APP_NAME+'.herokuapp.com'
109
+ URL = "https://{}/".format(FQDN) if ON_HEROKU or NO_PORT else \
110
+ "https://{}/".format(FQDN, PORT)
111
+ SLEEP_THRESHOLD = int(environ.get('SLEEP_THRESHOLD', '60'))
112
+ WORKERS = int(environ.get('WORKERS', '4'))
113
+ SESSION_NAME = str(environ.get('SESSION_NAME', 'LazyBot'))
114
+ MULTI_CLIENT = False
115
+ name = str(environ.get('name', 'LazyPrincess'))
116
+ PING_INTERVAL = int(environ.get("PING_INTERVAL", "1200")) # 20 minutes
117
+ if 'DYNO' in environ:
118
+ ON_HEROKU = True
119
+ APP_NAME = str(getenv('APP_NAME'))
120
+
121
+ else:
122
+ ON_HEROKU = False
123
+ HAS_SSL=bool(getenv('HAS_SSL',True))
124
+ if HAS_SSL:
125
+ URL = "https://{}/".format(FQDN)
126
+ else:
127
+ URL = "http://{}/".format(FQDN)
128
+
129
+ # add premium logs channel id
130
+ PREMIUM_LOGS = int(environ.get('PREMIUM_LOGS', ''))
131
+
132
+ LOG_STR = "Current Cusomized Configurations are:-\n"
133
+ LOG_STR += ("IMDB Results are enabled, Bot will be showing imdb details for you queries.\n" if IMDB else "IMBD Results are disabled.\n")
134
+ LOG_STR += ("P_TTI_SHOW_OFF found , Users will be redirected to send /start to Bot PM instead of sending file file directly\n" if P_TTI_SHOW_OFF else "P_TTI_SHOW_OFF is disabled files will be send in PM, instead of sending start.\n")
135
+ LOG_STR += ("SINGLE_BUTTON is Found, filename and files size will be shown in a single button instead of two separate buttons\n" if SINGLE_BUTTON else "SINGLE_BUTTON is disabled , filename and file_sixe will be shown as different buttons\n")
136
+ LOG_STR += (f"CUSTOM_FILE_CAPTION enabled with value {CUSTOM_FILE_CAPTION}, your files will be send along with this customized caption.\n" if CUSTOM_FILE_CAPTION else "No CUSTOM_FILE_CAPTION Found, Default captions of file will be used.\n")
137
+ LOG_STR += ("Long IMDB storyline enabled." if LONG_IMDB_DESCRIPTION else "LONG_IMDB_DESCRIPTION is disabled , Plot will be shorter.\n")
138
+ LOG_STR += ("Spell Check Mode Is Enabled, bot will be suggesting related movies if movie not found\n" if SPELL_CHECK_REPLY else "SPELL_CHECK_REPLY Mode disabled\n")
139
+ LOG_STR += (f"MAX_LIST_ELM Found, long list will be shortened to first {MAX_LIST_ELM} elements\n" if MAX_LIST_ELM else "Full List of casts and crew will be shown in imdb template, restrict them by adding a value to MAX_LIST_ELM\n")
140
+ LOG_STR += f"Your current IMDB template is {IMDB_TEMPLATE}"
lazybot/__init__.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import logging.config
3
+ logging.config.fileConfig('logging.conf')
4
+ logging.getLogger().setLevel(logging.INFO)
5
+ logging.getLogger("pyrogram").setLevel(logging.ERROR)
6
+ logging.getLogger("imdbpy").setLevel(logging.ERROR)
7
+ logging.basicConfig(
8
+ level=logging.INFO,
9
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
10
+ )
11
+ logging.getLogger("aiohttp").setLevel(logging.ERROR)
12
+ logging.getLogger("aiohttp.web").setLevel(logging.ERROR)
13
+
14
+ from pyrogram import Client
15
+ from database.ia_filterdb import Media
16
+ from info import *
17
+ from utils import temp
18
+ from typing import Union, Optional, AsyncGenerator
19
+ from pyrogram import types
20
+ from aiohttp import web
21
+
22
+ from pyrogram import Client
23
+ from info import *
24
+
25
+
26
+ class LazyPrincessXBot(Client):
27
+
28
+ def __init__(self):
29
+ super().__init__(
30
+ name=SESSION,
31
+ api_id=API_ID,
32
+ api_hash=API_HASH,
33
+ bot_token=BOT_TOKEN,
34
+ workers=50,
35
+ plugins={"root": "plugins"},
36
+ sleep_threshold=5,
37
+ )
38
+ async def iter_messages(
39
+ self,
40
+ chat_id: Union[int, str],
41
+ limit: int,
42
+ offset: int = 0,
43
+ ) -> Optional[AsyncGenerator["types.Message", None]]:
44
+ """Iterate through a chat sequentially.
45
+ This convenience method does the same as repeatedly calling :meth:`~pyrogram.Client.get_messages` in a loop, thus saving
46
+ you from the hassle of setting up boilerplate code. It is useful for getting the whole chat messages with a
47
+ single call.
48
+ Parameters:
49
+ chat_id (``int`` | ``str``):
50
+ Unique identifier (int) or username (str) of the target chat.
51
+ For your personal cloud (Saved Messages) you can simply use "me" or "self".
52
+ For a contact that exists in your Telegram address book you can use his phone number (str).
53
+
54
+ limit (``int``):
55
+ Identifier of the last message to be returned.
56
+
57
+ offset (``int``, *optional*):
58
+ Identifier of the first message to be returned.
59
+ Defaults to 0.
60
+ Returns:
61
+ ``Generator``: A generator yielding :obj:`~pyrogram.types.Message` objects.
62
+ Example:
63
+ .. code-block:: python
64
+ for message in app.iter_messages("pyrogram", 1, 15000):
65
+ print(message.text)
66
+ """
67
+ current = offset
68
+ while True:
69
+ new_diff = min(200, limit - current)
70
+ if new_diff <= 0:
71
+ return
72
+ messages = await self.get_messages(chat_id, list(range(current, current+new_diff+1)))
73
+ for message in messages:
74
+ yield message
75
+ current += 1
76
+
77
+ LazyPrincessBot = LazyPrincessXBot()
78
+
79
+ multi_clients = {}
80
+ work_loads = {}
lazybot/clients.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import logging
3
+ from info import *
4
+ from pyrogram import Client
5
+ from util.config_parser import TokenParser
6
+ from . import multi_clients, work_loads, LazyPrincessBot
7
+
8
+
9
+ async def initialize_clients():
10
+ multi_clients[0] = LazyPrincessBot
11
+ work_loads[0] = 0
12
+ all_tokens = TokenParser().parse_from_env()
13
+ if not all_tokens:
14
+ print("No additional clients found, using default client")
15
+ return
16
+
17
+ async def start_client(client_id, token):
18
+ try:
19
+ print(f"Starting - Client {client_id}")
20
+ if client_id == len(all_tokens):
21
+ await asyncio.sleep(2)
22
+ print("This will take some time, please wait...")
23
+ client = await Client(
24
+ name=str(client_id),
25
+ api_id=API_ID,
26
+ api_hash=API_HASH,
27
+ bot_token=token,
28
+ sleep_threshold=SLEEP_THRESHOLD,
29
+ no_updates=True,
30
+ in_memory=True
31
+ ).start()
32
+ work_loads[client_id] = 0
33
+ return client_id, client
34
+ except Exception:
35
+ logging.error(f"Failed starting Client - {client_id} Error:", exc_info=True)
36
+
37
+ clients = await asyncio.gather(*[start_client(i, token) for i, token in all_tokens.items()])
38
+ multi_clients.update(dict(clients))
39
+ if len(multi_clients) != 1:
40
+ MULTI_CLIENT = True
41
+ print("Multi-Client Mode Enabled")
42
+ else:
43
+ print("No additional clients were initialized, using default client")
logging.conf ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [loggers]
2
+ keys=root
3
+
4
+ [handlers]
5
+ keys=consoleHandler,fileHandler
6
+
7
+ [formatters]
8
+ keys=consoleFormatter,fileFormatter
9
+
10
+ [logger_root]
11
+ level=DEBUG
12
+ handlers=consoleHandler,fileHandler
13
+
14
+ [handler_consoleHandler]
15
+ class=StreamHandler
16
+ level=INFO
17
+ formatter=consoleFormatter
18
+ args=(sys.stdout,)
19
+
20
+ [handler_fileHandler]
21
+ class=FileHandler
22
+ level=ERROR
23
+ formatter=fileFormatter
24
+ args=('TELEGRAM BOT.LOG','w',)
25
+
26
+ [formatter_consoleFormatter]
27
+ format=%(asctime)s - %(lineno)d - %(name)s - %(module)s - %(levelname)s - %(message)s
28
+ datefmt=%I:%M:%S %p
29
+
30
+ [formatter_fileFormatter]
31
+ format=[%(asctime)s:%(name)s:%(lineno)d:%(levelname)s] %(message)s
32
+ datefmt=%m/%d/%Y %I:%M:%S %p
plugins/Premium.py ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPECIAL THANKS TO [Rishikesh Sharma] @Rk_botowner FOR THESE AMAZING CODES
2
+ # SPECIAL THANKS TO @DeletedFromEarth FOR MODIFYING THESE AMAZING CODES
3
+
4
+ from datetime import timedelta
5
+ import pytz
6
+ import datetime, time
7
+ from Script import script
8
+ from info import ADMINS, PREMIUM_LOGS
9
+ from utils import get_seconds
10
+ from database.users_chats_db import db
11
+ from pyrogram import Client, filters
12
+ from pyrogram.errors.exceptions.bad_request_400 import MessageTooLong
13
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
14
+
15
+ @Client.on_message(filters.command("remove_premium") & filters.user(ADMINS))
16
+ async def remove_premium(client, message):
17
+ if len(message.command) == 2:
18
+ user_id = int(message.command[1]) # Convert the user_id to integer
19
+ user = await client.get_users(user_id)
20
+ if await db.remove_premium_access(user_id):
21
+ await message.reply_text("ᴜꜱᴇʀ ʀᴇᴍᴏᴠᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ !")
22
+ await client.send_message(
23
+ chat_id=user_id,
24
+ text=f"<b>ʜᴇʏ {user.mention},\n\nʏᴏᴜʀ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇss ʜᴀs ʙᴇᴇɴ ʀᴇᴍᴏᴠᴇᴅ.\nᴛʜᴀɴᴋ ʏᴏᴜ ꜰᴏʀ ᴜsɪɴɢ ᴏᴜʀ sᴇʀᴠɪᴄᴇ 😊\nᴄʟɪᴄᴋ ᴏɴ /plan ᴛᴏ ᴄʜᴇᴄᴋ ᴏᴜᴛ ᴏᴛʜᴇʀ ᴘʟᴀɴꜱ.</b>"
25
+ )
26
+ else:
27
+ await message.reply_text("ᴜɴᴀʙʟᴇ ᴛᴏ ʀᴇᴍᴏᴠᴇ ᴜꜱᴇᴅ !\nᴀʀᴇ ʏᴏᴜ ꜱᴜʀᴇ, ɪᴛ ᴡᴀꜱ ᴀ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ ɪᴅ ?")
28
+ else:
29
+ await message.reply_text("ᴜꜱᴀɢᴇ : /remove_premium user_id")
30
+
31
+ @Client.on_message(filters.command("myplan"))
32
+ async def myplan(client, message):
33
+ user = message.from_user.mention
34
+ user_id = message.from_user.id
35
+ data = await db.get_user(message.from_user.id) # Convert the user_id to integer
36
+ if data and data.get("expiry_time"):
37
+ #expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=data)
38
+ expiry = data.get("expiry_time")
39
+ expiry_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata"))
40
+ expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
41
+ # Calculate time difference
42
+ current_time = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
43
+ time_left = expiry_ist - current_time
44
+
45
+ # Calculate days, hours, and minutes
46
+ days = time_left.days
47
+ hours, remainder = divmod(time_left.seconds, 3600)
48
+ minutes, seconds = divmod(remainder, 60)
49
+
50
+ # Format time left as a string
51
+ time_left_str = f"{days} ᴅᴀʏꜱ, {hours} ʜᴏᴜʀꜱ, {minutes} ᴍɪɴᴜᴛᴇꜱ"
52
+ await message.reply_text(f"⚜️ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ ᴅᴀᴛᴀ :\n\n👤 ᴜꜱᴇʀ : {user}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\n⏰ ᴛɪᴍᴇ ʟᴇꜰᴛ : {time_left_str}\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}")
53
+ else:
54
+ await message.reply_text(f"ʜᴇʏ {user},\n\nʏᴏᴜ ᴅᴏ ɴᴏᴛ ʜᴀᴠᴇ ᴀɴʏ ᴀᴄᴛɪᴠᴇ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴs, ɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴛᴀᴋᴇ ᴘʀᴇᴍɪᴜᴍ ᴛʜᴇɴ ᴄʟɪᴄᴋ ᴏɴ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ 👇",
55
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("💸 ᴄʜᴇᴄᴋᴏᴜᴛ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴꜱ 💸", callback_data='seeplans')]]))
56
+
57
+ @Client.on_message(filters.command("get_premium") & filters.user(ADMINS))
58
+ async def get_premium(client, message):
59
+ if len(message.command) == 2:
60
+ user_id = int(message.command[1])
61
+ user = await client.get_users(user_id)
62
+ data = await db.get_user(user_id) # Convert the user_id to integer
63
+ if data and data.get("expiry_time"):
64
+ #expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=data)
65
+ expiry = data.get("expiry_time")
66
+ expiry_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata"))
67
+ expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
68
+ # Calculate time difference
69
+ current_time = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
70
+ time_left = expiry_ist - current_time
71
+
72
+ # Calculate days, hours, and minutes
73
+ days = time_left.days
74
+ hours, remainder = divmod(time_left.seconds, 3600)
75
+ minutes, seconds = divmod(remainder, 60)
76
+
77
+ # Format time left as a string
78
+ time_left_str = f"{days} days, {hours} hours, {minutes} minutes"
79
+ await message.reply_text(f"⚜️ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ ᴅᴀᴛᴀ :\n\n👤 ᴜꜱᴇʀ : {user.mention}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\n⏰ ᴛɪᴍᴇ ʟᴇꜰᴛ : {time_left_str}\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛ�� : {expiry_str_in_ist}")
80
+ else:
81
+ await message.reply_text("ɴᴏ ᴀɴʏ ᴘʀᴇᴍɪᴜᴍ ᴅᴀᴛᴀ ᴏꜰ ᴛʜᴇ ᴡᴀꜱ ꜰᴏᴜɴᴅ ɪɴ ᴅᴀᴛᴀʙᴀꜱᴇ !")
82
+ else:
83
+ await message.reply_text("ᴜꜱᴀɢᴇ : /get_premium user_id")
84
+
85
+ @Client.on_message(filters.command("add_premium") & filters.user(ADMINS))
86
+ async def give_premium_cmd_handler(client, message):
87
+ if len(message.command) == 4:
88
+ time_zone = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
89
+ current_time = time_zone.strftime("%d-%m-%Y\n⏱️ ᴊᴏɪɴɪɴɢ ᴛɪᴍᴇ : %I:%M:%S %p")
90
+ user_id = int(message.command[1]) # Convert the user_id to integer
91
+ user = await client.get_users(user_id)
92
+ time = message.command[2]+" "+message.command[3]
93
+ seconds = await get_seconds(time)
94
+ if seconds > 0:
95
+ expiry_time = datetime.datetime.now() + datetime.timedelta(seconds=seconds)
96
+ user_data = {"id": user_id, "expiry_time": expiry_time} # Using "id" instead of "user_id"
97
+ await db.update_user(user_data) # Use the update_user method to update or insert user data
98
+ data = await db.get_user(user_id)
99
+ expiry = data.get("expiry_time")
100
+ expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
101
+ await message.reply_text(f"ᴘʀᴇᴍɪᴜᴍ ᴀᴅᴅᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ✅\n\n👤 ᴜꜱᴇʀ : {user.mention}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time}</code>\n\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", disable_web_page_preview=True)
102
+ await client.send_message(
103
+ chat_id=user_id,
104
+ 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
105
+ )
106
+ await client.send_message(PREMIUM_LOGS, text=f"#Added_Premium\n\n👤 ᴜꜱᴇʀ : {user.mention}\n⚡ ᴜꜱᴇʀ ɪᴅ : <code>{user_id}</code>\n⏰ ᴘʀᴇᴍɪᴜᴍ ᴀᴄᴄᴇꜱꜱ : <code>{time}</code>\n\n⏳ ᴊᴏɪɴɪɴɢ ᴅᴀᴛᴇ : {current_time}\n\n⌛️ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}", disable_web_page_preview=True)
107
+
108
+ else:
109
+ await message.reply_text("Invalid time format. Please use '1 day for days', '1 hour for hours', or '1 min for minutes', or '1 month for months' or '1 year for year'")
110
+ else:
111
+ await message.reply_text("Usage : /add_premium 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')")
112
+
113
+ @Client.on_message(filters.command("premium_users") & filters.user(ADMINS))
114
+ async def premium_user(client, message):
115
+ aa = await message.reply_text("<i>ꜰᴇᴛᴄʜɪɴɢ...</i>")
116
+ new = f"⚜️ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀꜱ ʟɪꜱᴛ :\n\n"
117
+ user_count = 1
118
+ users = await db.get_all_users()
119
+ async for user in users:
120
+ data = await db.get_user(user['id'])
121
+ if data and data.get("expiry_time"):
122
+ expiry = data.get("expiry_time")
123
+ expiry_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata"))
124
+ expiry_str_in_ist = expiry.astimezone(pytz.timezone("Asia/Kolkata")).strftime("%d-%m-%Y\n⏱️ ᴇxᴘɪʀʏ ᴛɪᴍᴇ : %I:%M:%S %p")
125
+ current_time = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
126
+ time_left = expiry_ist - current_time
127
+ days = time_left.days
128
+ hours, remainder = divmod(time_left.seconds, 3600)
129
+ minutes, seconds = divmod(remainder, 60)
130
+ time_left_str = f"{days} days, {hours} hours, {minutes} minutes"
131
+ new += f"{user_count}. {(await client.get_users(user['id'])).mention}\n👤 ᴜꜱᴇʀ ɪᴅ : {user['id']}\n⏳ ᴇxᴘɪʀʏ ᴅᴀᴛᴇ : {expiry_str_in_ist}\n⏰ ᴛɪᴍᴇ ʟᴇꜰᴛ : {time_left_str}\n"
132
+ user_count += 1
133
+ else:
134
+ pass
135
+ try:
136
+ await aa.edit_text(new)
137
+ except MessageTooLong:
138
+ with open('usersplan.txt', 'w+') as outfile:
139
+ outfile.write(new)
140
+ await message.reply_document('usersplan.txt', caption="Paid Users:")
141
+
142
+
143
+
144
+ @Client.on_message(filters.command("plan"))
145
+ async def plan(client, message):
146
+ user_id = message.from_user.id
147
+ users = message.from_user.mention
148
+ btn = [[
149
+
150
+ InlineKeyboardButton("📲 ꜱᴇɴᴅ ᴘᴀʏᴍᴇɴᴛ ꜱᴄʀᴇᴇɴꜱʜᴏᴛ ʜᴇʀᴇ", user_id=int(767250672))],[InlineKeyboardButton("❌ ᴄʟᴏꜱᴇ ❌", callback_data="close_data")
151
+ ]]
152
+ await message.reply_photo(photo="https://telegra.ph/file/734170f40b8169830d821.jpg", caption=script.PREMIUM_TEXT.format(message.from_user.mention), reply_markup=InlineKeyboardMarkup(btn))
153
+
154
+ # SPECIAL THANKS TO [Rishikesh Sharma] @Rk_botowner FOR THESE AMAZING CODES
155
+ # SPECIAL THANKS TO @DeletedFromEarth FOR MODIFYING THESE AMAZING CODES
plugins/__init__.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from aiohttp import web
2
+ from .route import routes
3
+
4
+
5
+ async def web_server():
6
+ web_app = web.Application(client_max_size=30000000)
7
+ web_app.add_routes(routes)
8
+ return web_app
plugins/banned.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import Client, filters
2
+ from utils import temp
3
+ from pyrogram.types import Message
4
+ from database.users_chats_db import db
5
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
6
+ from info import SUPPORT_CHAT
7
+
8
+ async def banned_users(_, client, message: Message):
9
+ return (
10
+ message.from_user is not None or not message.sender_chat
11
+ ) and message.from_user.id in temp.BANNED_USERS
12
+
13
+ banned_user = filters.create(banned_users)
14
+
15
+ async def disabled_chat(_, client, message: Message):
16
+ return message.chat.id in temp.BANNED_CHATS
17
+
18
+ disabled_group=filters.create(disabled_chat)
19
+
20
+
21
+ @Client.on_message(filters.private & banned_user & filters.incoming)
22
+ async def ban_reply(bot, message):
23
+ ban = await db.get_ban_status(message.from_user.id)
24
+ await message.reply(f'Sorry Dude, You are Banned to use Me. \nBan Reason : {ban["ban_reason"]}')
25
+
26
+ @Client.on_message(filters.group & disabled_group & filters.incoming)
27
+ async def grp_bd(bot, message):
28
+ buttons = [[
29
+ InlineKeyboardButton('Support', url=f'https://t.me/HpRequestBot')
30
+ ]]
31
+ reply_markup=InlineKeyboardMarkup(buttons)
32
+ vazha = await db.get_chat(message.chat.id)
33
+ k = await message.reply(
34
+ text=f"CHAT NOT ALLOWED 🐞\n\nMy admins has restricted me from working here ! If you want to know more about it contact support..\nReason : <code>{vazha['reason']}</code>.",
35
+ reply_markup=reply_markup)
36
+ try:
37
+ await k.pin()
38
+ except:
39
+ pass
40
+ await bot.leave_chat(message.chat.id)
plugins/broadcast.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import Client, filters
2
+ import datetime
3
+ import time
4
+ from database.users_chats_db import db
5
+ from info import ADMINS
6
+ from utils import broadcast_messages, broadcast_messages_group
7
+ import asyncio
8
+
9
+ @Client.on_message(filters.command("broadcast") & filters.user(ADMINS) & filters.reply)
10
+ # https://t.me/GetTGLink/4178
11
+ async def verupikkals(bot, message):
12
+ users = await db.get_all_users()
13
+ b_msg = message.reply_to_message
14
+ sts = await message.reply_text(
15
+ text='Broadcasting your messages...'
16
+ )
17
+ start_time = time.time()
18
+ total_users = await db.total_users_count()
19
+ done = 0
20
+ blocked = 0
21
+ deleted = 0
22
+ failed =0
23
+
24
+ success = 0
25
+ async for user in users:
26
+ pti, sh = await broadcast_messages(int(user['id']), b_msg)
27
+ if pti:
28
+ success += 1
29
+ elif pti == False:
30
+ if sh == "Blocked":
31
+ blocked+=1
32
+ elif sh == "Deleted":
33
+ deleted += 1
34
+ elif sh == "Error":
35
+ failed += 1
36
+ done += 1
37
+ await asyncio.sleep(2)
38
+ if not done % 20:
39
+ await sts.edit(f"Broadcast in progress:\n\nTotal Users {total_users}\nCompleted: {done} / {total_users}\nSuccess: {success}\nBlocked: {blocked}\nDeleted: {deleted}")
40
+ time_taken = datetime.timedelta(seconds=int(time.time()-start_time))
41
+ await sts.edit(f"Broadcast Completed:\nCompleted in {time_taken} seconds.\n\nTotal Users {total_users}\nCompleted: {done} / {total_users}\nSuccess: {success}\nBlocked: {blocked}\nDeleted: {deleted}")
42
+
43
+ @Client.on_message(filters.command("grp_broadcast") & filters.user(ADMINS) & filters.reply)
44
+ async def broadcast_group(bot, message):
45
+ groups = await db.get_all_chats()
46
+ b_msg = message.reply_to_message
47
+ sts = await message.reply_text(
48
+ text='Broadcasting your messages To Groups...'
49
+ )
50
+ start_time = time.time()
51
+ total_groups = await db.total_chat_count()
52
+ done = 0
53
+ failed =0
54
+
55
+ success = 0
56
+ async for group in groups:
57
+ pti, sh = await broadcast_messages_group(int(group['id']), b_msg)
58
+ if pti:
59
+ success += 1
60
+ elif sh == "Error":
61
+ failed += 1
62
+ done += 1
63
+ if not done % 20:
64
+ await sts.edit(f"Broadcast in progress:\n\nTotal Groups {total_groups}\nCompleted: {done} / {total_groups}\nSuccess: {success}")
65
+ time_taken = datetime.timedelta(seconds=int(time.time()-start_time))
66
+ await sts.edit(f"Broadcast Completed:\nCompleted in {time_taken} seconds.\n\nTotal Groups {total_groups}\nCompleted: {done} / {total_groups}\nSuccess: {success}")
67
+
plugins/channel.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import Client, filters
2
+ from info import CHANNELS
3
+ from database.ia_filterdb import save_file
4
+
5
+ media_filter = filters.document | filters.video | filters.audio
6
+
7
+
8
+ @Client.on_message(filters.chat(CHANNELS) & media_filter)
9
+ async def media(bot, message):
10
+ """Media Handler"""
11
+ for file_type in ("document", "video", "audio"):
12
+ media = getattr(message, file_type, None)
13
+ if media is not None:
14
+ break
15
+ else:
16
+ return
17
+
18
+ media.file_type = file_type
19
+ media.caption = message.caption
20
+ await save_file(media)
plugins/commands.py ADDED
@@ -0,0 +1,1272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import logging
3
+ import random
4
+ import asyncio
5
+ import pytz
6
+ from Script import script
7
+ from datetime import datetime
8
+ from pyrogram import Client, filters, enums
9
+ from pyrogram.errors import ChatAdminRequired, FloodWait
10
+ from pyrogram.types import *
11
+ from database.ia_filterdb import Media, get_file_details, unpack_new_file_id, get_bad_files
12
+ from database.users_chats_db import db
13
+ from info import CHANNELS, ADMINS, AUTH_CHANNEL, LOG_CHANNEL, PICS, BATCH_FILE_CAPTION, CUSTOM_FILE_CAPTION, PROTECT_CONTENT, CHNL_LNK, GRP_LNK, REQST_CHANNEL, SUPPORT_CHAT_ID, SUPPORT_CHAT, MAX_B_TN, VERIFY, HOWTOVERIFY, SHORTLINK_API, SHORTLINK_URL, TUTORIAL, IS_TUTORIAL, PREMIUM_USER, PICS, SUBSCRIPTION
14
+ from utils import get_settings, get_size, is_req_subscribed, save_group_settings, temp, verify_user, check_token, check_verification, get_token, get_shortlink, get_tutorial
15
+ from database.connections_mdb import active_connection
16
+ # from plugins.pm_filter import ENABLE_SHORTLINK
17
+ import re, asyncio, os, sys
18
+ import json
19
+ import base64
20
+ logger = logging.getLogger(__name__)
21
+
22
+ TIMEZONE = "Asia/Kolkata"
23
+ BATCH_FILES = {}
24
+
25
+ @Client.on_message(filters.command("start") & filters.incoming)
26
+ async def start(client, message):
27
+ if message.chat.type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
28
+ buttons = [[
29
+ InlineKeyboardButton('☆ ᴀᴅᴅ ᴍᴇ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ ☆', url=f'http://t.me/{temp.U_NAME}?startgroup=true')
30
+ ],[
31
+ InlineKeyboardButton('🍁 ʜᴏᴡ ᴛᴏ ᴜꜱᴇ 🍁', url="https://t.me/{temp.U_NAME}?start=help")
32
+ ]]
33
+ reply_markup = InlineKeyboardMarkup(buttons)
34
+ await message.reply(script.GSTART_TXT.format(message.from_user.mention if message.from_user else message.chat.title, temp.U_NAME, temp.B_NAME), reply_markup=reply_markup, disable_web_page_preview=True)
35
+ await asyncio.sleep(2) # 😢 https://github.com/EvamariaTG/EvaMaria/blob/master/plugins/p_ttishow.py#L17 😬 wait a bit, before checking.
36
+ if not await db.get_chat(message.chat.id):
37
+ total=await client.get_chat_members_count(message.chat.id)
38
+ await client.send_message(LOG_CHANNEL, script.LOG_TEXT_G.format(message.chat.title, message.chat.id, total, "Unknown"))
39
+ await db.add_chat(message.chat.id, message.chat.title)
40
+ return
41
+ if not await db.is_user_exist(message.from_user.id):
42
+ await db.add_user(message.from_user.id, message.from_user.first_name)
43
+ await client.send_message(LOG_CHANNEL, script.LOG_TEXT_P.format(message.from_user.id, message.from_user.mention))
44
+ if len(message.command) != 2:
45
+ buttons = [[
46
+ InlineKeyboardButton('☆ ᴀᴅᴅ ᴍᴇ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ ☆', url=f'http://telegram.me/{temp.U_NAME}?startgroup=true')
47
+ ],[
48
+ InlineKeyboardButton('💸 ᴇᴀʀɴ ᴍᴏɴᴇʏ 💸', callback_data="shortlink_info"),
49
+ InlineKeyboardButton('• ᴜᴘᴅᴀᴛᴇꜱ •', callback_data='channels')
50
+ ],[
51
+ InlineKeyboardButton('• ᴄᴏᴍᴍᴀɴᴅꜱ •', callback_data='help'),
52
+ InlineKeyboardButton('• ᴀʙᴏᴜᴛ •', callback_data='about')
53
+ ],[
54
+ InlineKeyboardButton('✨ ʙᴜʏ ꜱᴜʙꜱᴄʀɪᴘᴛɪᴏɴ : ʀᴇᴍᴏᴠᴇ ᴀᴅꜱ ✨', callback_data="premium_info")
55
+ ]]
56
+ reply_markup = InlineKeyboardMarkup(buttons)
57
+ current_time = datetime.now(pytz.timezone(TIMEZONE))
58
+ curr_time = current_time.hour
59
+ if curr_time < 12:
60
+ gtxt = "ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ 👋"
61
+ elif curr_time < 17:
62
+ gtxt = "ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 👋"
63
+ elif curr_time < 21:
64
+ gtxt = "ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 👋"
65
+ else:
66
+ gtxt = "ɢᴏᴏᴅ ɴɪɢʜᴛ 👋"
67
+ m=await message.reply_text("<i>ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ <b>ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ ʙᴏᴛ</b>.\nʜᴏᴘᴇ ʏᴏᴜ'ʀᴇ ᴅᴏɪɴɢ ᴡᴇʟʟ...</i>")
68
+ await asyncio.sleep(0.4)
69
+ await m.edit_text("👀")
70
+ await asyncio.sleep(0.5)
71
+ await m.edit_text("⚡")
72
+ await asyncio.sleep(0.5)
73
+ await m.edit_text("<b><i>ꜱᴛᴀʀᴛɪɴɢ...</i></b>")
74
+ await asyncio.sleep(0.4)
75
+ await m.delete()
76
+ m=await message.reply_sticker("CAACAgQAAxkBAAEKeqNlIpmeUoOEsEWOWEiPxPi3hH5q-QACbg8AAuHqsVDaMQeY6CcRojAE")
77
+ await asyncio.sleep(1)
78
+ await m.delete()
79
+ await message.reply_photo(
80
+ photo=random.choice(PICS),
81
+ caption=script.START_TXT.format(message.from_user.mention, gtxt, temp.U_NAME, temp.B_NAME),
82
+ reply_markup=reply_markup,
83
+ parse_mode=enums.ParseMode.HTML
84
+ )
85
+ return
86
+
87
+ if AUTH_CHANNEL and not await is_req_subscribed(client, message):
88
+ try:
89
+ invite_link = await client.create_chat_invite_link(int(AUTH_CHANNEL), creates_join_request=True)
90
+ except ChatAdminRequired:
91
+ logger.error("Make sure Bot is admin in Forcesub channel")
92
+ return
93
+ btn = [
94
+ [
95
+ InlineKeyboardButton(
96
+ "📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌", url=invite_link.invite_link
97
+ )
98
+ ]
99
+ ]
100
+
101
+ if message.command[1] != "subscribe":
102
+ try:
103
+ kk, file_id = message.command[1].split("_", 1)
104
+ btn.append([InlineKeyboardButton("↻ Tʀʏ Aɢᴀɪɴ", callback_data=f"checksub#{kk}#{file_id}")])
105
+ except (IndexError, ValueError):
106
+ btn.append([InlineKeyboardButton("↻ Tʀʏ Aɢᴀɪɴ", url=f"https://t.me/{temp.U_NAME}?start={message.command[1]}")])
107
+ await client.send_message(
108
+ chat_id=message.from_user.id,
109
+ text="ᴊᴏɪɴ ᴏᴜʀ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ ᴀɴᴅ ᴛʜᴇɴ ᴄʟɪᴄᴋ ᴏɴ ᴛʀʏ ᴀɢᴀɪɴ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛᴇᴅ ꜰɪʟᴇ.",
110
+ reply_markup=InlineKeyboardMarkup(btn),
111
+ parse_mode=enums.ParseMode.MARKDOWN
112
+ )
113
+ return
114
+ if len(message.command) == 2 and message.command[1] in ["subscribe", "error", "okay", "help"]:
115
+ buttons = [[
116
+ InlineKeyboardButton('☆ ᴀᴅᴅ ᴍᴇ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ ☆', url=f'http://telegram.me/{temp.U_NAME}?startgroup=true')
117
+ ],[
118
+ InlineKeyboardButton('💸 ᴇᴀʀɴ ᴍᴏɴᴇʏ 💸', callback_data="shortlink_info"),
119
+ InlineKeyboardButton('• ᴜᴘᴅᴀᴛᴇꜱ •', callback_data='channels')
120
+ ],[
121
+ InlineKeyboardButton('• ᴄᴏᴍᴍᴀɴᴅꜱ •', callback_data='help'),
122
+ InlineKeyboardButton('• ᴀʙᴏᴜᴛ •', callback_data='about')
123
+ ],[
124
+ InlineKeyboardButton('✨ ʙᴜʏ ꜱᴜʙꜱᴄʀɪᴘᴛɪᴏɴ : ʀᴇᴍᴏᴠᴇ ᴀᴅꜱ ✨', callback_data="premium_info")
125
+ ]]
126
+ reply_markup = InlineKeyboardMarkup(buttons)
127
+ current_time = datetime.now(pytz.timezone(TIMEZONE))
128
+ curr_time = current_time.hour
129
+ if curr_time < 12:
130
+ gtxt = "ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ 👋"
131
+ elif curr_time < 17:
132
+ gtxt = "ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 👋"
133
+ elif curr_time < 21:
134
+ gtxt = "ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 👋"
135
+ else:
136
+ gtxt = "ɢᴏᴏᴅ ɴɪɢʜᴛ 👋"
137
+ m=await message.reply_text("<i>ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ <b>ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ ʙᴏᴛ</b>.\nʜᴏᴘᴇ ʏᴏᴜ'ʀᴇ ᴅᴏɪɴɢ ᴡᴇʟʟ...</i>")
138
+ await asyncio.sleep(0.4)
139
+ await m.edit_text("👀")
140
+ await asyncio.sleep(0.5)
141
+ await m.edit_text("⚡")
142
+ await asyncio.sleep(0.5)
143
+ await m.edit_text("<b><i>ꜱᴛᴀʀᴛɪɴɢ...</i></b>")
144
+ await asyncio.sleep(0.4)
145
+ await m.delete()
146
+ m=await message.reply_sticker("CAACAgQAAxkBAAEKeqNlIpmeUoOEsEWOWEiPxPi3hH5q-QACbg8AAuHqsVDaMQeY6CcRojAE")
147
+ await asyncio.sleep(1)
148
+ await m.delete()
149
+ await message.reply_photo(
150
+ photo=random.choice(PICS),
151
+ caption=script.START_TXT.format(message.from_user.mention, gtxt, temp.U_NAME, temp.B_NAME),
152
+ reply_markup=reply_markup,
153
+ parse_mode=enums.ParseMode.HTML
154
+ )
155
+ return
156
+
157
+
158
+ if len(message.command) == 2 and message.command[1] in ["premium"]:
159
+ buttons = [[
160
+ InlineKeyboardButton('📲 ꜱᴇɴᴅ ᴘᴀʏᴍᴇɴᴛ ꜱᴄʀᴇᴇɴꜱʜᴏᴛ', user_id=int(767250672))
161
+ ],[
162
+ InlineKeyboardButton('❌ ᴄʟᴏꜱᴇ ❌', callback_data='close_data')
163
+ ]]
164
+ reply_markup = InlineKeyboardMarkup(buttons)
165
+ await message.reply_photo(
166
+ photo=(SUBSCRIPTION),
167
+ caption=script.PREPLANS_TXT.format(message.from_user.mention),
168
+ reply_markup=reply_markup,
169
+ parse_mode=enums.ParseMode.HTML
170
+ )
171
+ return
172
+ data = message.command[1]
173
+ try:
174
+ pre, file_id = data.split('_', 1)
175
+ except:
176
+ file_id = data
177
+ pre = ""
178
+ if data.split("-", 1)[0] == "BATCH":
179
+ sts = await message.reply("<b>Please wait...</b>")
180
+ file_id = data.split("-", 1)[1]
181
+ msgs = BATCH_FILES.get(file_id)
182
+ if not msgs:
183
+ file = await client.download_media(file_id)
184
+ try:
185
+ with open(file) as file_data:
186
+ msgs=json.loads(file_data.read())
187
+ except:
188
+ await sts.edit("FAILED")
189
+ return await client.send_message(LOG_CHANNEL, "UNABLE TO OPEN FILE.")
190
+ os.remove(file)
191
+ BATCH_FILES[file_id] = msgs
192
+ for msg in msgs:
193
+ title = msg.get("title")
194
+ size=get_size(int(msg.get("size", 0)))
195
+ f_caption=msg.get("caption", "")
196
+ if BATCH_FILE_CAPTION:
197
+ try:
198
+ f_caption=BATCH_FILE_CAPTION.format(file_name= '' if title is None else title, file_size='' if size is None else size, file_caption='' if f_caption is None else f_caption)
199
+ except Exception as e:
200
+ logger.exception(e)
201
+ f_caption=f_caption
202
+ if f_caption is None:
203
+ f_caption = f"{title}"
204
+ try:
205
+ await client.send_cached_media(
206
+ chat_id=message.from_user.id,
207
+ file_id=msg.get("file_id"),
208
+ caption=f_caption,
209
+ protect_content=msg.get('protect', False),
210
+ reply_markup=InlineKeyboardMarkup(
211
+ [
212
+ [
213
+ InlineKeyboardButton('🚀 ꜰᴀꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅ / ᴡᴀᴛᴄʜ ᴏɴʟɪɴᴇ 🧿', callback_data=f'generate_stream_link:{file_id}'),
214
+ ],
215
+ [
216
+ InlineKeyboardButton('📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌', url=f'https://t.me/HP_MOVIES_WORLD') #Don't change anything without contacting me @LazyDeveloperr
217
+ ]
218
+ ]
219
+ )
220
+ )
221
+ except FloodWait as e:
222
+ await asyncio.sleep(e.x)
223
+ logger.warning(f"Floodwait of {e.x} sec.")
224
+ await client.send_cached_media(
225
+ chat_id=message.from_user.id,
226
+ file_id=msg.get("file_id"),
227
+ caption=f_caption,
228
+ protect_content=msg.get('protect', False),
229
+ reply_markup=InlineKeyboardMarkup(
230
+ [
231
+ [
232
+ InlineKeyboardButton('🚀 ꜰᴀꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅ / ᴡᴀᴛᴄʜ ᴏɴʟɪɴᴇ 🧿', callback_data=f'generate_stream_link:{file_id}'),
233
+ ],
234
+ [
235
+ InlineKeyboardButton('📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌', url=f'https://t.me/HP_MOVIES_WORLD') #Don't change anything without contacting me @LazyDeveloperr
236
+ ]
237
+ ]
238
+ )
239
+ )
240
+ except Exception as e:
241
+ logger.warning(e, exc_info=True)
242
+ continue
243
+ await asyncio.sleep(1)
244
+ await sts.delete()
245
+ return
246
+
247
+ elif data.split("-", 1)[0] == "DSTORE":
248
+ sts = await message.reply("<b>Please wait...</b>")
249
+ b_string = data.split("-", 1)[1]
250
+ decoded = (base64.urlsafe_b64decode(b_string + "=" * (-len(b_string) % 4))).decode("ascii")
251
+ try:
252
+ f_msg_id, l_msg_id, f_chat_id, protect = decoded.split("_", 3)
253
+ except:
254
+ f_msg_id, l_msg_id, f_chat_id = decoded.split("_", 2)
255
+ protect = "/pbatch" if PROTECT_CONTENT else "batch"
256
+ diff = int(l_msg_id) - int(f_msg_id)
257
+ async for msg in client.iter_messages(int(f_chat_id), int(l_msg_id), int(f_msg_id)):
258
+ if msg.media:
259
+ media = getattr(msg, msg.media.value)
260
+ if BATCH_FILE_CAPTION:
261
+ try:
262
+ f_caption=BATCH_FILE_CAPTION.format(file_name=getattr(media, 'file_name', ''), file_size=getattr(media, 'file_size', ''), file_caption=getattr(msg, 'caption', ''))
263
+ except Exception as e:
264
+ logger.exception(e)
265
+ f_caption = getattr(msg, 'caption', '')
266
+ else:
267
+ media = getattr(msg, msg.media.value)
268
+ file_name = getattr(media, 'file_name', '')
269
+ f_caption = getattr(msg, 'caption', file_name)
270
+ try:
271
+ await msg.copy(message.chat.id, caption=f_caption, protect_content=True if protect == "/pbatch" else False)
272
+ except FloodWait as e:
273
+ await asyncio.sleep(e.x)
274
+ await msg.copy(message.chat.id, caption=f_caption, protect_content=True if protect == "/pbatch" else False)
275
+ except Exception as e:
276
+ logger.exception(e)
277
+ continue
278
+ elif msg.empty:
279
+ continue
280
+ else:
281
+ try:
282
+ await msg.copy(message.chat.id, protect_content=True if protect == "/pbatch" else False)
283
+ except FloodWait as e:
284
+ await asyncio.sleep(e.x)
285
+ await msg.copy(message.chat.id, protect_content=True if protect == "/pbatch" else False)
286
+ except Exception as e:
287
+ logger.exception(e)
288
+ continue
289
+ await asyncio.sleep(1)
290
+ return await sts.delete()
291
+
292
+ elif data.split("-", 1)[0] == "verify":
293
+ userid = data.split("-", 2)[1]
294
+ token = data.split("-", 3)[2]
295
+ if str(message.from_user.id) != str(userid):
296
+ return await message.reply_text(
297
+ text="<b>Invalid link or Expired link !</b>",
298
+ protect_content=True
299
+ )
300
+ is_valid = await check_token(client, userid, token)
301
+ if is_valid == True:
302
+ await message.reply_text(
303
+ text=f"<b>Hey {message.from_user.mention}, You are successfully verified !\nNow you have unlimited access for all movies till today midnight.</b>",
304
+ protect_content=True
305
+ )
306
+ await verify_user(client, userid, token)
307
+ else:
308
+ return await message.reply_text(
309
+ text="<b>Invalid link or Expired link !</b>",
310
+ protect_content=True
311
+ )
312
+ if data.startswith("sendfiles"):
313
+ protect_content=True
314
+ current_time = datetime.now(pytz.timezone(TIMEZONE))
315
+ curr_time = current_time.hour
316
+ if curr_time < 12:
317
+ gtxt = "ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ 👋"
318
+ elif curr_time < 17:
319
+ gtxt = "ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 👋"
320
+ elif curr_time < 21:
321
+ gtxt = "ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 👋"
322
+ else:
323
+ gtxt = "ɢᴏᴏᴅ ɴɪɢʜᴛ 👋"
324
+ chat_id = int("-" + file_id.split("-")[1])
325
+ userid = message.from_user.id if message.from_user else None
326
+ g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}")
327
+ k = await client.send_message(chat_id=message.from_user.id,text=f"🫂 ʜᴇʏ {message.from_user.mention}, {gtxt}\n\n‼️ ɢᴇᴛ ᴀʟʟ ꜰɪʟᴇꜱ ɪɴ ᴀ ꜱɪɴɢʟᴇ ʟɪɴᴋ ‼️\n\n✅ ʏᴏᴜʀ ʟɪɴᴋ ɪꜱ ʀᴇᴀᴅʏ, ᴋɪɴᴅʟʏ ᴄʟɪᴄᴋ ᴏɴ ᴅᴏᴡɴʟᴏᴀᴅ ʙᴜᴛᴛᴏɴ.\n\n", reply_markup=InlineKeyboardMarkup(
328
+ [
329
+ [
330
+ InlineKeyboardButton('📁 ᴅᴏᴡɴʟᴏᴀᴅ 📁', url=g)
331
+ ], [
332
+ InlineKeyboardButton('⚡ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ⚡', url=await get_tutorial(chat_id))
333
+ ], [
334
+ InlineKeyboardButton('✨ ʙᴜʏ ꜱᴜʙꜱᴄʀɪᴘᴛɪᴏɴ : ʀᴇᴍᴏᴠᴇ ᴀᴅꜱ ✨', callback_data="seeplans")
335
+ ]
336
+ ]
337
+ )
338
+ )
339
+ await asyncio.sleep(300)
340
+ await k.edit("<b>ʏᴏᴜʀ ᴍᴇꜱꜱᴀɢᴇ ɪꜱ ᴅᴇʟᴇᴛᴇᴅ !\nᴋɪɴᴅʟʏ ꜱᴇᴀʀᴄʜ ᴀɢᴀɪɴ.</b>")
341
+ return
342
+
343
+
344
+ elif data.startswith("short"):
345
+ protect_content=True
346
+ current_time = datetime.now(pytz.timezone(TIMEZONE))
347
+ curr_time = current_time.hour
348
+ if curr_time < 12:
349
+ gtxt = "ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ 👋"
350
+ elif curr_time < 17:
351
+ gtxt = "ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 👋"
352
+ elif curr_time < 21:
353
+ gtxt = "ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 👋"
354
+ else:
355
+ gtxt = "ɢᴏᴏᴅ ɴɪɢʜᴛ 👋"
356
+ user_id = message.from_user.id
357
+ chat_id = temp.SHORT.get(user_id)
358
+ files_ = await get_file_details(file_id)
359
+ files = files_[0]
360
+ g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}")
361
+ k = await client.send_message(
362
+ chat_id=user_id,
363
+ text=f"🫂 ʜᴇʏ {message.from_user.mention}, {gtxt}\n\n✅ ʏᴏᴜʀ ʟɪɴᴋ ɪꜱ ʀᴇᴀᴅʏ, ᴋɪɴᴅʟʏ ᴄʟɪᴄᴋ ᴏɴ ᴅᴏᴡɴʟᴏᴀᴅ ʙᴜᴛᴛᴏɴ.\n\n⚠️ ꜰɪʟᴇ ɴᴀᴍᴇ : <code>{files.file_name}</code> \n\n📥 ꜰɪʟᴇ ꜱɪᴢᴇ : <code>{get_size(files.file_size)}</code>\n\n",
364
+ reply_markup=InlineKeyboardMarkup(
365
+ [[
366
+ InlineKeyboardButton('📁 ᴅᴏᴡɴʟᴏᴀᴅ 📁', url=g)
367
+ ], [
368
+ InlineKeyboardButton('⚡ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ⚡', url=await get_tutorial(chat_id))
369
+ ], [
370
+ InlineKeyboardButton('✨ ʙᴜʏ ꜱᴜʙꜱᴄʀɪᴘᴛɪᴏɴ : ʀᴇᴍᴏᴠᴇ ᴀᴅꜱ ✨', callback_data="seeplans")
371
+ ]]
372
+ )
373
+ )
374
+ await asyncio.sleep(600)
375
+ await k.edit("<b>ʏᴏᴜʀ ᴍᴇꜱꜱᴀɢᴇ ɪꜱ ᴅᴇʟᴇᴛᴇᴅ !\nᴋɪɴᴅʟʏ ꜱᴇᴀʀᴄʜ ᴀɢᴀɪɴ.</b>")
376
+ return
377
+
378
+ elif data.startswith("all"):
379
+ protect_content=True
380
+ user_id = message.from_user.id
381
+ files = temp.GETALL.get(file_id)
382
+ if not files:
383
+ return await message.reply('<b><i>ɴᴏ ꜱᴜᴄʜ ꜰɪʟᴇ ᴇxɪꜱᴛꜱ !</b></i>')
384
+ filesarr = []
385
+ for file in files:
386
+ file_id = file.file_id
387
+ files_ = await get_file_details(file_id)
388
+ files1 = files_[0]
389
+ title = ' '.join(filter(lambda x: not x.startswith('[') and not x.startswith('@'), files1.file_name.split()))
390
+ size=get_size(files1.file_size)
391
+ f_caption=files1.caption
392
+ if CUSTOM_FILE_CAPTION:
393
+ try:
394
+ f_caption=CUSTOM_FILE_CAPTION.format(file_name= '' if title is None else title, file_size='' if size is None else size, file_caption='' if f_caption is None else f_caption)
395
+ except Exception as e:
396
+ logger.exception(e)
397
+ f_caption=f_caption
398
+ if f_caption is None:
399
+ f_caption = f"{' '.join(filter(lambda x: not x.startswith('[') and not x.startswith('@'), files1.file_name.split()))}"
400
+
401
+ if not await check_verification(client, message.from_user.id) and VERIFY == True:
402
+ btn = [[
403
+ InlineKeyboardButton("♻️ ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴠᴇʀɪꜰʏ ♻️", url=await get_token(client, message.from_user.id, f"https://telegram.me/{temp.U_NAME}?start="))
404
+ ],[
405
+ InlineKeyboardButton("⁉️ ʜᴏᴡ ᴛᴏ ᴠᴇʀɪꜰʏ ⁉️", url=HOWTOVERIFY)
406
+ ]]
407
+ await message.reply_text(
408
+ text="<b>👋 ʜᴇʏ {message.from_user.mention}, ʏᴏᴜ'ʀᴇ ᴀʀᴇ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴠᴇʀɪꜰɪᴇᴅ ✅\n\nɴᴏᴡ ʏᴏᴜ'ᴠᴇ ᴜɴʟɪᴍɪᴛᴇᴅ ᴀᴄᴄᴇꜱꜱ ᴛɪʟʟ ɴᴇxᴛ ᴠᴇʀɪꜰɪᴄᴀᴛɪᴏɴ 🎉</b>",
409
+ protect_content=True,
410
+ reply_markup=InlineKeyboardMarkup(btn)
411
+ )
412
+ return
413
+ msg = await client.send_cached_media(
414
+ chat_id=message.from_user.id,
415
+ file_id=file_id,
416
+ caption=f_caption,
417
+ protect_content=True if pre == 'filep' else False,
418
+ reply_markup=InlineKeyboardMarkup(
419
+ [
420
+ [
421
+ InlineKeyboardButton('🚀 ꜰᴀꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅ / ᴡᴀᴛᴄʜ ᴏɴʟɪɴᴇ 🧿', callback_data=f'generate_stream_link:{file_id}'),
422
+ ],
423
+ [
424
+ InlineKeyboardButton('📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌', url=f'https://t.me/HP_MOVIES_WORLD') #Don't change anything without contacting me @LazyDeveloperr
425
+ ]
426
+ ]
427
+ )
428
+ )
429
+ filesarr.append(msg)
430
+ k = await client.send_message(chat_id = message.from_user.id, text=f"<b>❗️ <u>ɪᴍᴘᴏʀᴛᴀɴᴛ</u> ❗️</b>\n\n<b>ᴛʜᴇꜱᴇ ᴠɪᴅᴇᴏꜱ / ꜰɪʟᴇꜱ ᴡɪʟʟ ʙᴇ ᴅᴇʟᴇᴛᴇᴅ ɪɴ</b> <b><u>10 ᴍɪɴᴜᴛᴇꜱ</u> </b><b>(ᴅᴜᴇ ᴛᴏ ᴄᴏᴘʏʀɪɢʜᴛ ɪꜱꜱᴜᴇꜱ).</b>\n\n<b><i>📌 ᴘʟᴇᴀꜱᴇ ꜰᴏʀᴡᴀʀᴅ ᴛʜᴇꜱᴇ ᴠɪᴅᴇᴏꜱ / ꜰɪʟᴇꜱ ᴛᴏ ꜱᴏᴍᴇᴡʜᴇʀᴇ ᴇʟꜱᴇ ᴀɴᴅ ꜱᴛᴀʀᴛ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴛʜᴇʀᴇ.</i></b>")
431
+ await asyncio.sleep(600)
432
+ for x in filesarr:
433
+ await x.delete()
434
+ await k.edit_text("<b>ʏᴏᴜʀ ᴠɪᴅᴇᴏꜱ / ꜰɪʟᴇꜱ ᴀʀᴇ ᴅᴇʟᴇᴛᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ !\nᴋɪɴᴅʟʏ ꜱᴇᴀʀᴄʜ ᴀɢᴀɪɴ.</b>")
435
+ return
436
+
437
+ elif data.startswith("files"):
438
+ current_time = datetime.now(pytz.timezone(TIMEZONE))
439
+ curr_time = current_time.hour
440
+ if curr_time < 12:
441
+ gtxt = "ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ 👋"
442
+ elif curr_time < 17:
443
+ gtxt = "ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 👋"
444
+ elif curr_time < 21:
445
+ gtxt = "ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 👋"
446
+ else:
447
+ gtxt = "ɢᴏᴏᴅ ɴɪɢʜᴛ 👋"
448
+ user_id = message.from_user.id
449
+ if temp.SHORT.get(user_id)==None:
450
+ return await message.reply_text(text="<b>Please Search Again in Group</b>")
451
+ else:
452
+ chat_id = temp.SHORT.get(user_id)
453
+ settings = await get_settings(chat_id)
454
+ if not await db.has_premium_access(user_id) and settings['is_shortlink']: #Don't change anything without my permission @CoderluffyTG
455
+ files_ = await get_file_details(file_id)
456
+ files = files_[0]
457
+ g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}")
458
+ k = await client.send_message(chat_id=message.from_user.id,text=f"🫂 ʜᴇʏ {message.from_user.mention}, {gtxt}\n\n✅ ʏᴏᴜʀ ʟɪɴᴋ ɪꜱ ʀᴇᴀᴅʏ, ᴋɪɴᴅʟʏ ᴄʟɪᴄᴋ ᴏɴ ᴅᴏᴡɴʟᴏᴀᴅ ʙᴜᴛᴛᴏɴ.\n\n⚠️ ꜰɪʟᴇ ɴᴀᴍᴇ : <code>{files.file_name}</code> \n\n📥 ꜰɪʟᴇ ꜱɪᴢᴇ : <code>{get_size(files.file_size)}</code>\n\n", reply_markup=InlineKeyboardMarkup(
459
+ [
460
+ [
461
+ InlineKeyboardButton('📁 ᴅᴏᴡɴʟᴏᴀᴅ 📁', url=g)
462
+ ], [
463
+ InlineKeyboardButton('⚡ ʜᴏᴡ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ⚡', url=await get_tutorial(chat_id))
464
+ ], [
465
+ InlineKeyboardButton('✨ ʙᴜʏ ꜱᴜʙꜱᴄʀɪᴘᴛɪᴏɴ : ʀᴇᴍᴏᴠᴇ ᴀᴅꜱ ✨', callback_data="seeplans")
466
+ ]
467
+ ]
468
+ )
469
+ )
470
+ await asyncio.sleep(600)
471
+ await k.edit("<b>ʏᴏᴜʀ ᴍᴇꜱꜱᴀɢᴇ ɪꜱ ᴅᴇʟᴇᴛᴇᴅ !\nᴋɪɴᴅʟʏ ꜱᴇᴀʀᴄʜ ᴀɢᴀɪɴ.</b>")
472
+ return
473
+ user = message.from_user.id
474
+ files_ = await get_file_details(file_id)
475
+ if not files_:
476
+ pre, file_id = ((base64.urlsafe_b64decode(data + "=" * (-len(data) % 4))).decode("ascii")).split("_", 1)
477
+ try:
478
+ if not await check_verification(client, message.from_user.id) and VERIFY == True:
479
+ btn = [[
480
+ InlineKeyboardButton("♻️ ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴠᴇʀɪꜰʏ ♻️", url=await get_token(client, message.from_user.id, f"https://telegram.me/{temp.U_NAME}?start="))
481
+ ],[
482
+ InlineKeyboardButton("⁉️ ʜᴏᴡ ᴛᴏ ᴠᴇʀɪꜰʏ ⁉️", url=HOWTOVERIFY)
483
+ ]]
484
+ await message.reply_text(
485
+ text="<b>👋 ʜᴇʏ ᴛʜᴇʀᴇ,\n\n📌 <u>ʏᴏᴜ'ʀᴇ ɴᴏᴛ ᴠᴇʀɪꜰɪᴇᴅ ᴛᴏᴅᴀʏ, ᴘʟᴇᴀꜱᴇ ᴠᴇʀɪꜰʏ ᴀɴᴅ ɢᴇᴛ ᴜɴʟɪᴍɪᴛᴇᴅ ᴀᴄᴄᴇꜱꜱ ᴛɪʟʟ ɴᴇxᴛ ᴠᴇʀɪꜰɪᴄᴀᴛɪᴏɴ</u>.</b>",
486
+ protect_content=True,
487
+ reply_markup=InlineKeyboardMarkup(btn)
488
+ )
489
+ return
490
+ msg = await client.send_cached_media(
491
+ chat_id=message.from_user.id,
492
+ file_id=file_id,
493
+ protect_content=True if pre == 'filep' else False,
494
+ reply_markup=InlineKeyboardMarkup(
495
+ [
496
+ [
497
+ InlineKeyboardButton('🚀 ꜰᴀꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅ / ᴡᴀᴛᴄʜ ᴏɴʟɪɴᴇ 🧿', callback_data=f'generate_stream_link:{file_id}'),
498
+ ],
499
+ [
500
+ InlineKeyboardButton('📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌', url=f'https://t.me/HP_MOVIES_WORLD') #Don't change anything without contacting me @LazyDeveloperr
501
+ ]
502
+ ]
503
+ )
504
+ )
505
+ filetype = msg.media
506
+ file = getattr(msg, filetype.value)
507
+ title = '' + ' '.join(filter(lambda x: not x.startswith('[') and not x.startswith('@'), file.file_name.split()))
508
+ size=get_size(file.file_size)
509
+ f_caption = f"<code>{title}</code>"
510
+ if CUSTOM_FILE_CAPTION:
511
+ try:
512
+ f_caption=CUSTOM_FILE_CAPTION.format(file_name= '' if title is None else title, file_size='' if size is None else size, file_caption='')
513
+ except:
514
+ return
515
+ await msg.edit_caption(f_caption)
516
+ btn = [[
517
+ InlineKeyboardButton("❗ ɢᴇᴛ ꜰɪʟᴇ ᴀɢᴀɪɴ ❗", callback_data=f'delfile#{file_id}')
518
+ ]]
519
+ k = await client.send_message(chat_id = message.from_user.id, text=f"<b>❗️ <u>ɪᴍᴘᴏʀᴛᴀɴᴛ</u> ❗️</b>\n\n<b>ᴛʜɪꜱ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ᴡɪʟʟ ʙᴇ ᴅᴇʟᴇᴛᴇᴅ ɪɴ</b> <b><u>10 ᴍɪɴᴜᴛᴇꜱ</u> </b><b>(ᴅᴜᴇ ᴛᴏ ᴄᴏᴘʏʀɪɢʜᴛ ɪꜱꜱᴜᴇꜱ).</b>\n\n<b><i>📌 ᴘʟᴇᴀꜱᴇ ꜰᴏʀᴡᴀʀᴅ ᴛʜɪꜱ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ᴛᴏ ꜱᴏᴍᴇᴡʜᴇʀᴇ ᴇʟꜱᴇ ᴀɴᴅ ꜱᴛᴀʀᴛ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴛʜᴇʀᴇ.</i></b>")
520
+ await asyncio.sleep(600)
521
+ await msg.delete()
522
+ await k.edit_text("<b>ʏᴏᴜʀ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ɪꜱ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ !!\n\nᴄʟɪᴄᴋ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ᴅᴇʟᴇᴛᴇᴅ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ 👇</b>",reply_markup=InlineKeyboardMarkup(btn))
523
+ return
524
+ except:
525
+ pass
526
+ return await message.reply('ɴᴏ ꜱᴜᴄʜ ꜰɪʟᴇ ᴇxɪꜱᴛꜱ !')
527
+ files = files_[0]
528
+ title = '' + ' '.join(filter(lambda x: not x.startswith('[') and not x.startswith('@'), files.file_name.split()))
529
+ size=get_size(files.file_size)
530
+ f_caption=files.caption
531
+ if CUSTOM_FILE_CAPTION:
532
+ try:
533
+ f_caption=CUSTOM_FILE_CAPTION.format(file_name= '' if title is None else title, file_size='' if size is None else size, file_caption='' if f_caption is None else f_caption)
534
+ except Exception as e:
535
+ logger.exception(e)
536
+ f_caption=f_caption
537
+ if f_caption is None:
538
+ f_caption = f" {' '.join(filter(lambda x: not x.startswith('[') and not x.startswith('@'), files.file_name.split()))}"
539
+
540
+ if not await check_verification(client, message.from_user.id) and VERIFY == True:
541
+ btn = [[
542
+ InlineKeyboardButton("♻️ ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴠᴇʀɪꜰʏ ♻️", url=await get_token(client, message.from_user.id, f"https://telegram.me/{temp.U_NAME}?start="))
543
+ ],[
544
+ InlineKeyboardButton("⁉️ ʜᴏᴡ ᴛᴏ ᴠᴇʀɪꜰʏ ⁉️", url=HOWTOVERIFY)
545
+ ]]
546
+ await message.reply_text(
547
+ text="<b>👋 ʜᴇʏ ᴛʜᴇʀᴇ,\n\n📌 <u>ʏᴏᴜ'ʀᴇ ɴᴏᴛ ᴠᴇʀɪꜰɪᴇᴅ ᴛᴏᴅᴀʏ, ᴘʟᴇᴀꜱᴇ ᴠᴇʀɪꜰʏ ᴀɴᴅ ɢᴇᴛ ᴜɴʟɪᴍɪᴛᴇᴅ ᴀᴄᴄᴇꜱꜱ ᴛɪʟʟ ɴᴇxᴛ ᴠᴇʀɪꜰɪᴄᴀᴛɪᴏɴ</u>.</b>",
548
+ protect_content=True,
549
+ reply_markup=InlineKeyboardMarkup(btn)
550
+ )
551
+ return
552
+ msg = await client.send_cached_media(
553
+ chat_id=message.from_user.id,
554
+ file_id=file_id,
555
+ caption=f_caption,
556
+ protect_content=True if pre == 'filep' else False,
557
+ reply_markup=InlineKeyboardMarkup(
558
+ [
559
+ [
560
+ InlineKeyboardButton('🚀 ꜰᴀꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅ / ᴡᴀᴛᴄʜ ᴏɴʟɪɴᴇ 🧿', callback_data=f'generate_stream_link:{file_id}'),
561
+ ],
562
+ [
563
+ InlineKeyboardButton('📌 ᴊᴏɪɴ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ 📌', url=f'https://t.me/HP_MOVIES_WORLD') #Don't change anything without contacting me @LazyDeveloperr
564
+ ]
565
+ ]
566
+ )
567
+ )
568
+ btn = [[
569
+ InlineKeyboardButton("❗ ɢᴇᴛ ꜰɪʟᴇ ᴀɢᴀɪɴ ❗", callback_data=f'delfile#{file_id}')
570
+ ]]
571
+ k = await client.send_message(chat_id = message.from_user.id, text=f"<b>❗️ <u>ɪᴍᴘᴏʀᴛᴀɴᴛ</u> ❗️</b>\n\n<b>ᴛʜɪꜱ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ᴡɪʟʟ ʙᴇ ᴅᴇʟᴇᴛᴇᴅ ɪɴ</b> <b><u>10 ᴍɪɴᴜᴛᴇꜱ</u> </b><b>(ᴅᴜᴇ ᴛᴏ ᴄᴏᴘʏʀɪɢʜᴛ ɪꜱꜱᴜᴇꜱ).</b>\n\n<b><i>📌 ᴘʟᴇᴀꜱᴇ ꜰᴏʀᴡᴀʀᴅ ᴛʜɪꜱ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ᴛᴏ ꜱᴏᴍᴇᴡʜᴇʀᴇ ᴇʟꜱᴇ ᴀɴᴅ ꜱᴛᴀʀᴛ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴛʜᴇʀᴇ.</i></b>")
572
+ await asyncio.sleep(600)
573
+ await msg.delete()
574
+ await k.edit_text("<b>ʏᴏᴜʀ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ ɪꜱ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ !!\n\nᴄʟɪᴄᴋ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ᴅᴇʟᴇᴛᴇᴅ ᴠɪᴅᴇᴏ / ꜰɪʟᴇ 👇</b>",reply_markup=InlineKeyboardMarkup(btn))
575
+ return
576
+
577
+ @Client.on_message(filters.command('channel') & filters.user(ADMINS))
578
+ async def channel_info(bot, message):
579
+
580
+ """Send basic information of channel"""
581
+ if isinstance(CHANNELS, (int, str)):
582
+ channels = [CHANNELS]
583
+ elif isinstance(CHANNELS, list):
584
+ channels = CHANNELS
585
+ else:
586
+ raise ValueError("ᴜɴᴇxᴘᴇᴄᴛᴇᴅ ᴛʏᴘᴇ ᴏꜰ ᴄʜᴀɴɴᴇʟꜱ.")
587
+
588
+ text = '📑 **ɪɴᴅᴇxᴇᴅ ᴄʜᴀɴɴᴇʟꜱ / ɢʀᴏᴜᴘꜱ ʟɪꜱᴛ :**\n'
589
+ for channel in channels:
590
+ chat = await bot.get_chat(channel)
591
+ if chat.username:
592
+ text += '\n@' + chat.username
593
+ else:
594
+ text += '\n' + chat.title or chat.first_name
595
+
596
+ text += f'\n\n**ᴛᴏᴛᴀʟ :** {len(CHANNELS)}'
597
+
598
+ if len(text) < 4096:
599
+ await message.reply(text)
600
+ else:
601
+ file = 'Indexed channels.txt'
602
+ with open(file, 'w') as f:
603
+ f.write(text)
604
+ await message.reply_document(file)
605
+ os.remove(file)
606
+
607
+
608
+ @Client.on_message(filters.command('logs') & filters.user(ADMINS))
609
+ async def log_file(bot, message):
610
+ """Send log file"""
611
+ try:
612
+ await message.reply_document('TELEGRAM BOT.LOG')
613
+ except Exception as e:
614
+ await message.reply(str(e))
615
+
616
+ @Client.on_message(filters.command('delete') & filters.user(ADMINS))
617
+ async def delete(bot, message):
618
+ """Delete file from database"""
619
+ reply = message.reply_to_message
620
+ if reply and reply.media:
621
+ msg = await message.reply("ᴘʀᴏᴄᴇꜱꜱɪɴɢ...⏳", quote=True)
622
+ else:
623
+ await message.reply('ʀᴇᴘʟʏ ᴛᴏ ꜰɪʟᴇ ᴡɪᴛʜ /delete ᴡʜɪᴄʜ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴇʟᴇᴛᴇ ꜰʀᴏᴍ ᴅʙ.', quote=True)
624
+ return
625
+
626
+ for file_type in ("document", "video", "audio"):
627
+ media = getattr(reply, file_type, None)
628
+ if media is not None:
629
+ break
630
+ else:
631
+ await msg.edit('ᴛʜɪꜱ ɪꜱ ɴᴏᴛ ꜱᴜᴘᴘᴏʀᴛᴇᴅ ꜰɪʟᴇ ꜰᴏʀᴍᴀᴛ.')
632
+ return
633
+
634
+ file_id, file_ref = unpack_new_file_id(media.file_id)
635
+
636
+ result = await Media.collection.delete_one({
637
+ '_id': file_id,
638
+ })
639
+ if result.deleted_count:
640
+ await msg.edit('ꜰɪʟᴇ ɪꜱ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ ꜰʀᴏᴍ ᴅʙ ✅')
641
+ else:
642
+ file_name = re.sub(r"(_|\-|\.|\+)", " ", str(media.file_name))
643
+ result = await Media.collection.delete_many({
644
+ 'file_name': file_name,
645
+ 'file_size': media.file_size,
646
+ 'mime_type': media.mime_type
647
+ })
648
+ if result.deleted_count:
649
+ await msg.edit('ꜰɪʟᴇ ɪꜱ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ ꜰʀᴏᴍ ᴅʙ ✅')
650
+ else:
651
+ # files indexed before https://github.com/EvamariaTG/EvaMaria/commit/f3d2a1bcb155faf44178e5d7a685a1b533e714bf#diff-86b613edf1748372103e94cacff3b578b36b698ef9c16817bb98fe9ef22fb669R39
652
+ # have original file name.
653
+ result = await Media.collection.delete_many({
654
+ 'file_name': media.file_name,
655
+ 'file_size': media.file_size,
656
+ 'mime_type': media.mime_type
657
+ })
658
+ if result.deleted_count:
659
+ await msg.edit('ꜰɪʟᴇ ɪꜱ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ ꜰʀᴏᴍ ᴅʙ ✅')
660
+ else:
661
+ await msg.edit('ꜰɪʟᴇ ɪꜱ ɴᴏᴛ ꜰᴏᴜɴᴅ ɪɴ ᴅʙ ❌')
662
+
663
+
664
+ @Client.on_message(filters.command('deleteall') & filters.user(ADMINS))
665
+ async def delete_all_index(bot, message):
666
+ await message.reply_text(
667
+ 'ᴛʜɪꜱ ᴡɪʟʟ ᴅᴇʟᴇᴛᴇ ᴀʟʟ ʏᴏᴜʀ ɪɴᴅᴇxᴇᴅ ꜰɪʟᴇꜱ !\nᴅᴏ ʏᴏᴜ ꜱᴛɪʟʟ ᴡᴀɴᴛ ᴛᴏ ᴄᴏɴᴛɪɴᴜᴇ ?',
668
+ reply_markup=InlineKeyboardMarkup(
669
+ [
670
+ [
671
+ InlineKeyboardButton(
672
+ text="⚠️ ʏᴇꜱ ⚠️", callback_data="autofilter_delete"
673
+ )
674
+ ],
675
+ [
676
+ InlineKeyboardButton(
677
+ text="❌ ɴᴏ ❌", callback_data="close_data"
678
+ )
679
+ ],
680
+ ]
681
+ ),
682
+ quote=True,
683
+ )
684
+
685
+
686
+ @Client.on_callback_query(filters.regex(r'^autofilter_delete'))
687
+ async def delete_all_index_confirm(bot, message):
688
+ await Media.collection.drop()
689
+ await message.answer('ᴍᴀɪɴᴛᴀɪɴᴇᴅ ʙʏ : ʜᴘ')
690
+ await message.message.edit('ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇʟᴇᴛᴇᴅ ᴀʟʟ ɪɴᴅᴇxᴇᴅ ꜰɪʟᴇꜱ ✅')
691
+
692
+
693
+ @Client.on_message(filters.command('settings'))
694
+ async def settings(client, message):
695
+ userid = message.from_user.id if message.from_user else None
696
+ if not userid:
697
+ return await message.reply(f"ʏᴏᴜ'ʀᴇ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ.\nᴜꜱᴇ /connect {message.chat.id} ɪɴ ᴘᴍ.")
698
+ chat_type = message.chat.type
699
+
700
+ if chat_type == enums.ChatType.PRIVATE:
701
+ grpid = await active_connection(str(userid))
702
+ if grpid is not None:
703
+ grp_id = grpid
704
+ try:
705
+ chat = await client.get_chat(grpid)
706
+ title = chat.title
707
+ except:
708
+ await message.reply_text("ᴍᴀᴋᴇ ꜱᴜʀᴇ ɪ'ᴍ ᴘʀᴇꜱᴇɴᴛ ɪɴ ʏᴏᴜʀ ɢʀᴏᴜᴘ !!", quote=True)
709
+ return
710
+ else:
711
+ await message.reply_text("ɪ'ᴍ ɴᴏᴛ ᴄᴏɴɴᴇᴄᴛᴇᴅ ᴛᴏ ᴀɴʏ ɢʀᴏᴜᴘ !", quote=True)
712
+ return
713
+
714
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
715
+ grp_id = message.chat.id
716
+ title = message.chat.title
717
+
718
+ else:
719
+ return
720
+
721
+ st = await client.get_chat_member(grp_id, userid)
722
+ if (
723
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
724
+ and st.status != enums.ChatMemberStatus.OWNER
725
+ and str(userid) not in ADMINS
726
+ ):
727
+ return
728
+
729
+ settings = await get_settings(grp_id)
730
+
731
+ try:
732
+ if settings['max_btn']:
733
+ settings = await get_settings(grp_id)
734
+ except KeyError:
735
+ await save_group_settings(grp_id, 'max_btn', False)
736
+ settings = await get_settings(grp_id)
737
+ if 'is_shortlink' not in settings.keys():
738
+ await save_group_settings(grp_id, 'is_shortlink', False)
739
+ else:
740
+ pass
741
+
742
+ if settings is not None:
743
+ buttons = [
744
+ [
745
+ InlineKeyboardButton(
746
+ 'ʀᴇꜱᴜʟᴛ ᴘᴀɢᴇ',
747
+ callback_data=f'setgs#button#{settings["button"]}#{grp_id}',
748
+ ),
749
+ InlineKeyboardButton(
750
+ 'ʙᴜᴛᴛᴏɴ' if settings["button"] else 'ᴛᴇxᴛ',
751
+ callback_data=f'setgs#button#{settings["button"]}#{grp_id}',
752
+ ),
753
+ ],
754
+ [
755
+ InlineKeyboardButton(
756
+ 'ꜰɪʟᴇ ꜱᴇɴᴅ ᴍᴏᴅᴇ',
757
+ callback_data=f'setgs#botpm#{settings["botpm"]}#{grp_id}',
758
+ ),
759
+ InlineKeyboardButton(
760
+ 'ꜱᴛᴀʀᴛ' if settings["botpm"] else 'ᴀᴜᴛᴏ',
761
+ callback_data=f'setgs#botpm#{settings["botpm"]}#{grp_id}',
762
+ ),
763
+ ],
764
+ [
765
+ InlineKeyboardButton(
766
+ 'ꜰɪʟᴇ ꜱᴇᴄᴜʀᴇ',
767
+ callback_data=f'setgs#file_secure#{settings["file_secure"]}#{grp_id}',
768
+ ),
769
+ InlineKeyboardButton(
770
+ 'ᴇɴᴀʙʟᴇ' if settings["file_secure"] else 'ᴅɪꜱᴀʙʟᴇ',
771
+ callback_data=f'setgs#file_secure#{settings["file_secure"]}#{grp_id}',
772
+ ),
773
+ ],
774
+ [
775
+ InlineKeyboardButton(
776
+ 'ɪᴍᴅʙ ᴘᴏꜱᴛᴇʀ',
777
+ callback_data=f'setgs#imdb#{settings["imdb"]}#{grp_id}',
778
+ ),
779
+ InlineKeyboardButton(
780
+ 'ᴇɴᴀʙʟᴇ' if settings["imdb"] else 'ᴅɪꜱᴀʙʟᴇ',
781
+ callback_data=f'setgs#imdb#{settings["imdb"]}#{grp_id}',
782
+ ),
783
+ ],
784
+ [
785
+ InlineKeyboardButton(
786
+ 'ꜱᴘᴇʟʟ ᴄʜᴇᴄᴋ',
787
+ callback_data=f'setgs#spell_check#{settings["spell_check"]}#{grp_id}',
788
+ ),
789
+ InlineKeyboardButton(
790
+ 'ᴇɴᴀʙʟᴇ' if settings["spell_check"] else 'ᴅɪꜱᴀʙʟᴇ',
791
+ callback_data=f'setgs#spell_check#{settings["spell_check"]}#{grp_id}',
792
+ ),
793
+ ],
794
+ [
795
+ InlineKeyboardButton(
796
+ 'ᴡᴇʟᴄᴏᴍᴇ ᴍꜱɢ',
797
+ callback_data=f'setgs#welcome#{settings["welcome"]}#{grp_id}',
798
+ ),
799
+ InlineKeyboardButton(
800
+ 'ᴇɴᴀʙʟᴇ' if settings["welcome"] else 'ᴅɪꜱᴀʙʟᴇ',
801
+ callback_data=f'setgs#welcome#{settings["welcome"]}#{grp_id}',
802
+ ),
803
+ ],
804
+ [
805
+ InlineKeyboardButton(
806
+ 'ᴀᴜᴛᴏ ᴅᴇʟᴇᴛᴇ',
807
+ callback_data=f'setgs#auto_delete#{settings["auto_delete"]}#{grp_id}',
808
+ ),
809
+ InlineKeyboardButton(
810
+ 'ᴇɴᴀʙʟᴇ' if settings["auto_delete"] else 'ᴅɪꜱᴀʙʟᴇ',
811
+ callback_data=f'setgs#auto_delete#{settings["auto_delete"]}#{grp_id}',
812
+ ),
813
+ ],
814
+ [
815
+ InlineKeyboardButton(
816
+ 'ᴀᴜᴛᴏ ꜰɪʟᴛᴇʀ',
817
+ callback_data=f'setgs#auto_ffilter#{settings["auto_ffilter"]}#{grp_id}',
818
+ ),
819
+ InlineKeyboardButton(
820
+ 'ᴇɴᴀʙʟᴇ' if settings["auto_ffilter"] else 'ᴅɪꜱᴀʙʟᴇ',
821
+ callback_data=f'setgs#auto_ffilter#{settings["auto_ffilter"]}#{grp_id}',
822
+ ),
823
+ ],
824
+ [
825
+ InlineKeyboardButton(
826
+ 'ᴍᴀx ʙᴜᴛᴛᴏɴꜱ',
827
+ callback_data=f'setgs#max_btn#{settings["max_btn"]}#{grp_id}',
828
+ ),
829
+ InlineKeyboardButton(
830
+ '10' if settings["max_btn"] else f'{MAX_B_TN}',
831
+ callback_data=f'setgs#max_btn#{settings["max_btn"]}#{grp_id}',
832
+ ),
833
+ ],
834
+ [
835
+ InlineKeyboardButton(
836
+ 'ꜱʜᴏʀᴛʟɪɴᴋ',
837
+ callback_data=f'setgs#is_shortlink#{settings["is_shortlink"]}#{grp_id}',
838
+ ),
839
+ InlineKeyboardButton(
840
+ 'ᴇɴᴀʙʟᴇ' if settings["is_shortlink"] else 'ᴅɪꜱᴀʙʟᴇ',
841
+ callback_data=f'setgs#is_shortlink#{settings["is_shortlink"]}#{grp_id}',
842
+ ),
843
+ ],
844
+ [
845
+ InlineKeyboardButton('⇋ ᴄʟᴏꜱᴇ ꜱᴇᴛᴛɪɴɢꜱ ᴍᴇɴᴜ ⇋',
846
+ callback_data='close_data'
847
+ )
848
+ ]
849
+ ]
850
+
851
+
852
+ btn = [[
853
+ InlineKeyboardButton("👤 ᴏᴘᴇɴ ɪɴ ᴘʀɪᴠᴀᴛᴇ ᴄʜᴀᴛ 👤", callback_data=f"opnsetpm#{grp_id}")
854
+ ],[
855
+ InlineKeyboardButton("👥 ᴏᴘᴇɴ ʜᴇʀᴇ 👥", callback_data=f"opnsetgrp#{grp_id}")
856
+ ]]
857
+
858
+ reply_markup = InlineKeyboardMarkup(buttons)
859
+ if chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
860
+ await message.reply_text(
861
+ text="<b>ᴡʜᴇʀᴇ ᴅᴏ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴏᴘᴇɴ ꜱᴇᴛᴛɪɴɢꜱ ᴍᴇɴᴜ ? ⚙️</b>",
862
+ reply_markup=InlineKeyboardMarkup(btn),
863
+ disable_web_page_preview=True,
864
+ parse_mode=enums.ParseMode.HTML,
865
+ reply_to_message_id=message.id
866
+ )
867
+ else:
868
+ await message.reply_text(
869
+ text=f"<b>ᴄʜᴀɴɢᴇ ʏᴏᴜʀ ꜱᴇᴛᴛɪɴɢꜱ ꜰᴏʀ {title} ᴀꜱ ʏᴏᴜ ᴡɪꜱʜ ⚙</b>",
870
+ reply_markup=reply_markup,
871
+ disable_web_page_preview=True,
872
+ parse_mode=enums.ParseMode.HTML,
873
+ reply_to_message_id=message.id
874
+ )
875
+
876
+
877
+
878
+ @Client.on_message(filters.command('set_template'))
879
+ async def save_template(client, message):
880
+ sts = await message.reply("ᴄʜᴇᴄᴋɪɴɢ ᴛᴇᴍᴘʟᴀᴛᴇ...")
881
+ userid = message.from_user.id if message.from_user else None
882
+ if not userid:
883
+ return await message.reply(f"ʏᴏᴜ'ʀᴇ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ.\nᴜꜱᴇ /connect {message.chat.id} ɪɴ ᴘᴍ.")
884
+ chat_type = message.chat.type
885
+
886
+ if chat_type == enums.ChatType.PRIVATE:
887
+ grpid = await active_connection(str(userid))
888
+ if grpid is not None:
889
+ grp_id = grpid
890
+ try:
891
+ chat = await client.get_chat(grpid)
892
+ title = chat.title
893
+ except:
894
+ await message.reply_text("ᴍᴀᴋᴇ ꜱᴜʀᴇ ɪ'ᴍ ᴘʀᴇꜱᴇɴᴛ ɪɴ ʏᴏᴜʀ ɢʀᴏᴜᴘ !!", quote=True)
895
+ return
896
+ else:
897
+ await message.reply_text("ɪ'ᴍ ɴᴏᴛ ᴄᴏɴɴᴇᴄᴛᴇᴅ ᴛᴏ ᴀɴʏ ɢʀᴏᴜᴘ !", quote=True)
898
+ return
899
+
900
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
901
+ grp_id = message.chat.id
902
+ title = message.chat.title
903
+
904
+ else:
905
+ return
906
+
907
+ st = await client.get_chat_member(grp_id, userid)
908
+ if (
909
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
910
+ and st.status != enums.ChatMemberStatus.OWNER
911
+ and str(userid) not in ADMINS
912
+ ):
913
+ return
914
+
915
+ if len(message.command) < 2:
916
+ return await sts.edit("ɴᴏ ɪɴᴘᴜᴛ !")
917
+ template = message.text.split(" ", 1)[1]
918
+ await save_group_settings(grp_id, 'template', template)
919
+ await sts.edit(f"✅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴄʜᴀɴɢᴇᴅ ᴛᴇᴍᴘʟᴀᴛᴇ ꜰᴏʀ <code>{title}</code> ᴛᴏ\n\n{template}")
920
+
921
+
922
+ @Client.on_message((filters.command(["request", "Request"]) | filters.regex("#request") | filters.regex("#Request")) & filters.group)
923
+ async def requests(bot, message):
924
+ if REQST_CHANNEL is None or SUPPORT_CHAT_ID is None: return # Must add REQST_CHANNEL and SUPPORT_CHAT_ID to use this feature
925
+ if message.reply_to_message and SUPPORT_CHAT_ID == message.chat.id:
926
+ chat_id = message.chat.id
927
+ reporter = str(message.from_user.id)
928
+ mention = message.from_user.mention
929
+ success = True
930
+ content = message.reply_to_message.text
931
+ try:
932
+ if REQST_CHANNEL is not None:
933
+ btn = [[
934
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.reply_to_message.link}"),
935
+ InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
936
+ ]]
937
+ reported_post = await bot.send_message(chat_id=REQST_CHANNEL, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
938
+ success = True
939
+ elif len(content) >= 3:
940
+ for admin in ADMINS:
941
+ btn = [[
942
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.reply_to_message.link}"),
943
+ InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
944
+ ]]
945
+ reported_post = await bot.send_message(chat_id=admin, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
946
+ success = True
947
+ else:
948
+ if len(content) < 3:
949
+ await message.reply_text("<b>ʏᴏᴜ ᴍᴜꜱᴛ ᴛʏᴘᴇ ᴀʙᴏᴜᴛ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ [ᴍɪɴɪᴍᴜᴍ 3 ᴄʜᴀʀᴀᴄᴛᴇʀꜱ]. ʀᴇǫᴜᴇꜱᴛꜱ ᴄᴀɴ'ᴛ ʙᴇ ᴇᴍᴘᴛʏ.</b>")
950
+ if len(content) < 3:
951
+ success = False
952
+ except Exception as e:
953
+ await message.reply_text(f"Error: {e}")
954
+ pass
955
+
956
+ elif SUPPORT_CHAT_ID == message.chat.id:
957
+ chat_id = message.chat.id
958
+ reporter = str(message.from_user.id)
959
+ mention = message.from_user.mention
960
+ success = True
961
+ content = message.text
962
+ keywords = ["#request", "/request", "#Request", "/Request"]
963
+ for keyword in keywords:
964
+ if keyword in content:
965
+ content = content.replace(keyword, "")
966
+ try:
967
+ if REQST_CHANNEL is not None and len(content) >= 3:
968
+ btn = [[
969
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.link}"),
970
+ InlineKeyboardButton('ꜱʜ��ᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
971
+ ]]
972
+ reported_post = await bot.send_message(chat_id=REQST_CHANNEL, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
973
+ success = True
974
+ elif len(content) >= 3:
975
+ for admin in ADMINS:
976
+ btn = [[
977
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.link}"),
978
+ InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
979
+ ]]
980
+ reported_post = await bot.send_message(chat_id=admin, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
981
+ success = True
982
+ else:
983
+ if len(content) < 3:
984
+ await message.reply_text("<b>ʏᴏᴜ ᴍᴜꜱᴛ ᴛʏᴘᴇ ᴀʙᴏᴜᴛ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ [ᴍɪɴɪᴍᴜᴍ 3 ᴄʜᴀʀᴀᴄᴛᴇʀꜱ]. ʀᴇǫᴜᴇꜱᴛꜱ ᴄᴀɴ'ᴛ ʙᴇ ᴇᴍᴘᴛʏ.</b>")
985
+ if len(content) < 3:
986
+ success = False
987
+ except Exception as e:
988
+ await message.reply_text(f"Error: {e}")
989
+ pass
990
+
991
+ elif SUPPORT_CHAT_ID == message.chat.id:
992
+ chat_id = message.chat.id
993
+ reporter = str(message.from_user.id)
994
+ mention = message.from_user.mention
995
+ success = True
996
+ content = message.text
997
+ keywords = ["#request", "/request", "#Request", "/Request"]
998
+ for keyword in keywords:
999
+ if keyword in content:
1000
+ content = content.replace(keyword, "")
1001
+ try:
1002
+ if REQST_CHANNEL is not None and len(content) >= 3:
1003
+ btn = [[
1004
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.link}"),
1005
+ InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
1006
+ ]]
1007
+ reported_post = await bot.send_message(chat_id=REQST_CHANNEL, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
1008
+ success = True
1009
+ elif len(content) >= 3:
1010
+ for admin in ADMINS:
1011
+ btn = [[
1012
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.link}"),
1013
+ InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
1014
+ ]]
1015
+ reported_post = await bot.send_message(chat_id=admin, text=f"<b>📝 ʀᴇǫᴜᴇꜱᴛ : <u>{content}</u>\n\n📚 ʀᴇᴘᴏʀᴛᴇᴅ ʙʏ : {mention}\n📖 ʀᴇᴘᴏʀᴛᴇʀ ɪᴅ : {reporter}\n\n©️ ᴛʜᴇ ᴍᴏᴠɪᴇ ᴘʀᴏᴠɪᴅᴇʀ™</b>", reply_markup=InlineKeyboardMarkup(btn))
1016
+ success = True
1017
+ else:
1018
+ if len(content) < 3:
1019
+ await message.reply_text("<b>ʏᴏᴜ ᴍᴜꜱᴛ ᴛʏᴘᴇ ᴀʙᴏᴜᴛ ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ [ᴍɪɴɪᴍᴜᴍ 3 ᴄʜᴀʀᴀᴄᴛᴇʀꜱ]. ʀᴇǫᴜᴇꜱᴛꜱ ᴄᴀɴ'ᴛ ʙᴇ ᴇᴍᴘᴛʏ.</b>")
1020
+ if len(content) < 3:
1021
+ success = False
1022
+ except Exception as e:
1023
+ await message.reply_text(f"Error: {e}")
1024
+ pass
1025
+
1026
+ else:
1027
+ success = False
1028
+
1029
+ if success:
1030
+ '''if isinstance(REQST_CHANNEL, (int, str)):
1031
+ channels = [REQST_CHANNEL]
1032
+ elif isinstance(REQST_CHANNEL, list):
1033
+ channels = REQST_CHANNEL
1034
+ for channel in channels:
1035
+ chat = await bot.get_chat(channel)
1036
+ #chat = int(chat)'''
1037
+ link = await bot.create_chat_invite_link(int(REQST_CHANNEL))
1038
+ btn = [[
1039
+ InlineKeyboardButton('ᴊᴏɪɴ ᴄʜᴀɴɴᴇʟ', url=link.invite_link),
1040
+ InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{reported_post.link}")
1041
+ ]]
1042
+ await message.reply_text("<b>ʏᴏᴜʀ ʀᴇǫᴜᴇꜱᴛ ʜᴀꜱ ʙᴇᴇɴ ᴀᴅᴅᴇᴅ! ᴘʟᴇᴀꜱᴇ ᴡᴀɪᴛ ꜰᴏʀ ꜱᴏᴍᴇ ᴛɪᴍᴇ.\n\nᴊᴏɪɴ ᴄʜᴀɴɴᴇʟ ꜰɪʀꜱᴛ & ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ.</b>", reply_markup=InlineKeyboardMarkup(btn))
1043
+
1044
+ @Client.on_message(filters.command("send") & filters.user(ADMINS))
1045
+ async def send_msg(bot, message):
1046
+ if message.reply_to_message:
1047
+ target_id = message.text.split(" ", 1)[1]
1048
+ out = "Users Saved In DB Are:\n\n"
1049
+ success = False
1050
+ try:
1051
+ user = await bot.get_users(target_id)
1052
+ users = await db.get_all_users()
1053
+ async for usr in users:
1054
+ out += f"{usr['id']}"
1055
+ out += '\n'
1056
+ if str(user.id) in str(out):
1057
+ await message.reply_to_message.copy(int(user.id))
1058
+ success = True
1059
+ else:
1060
+ success = False
1061
+ if success:
1062
+ await message.reply_text(f"<b>ʏᴏᴜʀ ᴍᴇꜱꜱᴀɢᴇ ʜᴀꜱ ʙᴇᴇɴ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ꜱᴇɴᴛ ᴛᴏ {user.mention}.</b>")
1063
+ else:
1064
+ await message.reply_text("<b>ᴛʜɪꜱ ᴜꜱᴇʀ ᴅɪᴅɴ'ᴛ ꜱᴛᴀʀᴛᴇᴅ ᴛʜɪꜱ ʙᴏᴛ ʏᴇᴛ !</b>")
1065
+ except Exception as e:
1066
+ await message.reply_text(f"<b>Error: {e}</b>")
1067
+ else:
1068
+ await message.reply_text("<b>ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴀꜱ ᴀ ʀᴇᴘʟʏ ᴛᴏ ᴀɴʏ ᴍᴇꜱꜱᴀɢᴇ ᴜꜱɪɴɢ ᴛʜᴇ ᴛᴀʀɢᴇᴛ ᴄʜᴀᴛ ɪᴅ. ꜰᴏʀ ᴇɢ: /send ᴜꜱᴇʀɪᴅ</b>")
1069
+
1070
+ @Client.on_message(filters.command("deletefiles") & filters.user(ADMINS))
1071
+
1072
+ async def deletemultiplefiles(bot, message):
1073
+
1074
+ chat_type = message.chat.type
1075
+
1076
+ if chat_type != enums.ChatType.PRIVATE:
1077
+
1078
+ return await message.reply_text(f"<b>ʜᴇʏ {message.from_user.mention},\nᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴡᴏɴ'ᴛ ᴡᴏʀᴋ ɪɴ ɢʀᴏᴜᴘꜱ !\nɪᴛ ᴏɴʟʏ ᴡᴏʀᴋꜱ ɪɴ ᴍʏ ᴘᴍ.</b>")
1079
+
1080
+ else:
1081
+
1082
+ pass
1083
+
1084
+ try:
1085
+
1086
+ keyword = message.text.split(" ", 1)[1]
1087
+
1088
+ except:
1089
+
1090
+ return await message.reply_text(f"<b>ʜᴇʏ {message.from_user.mention},\nɢɪᴠᴇ ᴍᴇ ᴀ ᴋᴇʏᴡᴏʀᴅ ᴀʟᴏɴɢ ᴡɪᴛʜ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ᴅᴇʟᴇᴛᴇ ꜰɪʟᴇꜱ.</b>")
1091
+
1092
+ btn = [[
1093
+
1094
+ InlineKeyboardButton("⚠️ ʏᴇꜱ, ᴄᴏɴᴛɪɴᴜᴇ ⚠️", callback_data=f"killfilesdq#{keyword}")
1095
+
1096
+ ],[
1097
+
1098
+ InlineKeyboardButton("❌ ɴᴏ, ᴀʙᴏʀᴛ ᴏᴘᴇʀᴀᴛɪᴏɴ ❌", callback_data="close_data")
1099
+
1100
+ ]]
1101
+
1102
+ await message.reply_text(
1103
+
1104
+ text="<b>ᴀʀᴇ ʏᴏᴜ ꜱᴜʀᴇ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴄᴏɴᴛɪɴᴜᴇ ?\nɴᴏᴛᴇ : ᴛʜɪꜱ ᴄᴏᴜʟᴅ ʙᴇ ᴀ ᴅᴇꜱᴛʀᴜᴄᴛɪᴠᴇ ᴅᴇꜱɪᴄɪᴏɴ.</b>",
1105
+
1106
+ reply_markup=InlineKeyboardMarkup(btn),
1107
+
1108
+ parse_mode=enums.ParseMode.HTML
1109
+
1110
+ )
1111
+
1112
+ @Client.on_message(filters.command("shortlink"))
1113
+ async def shortlink(bot, message):
1114
+ userid = message.from_user.id if message.from_user else None
1115
+ if not userid:
1116
+ return await message.reply(f"ʏᴏᴜ'ʀᴇ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ, ᴛᴜʀɴ ᴏꜰꜰ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ ᴀɴᴅ ᴛʀʏ ᴛʜɪꜱ ᴀɢᴀɪɴ ᴄᴏᴍᴍᴀɴᴅ.")
1117
+ chat_type = message.chat.type
1118
+ if chat_type == enums.ChatType.PRIVATE:
1119
+ return await message.reply_text(f"<b>ʜᴇʏ {message.from_user.mention}, ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴏɴʟʏ ᴡᴏʀᴋꜱ ɪɴ ɢʀᴏᴜᴘꜱ !")
1120
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1121
+ grpid = message.chat.id
1122
+ title = message.chat.title
1123
+ else:
1124
+ return
1125
+ data = message.text
1126
+ userid = message.from_user.id
1127
+ user = await bot.get_chat_member(grpid, userid)
1128
+ if user.status != enums.ChatMemberStatus.ADMINISTRATOR and user.status != enums.ChatMemberStatus.OWNER and str(userid) not in ADMINS:
1129
+ return await message.reply_text("<b>ʏᴏᴜ ᴅᴏɴ'ᴛ ʜᴀᴠᴇ ᴀᴄᴄᴇꜱꜱ ᴛᴏ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ !\nᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴏɴʟʏ ᴡᴏʀᴋꜱ ꜰᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴꜱ.</b>")
1130
+ else:
1131
+ pass
1132
+ try:
1133
+ command, shortlink_url, api = data.split(" ")
1134
+ except:
1135
+ return await message.reply_text("<b>ᴄᴏᴍᴍᴀɴᴅ ɪɴᴄᴏᴍᴘʟᴇᴛᴇ !\nɢɪᴠᴇ ᴍᴇ ᴄᴏᴍᴍᴀɴᴅ ᴀʟᴏɴɢ ᴡɪᴛʜ ꜱʜᴏʀᴛɴᴇʀ ᴡᴇʙꜱɪᴛᴇ ᴀɴᴅ ᴀᴘɪ.\n\nꜰᴏʀᴍᴀᴛ : <code>/shortlink krishnalink.com c8dacdff6e91a8e4b4f093fdb4d8ae31bc273c1a</code>")
1136
+ reply = await message.reply_text("<b>ᴘʟᴇᴀꜱᴇ ᴡᴀɪᴛ...</b>")
1137
+ shortlink_url = re.sub(r"https?://?", "", shortlink_url)
1138
+ shortlink_url = re.sub(r"[:/]", "", shortlink_url)
1139
+ await save_group_settings(grpid, 'shortlink', shortlink_url)
1140
+ await save_group_settings(grpid, 'shortlink_api', api)
1141
+ await save_group_settings(grpid, 'is_shortlink', True)
1142
+ await reply.edit_text(f"<b>✅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴀᴅᴅᴇᴅ ꜱʜᴏʀᴛʟɪɴᴋ ꜰᴏʀ <code>{title}</code>.\n\nꜱʜᴏʀᴛʟɪɴᴋ ᴡᴇʙꜱɪᴛᴇ : <code>{shortlink_url}</code>\nꜱʜᴏʀᴛʟɪɴᴋ ᴀᴘɪ : <code>{api}</code></b>")
1143
+
1144
+ @Client.on_message(filters.command("setshortlinkoff") & filters.user(ADMINS))
1145
+ async def offshortlink(bot, message):
1146
+ chat_type = message.chat.type
1147
+ if chat_type == enums.ChatType.PRIVATE:
1148
+ return await message.reply_text("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴡᴏʀᴋꜱ ᴏɴʟʏ ɪɴ ɢʀᴏᴜᴘꜱ !")
1149
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1150
+ grpid = message.chat.id
1151
+ title = message.chat.title
1152
+ else:
1153
+ return
1154
+ await save_group_settings(grpid, 'is_shortlink', False)
1155
+ ENABLE_SHORTLINK = False
1156
+ return await message.reply_text("ꜱʜᴏʀᴛʟɪɴᴋ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅɪꜱᴀʙʟᴇᴅ.")
1157
+
1158
+ @Client.on_message(filters.command("setshortlinkon") & filters.user(ADMINS))
1159
+ async def onshortlink(bot, message):
1160
+ chat_type = message.chat.type
1161
+ if chat_type == enums.ChatType.PRIVATE:
1162
+ return await message.reply_text("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴡᴏʀᴋꜱ ᴏɴʟʏ ɪɴ ɢʀᴏᴜᴘꜱ !")
1163
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1164
+ grpid = message.chat.id
1165
+ title = message.chat.title
1166
+ else:
1167
+ return
1168
+ await save_group_settings(grpid, 'is_shortlink', True)
1169
+ ENABLE_SHORTLINK = True
1170
+ return await message.reply_text("ꜱʜᴏʀᴛʟɪɴᴋ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴇɴᴀʙʟᴇᴅ.")
1171
+
1172
+
1173
+ @Client.on_message(filters.command("shortlink_info"))
1174
+ async def ginfo(bot, message):
1175
+ chat_type = message.chat.type
1176
+ if chat_type == enums.ChatType.PRIVATE:
1177
+ return await message.reply_text(f"<b>{message.from_user.mention},\n\nᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ɪɴ ʏᴏᴜʀ ɢʀᴏᴜᴘ.</b>")
1178
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1179
+ grpid = message.chat.id
1180
+ title = message.chat.title
1181
+ else:
1182
+ return
1183
+ chat_id=message.chat.id
1184
+ userid = message.from_user.id
1185
+ user = await bot.get_chat_member(grpid, userid)
1186
+ # if 'shortlink' in settings.keys():
1187
+ # su = settings['shortlink']
1188
+ # sa = settings['shortlink_api']
1189
+ # else:
1190
+ # return await message.reply_text("<b>Shortener Url Not Connected\n\nYou can Connect Using /shortlink command</b>")
1191
+ # if 'tutorial' in settings.keys():
1192
+ # st = settings['tutorial']
1193
+ # else:
1194
+ # return await message.reply_text("<b>Tutorial Link Not Connected\n\nYou can Connect Using /set_tutorial command</b>")
1195
+ if user.status != enums.ChatMemberStatus.ADMINISTRATOR and user.status != enums.ChatMemberStatus.OWNER and str(userid) not in ADMINS:
1196
+ return await message.reply_text("<b>ᴏɴʟʏ ɢʀᴏᴜᴘ ᴏᴡɴᴇʀ ᴏʀ ᴀᴅᴍɪɴ ᴄᴀɴ ᴜꜱᴇ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ !</b>")
1197
+ else:
1198
+ settings = await get_settings(chat_id) #fetching settings for group
1199
+ if 'shortlink' in settings.keys() and 'tutorial' in settings.keys():
1200
+ su = settings['shortlink']
1201
+ sa = settings['shortlink_api']
1202
+ st = settings['tutorial']
1203
+ return await message.reply_text(f"<b><u>ᴄᴜʀʀᴇɴᴛ ꜱᴛᴀᴛᴜꜱ<u> 📊\n\nᴡᴇʙꜱɪᴛᴇ : <code>{su}</code>\n\nᴀᴘɪ : <code>{sa}</code>\n\nᴛᴜᴛᴏʀɪᴀʟ : {st}</b>", disable_web_page_preview=True)
1204
+ elif 'shortlink' in settings.keys() and 'tutorial' not in settings.keys():
1205
+ su = settings['shortlink']
1206
+ sa = settings['shortlink_api']
1207
+ return await message.reply_text(f"<b><u>ᴄᴜʀʀᴇɴᴛ ꜱᴛᴀᴛᴜꜱ<u> 📊\n\nᴡᴇʙꜱɪᴛᴇ : <code>{su}</code>\n\nᴀᴘɪ : <code>{sa}</code>\n\nᴜꜱᴇ /set_tutorial ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ꜱᴇᴛ ʏᴏᴜʀ ᴛᴜᴛᴏʀɪᴀʟ.")
1208
+ elif 'shortlink' not in settings.keys() and 'tutorial' in settings.keys():
1209
+ st = settings['tutorial']
1210
+ return await message.reply_text(f"<b>ᴛᴜᴛᴏʀɪᴀʟ : <code>{st}</code>\n\nᴜꜱᴇ /shortlink ᴄᴏᴍᴍᴀɴᴅ ᴛᴏ ᴄᴏɴɴᴇᴄᴛ ʏᴏᴜʀ ꜱʜᴏʀᴛɴᴇʀ</b>")
1211
+ else:
1212
+ return await message.reply_text("ꜱʜᴏʀᴛɴᴇʀ ᴀɴᴅ ᴛᴜᴛᴏʀɪᴀʟ ᴀʀᴇ ɴᴏᴛ ᴄᴏɴɴᴇᴄᴛᴇᴅ.\n\nᴄʜᴇᴄᴋ /set_tutorial ᴀɴᴅ /shortlink ᴄᴏᴍᴍᴀɴᴅ.")
1213
+
1214
+ @Client.on_message(filters.command("set_tutorial"))
1215
+ async def settutorial(bot, message):
1216
+ userid = message.from_user.id if message.from_user else None
1217
+ if not userid:
1218
+ return await message.reply(f"ʏᴏᴜ'ʀᴇ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ, ᴛᴜʀɴ ᴏꜰꜰ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ ᴀɴᴅ ᴛʀʏ ᴀɢᴀɪɴ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ.")
1219
+ chat_type = message.chat.type
1220
+ if chat_type == enums.ChatType.PRIVATE:
1221
+ return await message.reply_text("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴡᴏʀᴋꜱ ᴏɴʟʏ ɪɴ ɢʀᴏᴜᴘꜱ !")
1222
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1223
+ grpid = message.chat.id
1224
+ title = message.chat.title
1225
+ else:
1226
+ return
1227
+ userid = message.from_user.id
1228
+ user = await bot.get_chat_member(grpid, userid)
1229
+ if user.status != enums.ChatMemberStatus.ADMINISTRATOR and user.status != enums.ChatMemberStatus.OWNER and str(userid) not in ADMINS:
1230
+ return
1231
+ else:
1232
+ pass
1233
+ if len(message.command) == 1:
1234
+ return await message.reply("<b>ɢɪᴠᴇ ᴍᴇ ᴀ ᴛᴜᴛᴏʀɪᴀʟ ʟɪɴᴋ ᴀʟᴏɴɢ ᴡɪᴛʜ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ.\n\nᴜꜱᴀɢᴇ : /set_tutorial <code>https://t.me/HowToOpenHP</code></b>")
1235
+ elif len(message.command) == 2:
1236
+ reply = await message.reply_text("<b>ᴘʟᴇᴀꜱᴇ ᴡᴀɪᴛ...</b>")
1237
+ tutorial = message.command[1]
1238
+ await save_group_settings(grpid, 'tutorial', tutorial)
1239
+ await save_group_settings(grpid, 'is_tutorial', True)
1240
+ await reply.edit_text(f"<b>✅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴀᴅᴅᴇᴅ ᴛᴜᴛᴏʀɪᴀʟ\n\nʏᴏᴜʀ ɢʀᴏᴜᴘ : {title}\n\nʏᴏᴜʀ ᴛᴜᴛᴏʀɪᴀʟ : <code>{tutorial}</code></b>")
1241
+ else:
1242
+ return await message.reply("<b>ʏᴏᴜ ᴇɴᴛᴇʀᴇᴅ ɪɴᴄᴏʀʀᴇᴄᴛ ꜰᴏʀᴍᴀᴛ !\nᴄᴏʀʀᴇᴄᴛ ꜰᴏʀᴍᴀᴛ : /set_tutorial <code>https://t.me/HowToOpenHP</code></b>")
1243
+
1244
+ @Client.on_message(filters.command("remove_tutorial"))
1245
+ async def removetutorial(bot, message):
1246
+ userid = message.from_user.id if message.from_user else None
1247
+ if not userid:
1248
+ return await message.reply(f"ʏᴏᴜ'ʀᴇ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ, ᴛᴜʀɴ ᴏꜰꜰ ᴀɴᴏɴʏᴍᴏᴜꜱ ᴀᴅᴍɪɴ ᴀɴᴅ ᴛʀʏ ᴀɢᴀɪɴ ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ.")
1249
+ chat_type = message.chat.type
1250
+ if chat_type == enums.ChatType.PRIVATE:
1251
+ return await message.reply_text("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ᴏɴʟʏ ᴡᴏʀᴋꜱ ɪɴ ɢʀᴏᴜᴘꜱ !")
1252
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
1253
+ grpid = message.chat.id
1254
+ title = message.chat.title
1255
+ else:
1256
+ return
1257
+ userid = message.from_user.id
1258
+ user = await bot.get_chat_member(grpid, userid)
1259
+ if user.status != enums.ChatMemberStatus.ADMINISTRATOR and user.status != enums.ChatMemberStatus.OWNER and str(userid) not in ADMINS:
1260
+ return
1261
+ else:
1262
+ pass
1263
+ reply = await message.reply_text("<b>ᴘʟᴇᴀꜱᴇ ᴡᴀɪᴛ...</b>")
1264
+ await save_group_settings(grpid, 'is_tutorial', False)
1265
+ await reply.edit_text(f"<b>ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ʀᴇᴍᴏᴠᴇᴅ ᴛᴜᴛᴏʀɪᴀʟ ʟɪɴᴋ ✅</b>")
1266
+
1267
+ @Client.on_message(filters.command("restart") & filters.user(ADMINS))
1268
+ async def stop_button(bot, message):
1269
+ msg = await bot.send_message(text="<b><i>ʙᴏᴛ ɪꜱ ʀᴇꜱᴛᴀʀᴛɪɴɢ</i></b>", chat_id=message.chat.id)
1270
+ await asyncio.sleep(3)
1271
+ await msg.edit("<b><i><u>ʙᴏᴛ ɪꜱ ʀᴇꜱᴛᴀʀᴛᴇᴅ</u> ✅</i></b>")
1272
+ os.execl(sys.executable, sys.executable, *sys.argv)
plugins/connection.py ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import filters, Client, enums
2
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
3
+ from database.connections_mdb import add_connection, all_connections, if_active, delete_connection
4
+ from info import ADMINS
5
+ import logging
6
+
7
+ logger = logging.getLogger(__name__)
8
+ logger.setLevel(logging.ERROR)
9
+
10
+
11
+ @Client.on_message((filters.private | filters.group) & filters.command('connect'))
12
+ async def addconnection(client, message):
13
+ userid = message.from_user.id if message.from_user else None
14
+ if not userid:
15
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
16
+ chat_type = message.chat.type
17
+
18
+ if chat_type == enums.ChatType.PRIVATE:
19
+ try:
20
+ cmd, group_id = message.text.split(" ", 1)
21
+ except:
22
+ await message.reply_text(
23
+ "<b>Enter in correct format!</b>\n\n"
24
+ "<code>/connect groupid</code>\n\n"
25
+ "<i>Get your Group id by adding this bot to your group and use <code>/id</code></i>",
26
+ quote=True
27
+ )
28
+ return
29
+
30
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
31
+ group_id = message.chat.id
32
+
33
+ try:
34
+ st = await client.get_chat_member(group_id, userid)
35
+ if (
36
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
37
+ and st.status != enums.ChatMemberStatus.OWNER
38
+ and userid not in ADMINS
39
+ ):
40
+ await message.reply_text("You should be an admin in Given group!", quote=True)
41
+ return
42
+ except Exception as e:
43
+ logger.exception(e)
44
+ await message.reply_text(
45
+ "Invalid Group ID!\n\nIf correct, Make sure I'm present in your group!!",
46
+ quote=True,
47
+ )
48
+
49
+ return
50
+ try:
51
+ st = await client.get_chat_member(group_id, "me")
52
+ if st.status == enums.ChatMemberStatus.ADMINISTRATOR:
53
+ ttl = await client.get_chat(group_id)
54
+ title = ttl.title
55
+
56
+ addcon = await add_connection(str(group_id), str(userid))
57
+ if addcon:
58
+ await message.reply_text(
59
+ f"Successfully connected to **{title}**\nNow manage your group from my pm !",
60
+ quote=True,
61
+ parse_mode=enums.ParseMode.MARKDOWN
62
+ )
63
+ if chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
64
+ await client.send_message(
65
+ userid,
66
+ f"Connected to **{title}** !",
67
+ parse_mode=enums.ParseMode.MARKDOWN
68
+ )
69
+ else:
70
+ await message.reply_text(
71
+ "You're already connected to this chat!",
72
+ quote=True
73
+ )
74
+ else:
75
+ await message.reply_text("Add me as an admin in group", quote=True)
76
+ except Exception as e:
77
+ logger.exception(e)
78
+ await message.reply_text('Some error occurred! Try again later.', quote=True)
79
+ return
80
+
81
+
82
+ @Client.on_message((filters.private | filters.group) & filters.command('disconnect'))
83
+ async def deleteconnection(client, message):
84
+ userid = message.from_user.id if message.from_user else None
85
+ if not userid:
86
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
87
+ chat_type = message.chat.type
88
+
89
+ if chat_type == enums.ChatType.PRIVATE:
90
+ await message.reply_text("Run /connections to view or disconnect from groups!", quote=True)
91
+
92
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
93
+ group_id = message.chat.id
94
+
95
+ st = await client.get_chat_member(group_id, userid)
96
+ if (
97
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
98
+ and st.status != enums.ChatMemberStatus.OWNER
99
+ and str(userid) not in ADMINS
100
+ ):
101
+ return
102
+
103
+ delcon = await delete_connection(str(userid), str(group_id))
104
+ if delcon:
105
+ await message.reply_text("Successfully disconnected from this chat", quote=True)
106
+ else:
107
+ await message.reply_text("This chat isn't connected to me!\nDo /connect to connect.", quote=True)
108
+
109
+
110
+ @Client.on_message(filters.private & filters.command(["connections"]))
111
+ async def connections(client, message):
112
+ userid = message.from_user.id
113
+
114
+ groupids = await all_connections(str(userid))
115
+ if groupids is None:
116
+ await message.reply_text(
117
+ "There are no active connections!! Connect to some groups first.",
118
+ quote=True
119
+ )
120
+ return
121
+ buttons = []
122
+ for groupid in groupids:
123
+ try:
124
+ ttl = await client.get_chat(int(groupid))
125
+ title = ttl.title
126
+ active = await if_active(str(userid), str(groupid))
127
+ act = " - ACTIVE" if active else ""
128
+ buttons.append(
129
+ [
130
+ InlineKeyboardButton(
131
+ text=f"{title}{act}", callback_data=f"groupcb:{groupid}:{act}"
132
+ )
133
+ ]
134
+ )
135
+ except:
136
+ pass
137
+ if buttons:
138
+ await message.reply_text(
139
+ "Your connected group details ;\n\n",
140
+ reply_markup=InlineKeyboardMarkup(buttons),
141
+ quote=True
142
+ )
143
+ else:
144
+ await message.reply_text(
145
+ "There are no active connections!! Connect to some groups first.",
146
+ quote=True
147
+ )
plugins/files_delete.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import logging
3
+ from pyrogram import Client, filters
4
+ from info import DELETE_CHANNELS
5
+ from database.ia_filterdb import Media, unpack_new_file_id
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ media_filter = filters.document | filters.video | filters.audio
10
+
11
+
12
+ @Client.on_message(filters.chat(DELETE_CHANNELS) & media_filter)
13
+ async def deletemultiplemedia(bot, message):
14
+ """Delete Multiple files from database"""
15
+
16
+ for file_type in ("document", "video", "audio"):
17
+ media = getattr(message, file_type, None)
18
+ if media is not None:
19
+ break
20
+ else:
21
+ return
22
+
23
+ file_id, file_ref = unpack_new_file_id(media.file_id)
24
+
25
+ result = await Media.collection.delete_one({
26
+ '_id': file_id,
27
+ })
28
+ if result.deleted_count:
29
+ logger.info('File is successfully deleted from database.')
30
+ else:
31
+ file_name = re.sub(r"(_|\-|\.|\+)", " ", str(media.file_name))
32
+ result = await Media.collection.delete_many({
33
+ 'file_name': file_name,
34
+ 'file_size': media.file_size,
35
+ 'mime_type': media.mime_type
36
+ })
37
+ if result.deleted_count:
38
+ logger.info('File is successfully deleted from database.')
39
+ else:
40
+ result = await Media.collection.delete_many({
41
+ 'file_name': media.file_name,
42
+ 'file_size': media.file_size,
43
+ 'mime_type': media.mime_type
44
+ })
45
+ if result.deleted_count:
46
+ logger.info('File is successfully deleted from database.')
47
+ else:
48
+ logger.info('File not found in database.')
plugins/filters.py ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import io
2
+ from pyrogram import filters, Client, enums
3
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
4
+ from database.filters_mdb import(
5
+ add_filter,
6
+ get_filters,
7
+ delete_filter,
8
+ count_filters
9
+ )
10
+
11
+ from database.connections_mdb import active_connection
12
+ from utils import get_file_id, parser, split_quotes
13
+ from info import ADMINS
14
+
15
+
16
+ @Client.on_message(filters.command(['filter', 'add']) & filters.incoming)
17
+ async def addfilter(client, message):
18
+ userid = message.from_user.id if message.from_user else None
19
+ if not userid:
20
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
21
+ chat_type = message.chat.type
22
+ args = message.text.html.split(None, 1)
23
+
24
+ if chat_type == enums.ChatType.PRIVATE:
25
+ grpid = await active_connection(str(userid))
26
+ if grpid is not None:
27
+ grp_id = grpid
28
+ try:
29
+ chat = await client.get_chat(grpid)
30
+ title = chat.title
31
+ except:
32
+ await message.reply_text("Make sure I'm present in your group!!", quote=True)
33
+ return
34
+ else:
35
+ await message.reply_text("I'm not connected to any groups!", quote=True)
36
+ return
37
+
38
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
39
+ grp_id = message.chat.id
40
+ title = message.chat.title
41
+
42
+ else:
43
+ return
44
+
45
+ st = await client.get_chat_member(grp_id, userid)
46
+ if (
47
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
48
+ and st.status != enums.ChatMemberStatus.OWNER
49
+ and str(userid) not in ADMINS
50
+ ):
51
+ return
52
+
53
+
54
+ if len(args) < 2:
55
+ await message.reply_text("Command Incomplete :(", quote=True)
56
+ return
57
+
58
+ extracted = split_quotes(args[1])
59
+ text = extracted[0].lower()
60
+
61
+ if not message.reply_to_message and len(extracted) < 2:
62
+ await message.reply_text("Add some content to save your filter!", quote=True)
63
+ return
64
+
65
+ if (len(extracted) >= 2) and not message.reply_to_message:
66
+ reply_text, btn, alert = parser(extracted[1], text)
67
+ fileid = None
68
+ if not reply_text:
69
+ await message.reply_text("You cannot have buttons alone, give some text to go with it!", quote=True)
70
+ return
71
+
72
+ elif message.reply_to_message and message.reply_to_message.reply_markup:
73
+ try:
74
+ rm = message.reply_to_message.reply_markup
75
+ btn = rm.inline_keyboard
76
+ msg = get_file_id(message.reply_to_message)
77
+ if msg:
78
+ fileid = msg.file_id
79
+ reply_text = message.reply_to_message.caption.html
80
+ else:
81
+ reply_text = message.reply_to_message.text.html
82
+ fileid = None
83
+ alert = None
84
+ except:
85
+ reply_text = ""
86
+ btn = "[]"
87
+ fileid = None
88
+ alert = None
89
+
90
+ elif message.reply_to_message and message.reply_to_message.media:
91
+ try:
92
+ msg = get_file_id(message.reply_to_message)
93
+ fileid = msg.file_id if msg else None
94
+ reply_text, btn, alert = parser(extracted[1], text) if message.reply_to_message.sticker else parser(message.reply_to_message.caption.html, text)
95
+ except:
96
+ reply_text = ""
97
+ btn = "[]"
98
+ alert = None
99
+ elif message.reply_to_message and message.reply_to_message.text:
100
+ try:
101
+ fileid = None
102
+ reply_text, btn, alert = parser(message.reply_to_message.text.html, text)
103
+ except:
104
+ reply_text = ""
105
+ btn = "[]"
106
+ alert = None
107
+ else:
108
+ return
109
+
110
+ await add_filter(grp_id, text, reply_text, btn, fileid, alert)
111
+
112
+ await message.reply_text(
113
+ f"Filter for `{text}` added in **{title}**",
114
+ quote=True,
115
+ parse_mode=enums.ParseMode.MARKDOWN
116
+ )
117
+
118
+
119
+ @Client.on_message(filters.command(['viewfilters', 'filters']) & filters.incoming)
120
+ async def get_all(client, message):
121
+
122
+ chat_type = message.chat.type
123
+ userid = message.from_user.id if message.from_user else None
124
+ if not userid:
125
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
126
+ if chat_type == enums.ChatType.PRIVATE:
127
+ userid = message.from_user.id
128
+ grpid = await active_connection(str(userid))
129
+ if grpid is not None:
130
+ grp_id = grpid
131
+ try:
132
+ chat = await client.get_chat(grpid)
133
+ title = chat.title
134
+ except:
135
+ await message.reply_text("Make sure I'm present in your group!!", quote=True)
136
+ return
137
+ else:
138
+ await message.reply_text("I'm not connected to any groups!", quote=True)
139
+ return
140
+
141
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
142
+ grp_id = message.chat.id
143
+ title = message.chat.title
144
+
145
+ else:
146
+ return
147
+
148
+ st = await client.get_chat_member(grp_id, userid)
149
+ if (
150
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
151
+ and st.status != enums.ChatMemberStatus.OWNER
152
+ and str(userid) not in ADMINS
153
+ ):
154
+ return
155
+
156
+ texts = await get_filters(grp_id)
157
+ count = await count_filters(grp_id)
158
+ if count:
159
+ filterlist = f"Total number of filters in **{title}** : {count}\n\n"
160
+
161
+ for text in texts:
162
+ keywords = " × `{}`\n".format(text)
163
+
164
+ filterlist += keywords
165
+
166
+ if len(filterlist) > 4096:
167
+ with io.BytesIO(str.encode(filterlist.replace("`", ""))) as keyword_file:
168
+ keyword_file.name = "keywords.txt"
169
+ await message.reply_document(
170
+ document=keyword_file,
171
+ quote=True
172
+ )
173
+ return
174
+ else:
175
+ filterlist = f"There are no active filters in **{title}**"
176
+
177
+ await message.reply_text(
178
+ text=filterlist,
179
+ quote=True,
180
+ parse_mode=enums.ParseMode.MARKDOWN
181
+ )
182
+
183
+ @Client.on_message(filters.command('del') & filters.incoming)
184
+ async def deletefilter(client, message):
185
+ userid = message.from_user.id if message.from_user else None
186
+ if not userid:
187
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
188
+ chat_type = message.chat.type
189
+
190
+ if chat_type == enums.ChatType.PRIVATE:
191
+ grpid = await active_connection(str(userid))
192
+ if grpid is not None:
193
+ grp_id = grpid
194
+ try:
195
+ chat = await client.get_chat(grpid)
196
+ title = chat.title
197
+ except:
198
+ await message.reply_text("Make sure I'm present in your group!!", quote=True)
199
+ return
200
+ else:
201
+ await message.reply_text("I'm not connected to any groups!", quote=True)
202
+
203
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
204
+ grp_id = message.chat.id
205
+ title = message.chat.title
206
+
207
+ else:
208
+ return
209
+
210
+ st = await client.get_chat_member(grp_id, userid)
211
+ if (
212
+ st.status != enums.ChatMemberStatus.ADMINISTRATOR
213
+ and st.status != enums.ChatMemberStatus.OWNER
214
+ and str(userid) not in ADMINS
215
+ ):
216
+ return
217
+
218
+ try:
219
+ cmd, text = message.text.split(" ", 1)
220
+ except:
221
+ await message.reply_text(
222
+ "<i>Mention the filtername which you wanna delete!</i>\n\n"
223
+ "<code>/del filtername</code>\n\n"
224
+ "Use /viewfilters to view all available filters",
225
+ quote=True
226
+ )
227
+ return
228
+
229
+ query = text.lower()
230
+
231
+ await delete_filter(message, query, grp_id)
232
+
233
+
234
+ @Client.on_message(filters.command('delall') & filters.incoming)
235
+ async def delallconfirm(client, message):
236
+ userid = message.from_user.id if message.from_user else None
237
+ if not userid:
238
+ return await message.reply(f"You are anonymous admin. Use /connect {message.chat.id} in PM")
239
+ chat_type = message.chat.type
240
+
241
+ if chat_type == enums.ChatType.PRIVATE:
242
+ grpid = await active_connection(str(userid))
243
+ if grpid is not None:
244
+ grp_id = grpid
245
+ try:
246
+ chat = await client.get_chat(grpid)
247
+ title = chat.title
248
+ except:
249
+ await message.reply_text("Make sure I'm present in your group!!", quote=True)
250
+ return
251
+ else:
252
+ await message.reply_text("I'm not connected to any groups!", quote=True)
253
+ return
254
+
255
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
256
+ grp_id = message.chat.id
257
+ title = message.chat.title
258
+
259
+ else:
260
+ return
261
+
262
+ st = await client.get_chat_member(grp_id, userid)
263
+ if (st.status == enums.ChatMemberStatus.OWNER) or (str(userid) in ADMINS):
264
+ await message.reply_text(
265
+ f"This will delete all filters from '{title}'.\nDo you want to continue??",
266
+ reply_markup=InlineKeyboardMarkup([
267
+ [InlineKeyboardButton(text="YES",callback_data="delallconfirm")],
268
+ [InlineKeyboardButton(text="CANCEL",callback_data="delallcancel")]
269
+ ]),
270
+ quote=True
271
+ )
plugins/genlink.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ from pyrogram import filters, Client, enums
3
+ from pyrogram.errors.exceptions.bad_request_400 import ChannelInvalid, UsernameInvalid, UsernameNotModified
4
+ from info import ADMINS, LOG_CHANNEL, FILE_STORE_CHANNEL, PUBLIC_FILE_STORE
5
+ from database.ia_filterdb import unpack_new_file_id
6
+ from utils import temp
7
+ import re
8
+ import os
9
+ import json
10
+ import base64
11
+ import logging
12
+
13
+ logger = logging.getLogger(__name__)
14
+ logger.setLevel(logging.INFO)
15
+
16
+ async def allowed(_, __, message):
17
+ if PUBLIC_FILE_STORE:
18
+ return True
19
+ if message.from_user and message.from_user.id in ADMINS:
20
+ return True
21
+ return False
22
+
23
+ @Client.on_message(filters.command(['link', 'plink']) & filters.create(allowed))
24
+ async def gen_link_s(bot, message):
25
+ replied = message.reply_to_message
26
+ if not replied:
27
+ return await message.reply('Reply to a message to get a shareable link.')
28
+ file_type = replied.media
29
+ if file_type not in [enums.MessageMediaType.VIDEO, enums.MessageMediaType.AUDIO, enums.MessageMediaType.DOCUMENT]:
30
+ return await message.reply("Reply to a supported media")
31
+ if message.has_protected_content and message.chat.id not in ADMINS:
32
+ return await message.reply("okDa")
33
+ file_id, ref = unpack_new_file_id((getattr(replied, file_type.value)).file_id)
34
+ string = 'filep_' if message.text.lower().strip() == "/plink" else 'file_'
35
+ string += file_id
36
+ outstr = base64.urlsafe_b64encode(string.encode("ascii")).decode().strip("=")
37
+ await message.reply(f"Here is your Link:\nhttps://t.me/{temp.U_NAME}?start={outstr}")
38
+
39
+
40
+ @Client.on_message(filters.command(['batch', 'pbatch']) & filters.create(allowed))
41
+ async def gen_link_batch(bot, message):
42
+ if " " not in message.text:
43
+ return await message.reply("Use correct format.\nExample <code>/batch https://t.me/HP_MOVIES_WORLD/10 https://t.me/HP_MOVIES_WORLD/20</code>.")
44
+ links = message.text.strip().split(" ")
45
+ if len(links) != 3:
46
+ return await message.reply("Use correct format.\nExample <code>/batch https://t.me/HP_MOVIES_WORLD/10 https://t.me/HP_MOVIES_WORLD/20</code>.")
47
+ cmd, first, last = links
48
+ regex = re.compile("(https://)?(t\.me/|telegram\.me/|telegram\.dog/)(c/)?(\d+|[a-zA-Z_0-9]+)/(\d+)$")
49
+ match = regex.match(first)
50
+ if not match:
51
+ return await message.reply('Invalid link')
52
+ f_chat_id = match.group(4)
53
+ f_msg_id = int(match.group(5))
54
+ if f_chat_id.isnumeric():
55
+ f_chat_id = int(("-100" + f_chat_id))
56
+
57
+ match = regex.match(last)
58
+ if not match:
59
+ return await message.reply('Invalid link')
60
+ l_chat_id = match.group(4)
61
+ l_msg_id = int(match.group(5))
62
+ if l_chat_id.isnumeric():
63
+ l_chat_id = int(("-100" + l_chat_id))
64
+
65
+ if f_chat_id != l_chat_id:
66
+ return await message.reply("Chat ids not matched.")
67
+ try:
68
+ chat_id = (await bot.get_chat(f_chat_id)).id
69
+ except ChannelInvalid:
70
+ return await message.reply('This may be a private channel / group. Make me an admin over there to index the files.')
71
+ except (UsernameInvalid, UsernameNotModified):
72
+ return await message.reply('Invalid Link specified.')
73
+ except Exception as e:
74
+ return await message.reply(f'Errors - {e}')
75
+
76
+ sts = await message.reply("Generating link for your message.\nThis may take time depending upon number of messages")
77
+ if chat_id in FILE_STORE_CHANNEL:
78
+ string = f"{f_msg_id}_{l_msg_id}_{chat_id}_{cmd.lower().strip()}"
79
+ b_64 = base64.urlsafe_b64encode(string.encode("ascii")).decode().strip("=")
80
+ return await sts.edit(f"Here is your link https://t.me/{temp.U_NAME}?start=DSTORE-{b_64}")
81
+
82
+ FRMT = "Generating Link...\nTotal Messages: `{total}`\nDone: `{current}`\nRemaining: `{rem}`\nStatus: `{sts}`"
83
+
84
+ outlist = []
85
+
86
+ # file store without db channel
87
+ og_msg = 0
88
+ tot = 0
89
+ async for msg in bot.iter_messages(f_chat_id, l_msg_id, f_msg_id):
90
+ tot += 1
91
+ if msg.empty or msg.service:
92
+ continue
93
+ if not msg.media:
94
+ # only media messages supported.
95
+ continue
96
+ try:
97
+ file_type = msg.media
98
+ file = getattr(msg, file_type.value)
99
+ caption = getattr(msg, 'caption', '')
100
+ if caption:
101
+ caption = caption.html
102
+ if file:
103
+ file = {
104
+ "file_id": file.file_id,
105
+ "caption": caption,
106
+ "title": getattr(file, "file_name", ""),
107
+ "size": file.file_size,
108
+ "protect": cmd.lower().strip() == "/pbatch",
109
+ }
110
+
111
+ og_msg +=1
112
+ outlist.append(file)
113
+ except:
114
+ pass
115
+ if not og_msg % 20:
116
+ try:
117
+ await sts.edit(FRMT.format(total=l_msg_id-f_msg_id, current=tot, rem=((l_msg_id-f_msg_id) - tot), sts="Saving Messages"))
118
+ except:
119
+ pass
120
+ with open(f"batchmode_{message.from_user.id}.json", "w+") as out:
121
+ json.dump(outlist, out)
122
+ post = await bot.send_document(LOG_CHANNEL, f"batchmode_{message.from_user.id}.json", file_name="Batch.json", caption="⚠️Generated for filestore.")
123
+ os.remove(f"batchmode_{message.from_user.id}.json")
124
+ file_id, ref = unpack_new_file_id(post.document.file_id)
125
+ await sts.edit(f"Here is your link\nContains `{og_msg}` files.\n https://t.me/{temp.U_NAME}?start=BATCH-{file_id}")
plugins/gfilters.py ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import io
2
+ from pyrogram import filters, Client, enums
3
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
4
+ from database.gfilters_mdb import(
5
+ add_gfilter,
6
+ get_gfilters,
7
+ delete_gfilter,
8
+ count_gfilters
9
+ )
10
+
11
+ from database.connections_mdb import active_connection
12
+ from utils import get_file_id, gfilterparser, split_quotes
13
+ from info import ADMINS
14
+
15
+
16
+ @Client.on_message(filters.command(['gfilter', 'addg']) & filters.incoming & filters.user(ADMINS))
17
+ async def addgfilter(client, message):
18
+ args = message.text.html.split(None, 1)
19
+
20
+ if len(args) < 2:
21
+ await message.reply_text("Command Incomplete :(", quote=True)
22
+ return
23
+
24
+ extracted = split_quotes(args[1])
25
+ text = extracted[0].lower()
26
+
27
+ if not message.reply_to_message and len(extracted) < 2:
28
+ await message.reply_text("Add some content to save your filter!", quote=True)
29
+ return
30
+
31
+ if (len(extracted) >= 2) and not message.reply_to_message:
32
+ reply_text, btn, alert = gfilterparser(extracted[1], text)
33
+ fileid = None
34
+ if not reply_text:
35
+ await message.reply_text("You cannot have buttons alone, give some text to go with it!", quote=True)
36
+ return
37
+
38
+ elif message.reply_to_message and message.reply_to_message.reply_markup:
39
+ try:
40
+ rm = message.reply_to_message.reply_markup
41
+ btn = rm.inline_keyboard
42
+ msg = get_file_id(message.reply_to_message)
43
+ if msg:
44
+ fileid = msg.file_id
45
+ reply_text = message.reply_to_message.caption.html
46
+ else:
47
+ reply_text = message.reply_to_message.text.html
48
+ fileid = None
49
+ alert = None
50
+ except:
51
+ reply_text = ""
52
+ btn = "[]"
53
+ fileid = None
54
+ alert = None
55
+
56
+ elif message.reply_to_message and message.reply_to_message.media:
57
+ try:
58
+ msg = get_file_id(message.reply_to_message)
59
+ fileid = msg.file_id if msg else None
60
+ reply_text, btn, alert = gfilterparser(extracted[1], text) if message.reply_to_message.sticker else gfilterparser(message.reply_to_message.caption.html, text)
61
+ except:
62
+ reply_text = ""
63
+ btn = "[]"
64
+ alert = None
65
+ elif message.reply_to_message and message.reply_to_message.text:
66
+ try:
67
+ fileid = None
68
+ reply_text, btn, alert = gfilterparser(message.reply_to_message.text.html, text)
69
+ except:
70
+ reply_text = ""
71
+ btn = "[]"
72
+ alert = None
73
+ else:
74
+ return
75
+
76
+ await add_gfilter('gfilters', text, reply_text, btn, fileid, alert)
77
+
78
+ await message.reply_text(
79
+ f"GFilter for `{text}` added",
80
+ quote=True,
81
+ parse_mode=enums.ParseMode.MARKDOWN
82
+ )
83
+
84
+
85
+ @Client.on_message(filters.command(['viewgfilters', 'gfilters']) & filters.incoming & filters.user(ADMINS))
86
+ async def get_all_gfilters(client, message):
87
+ texts = await get_gfilters('gfilters')
88
+ count = await count_gfilters('gfilters')
89
+ if count:
90
+ gfilterlist = f"Total number of gfilters : {count}\n\n"
91
+
92
+ for text in texts:
93
+ keywords = " × `{}`\n".format(text)
94
+
95
+ gfilterlist += keywords
96
+
97
+ if len(gfilterlist) > 4096:
98
+ with io.BytesIO(str.encode(gfilterlist.replace("`", ""))) as keyword_file:
99
+ keyword_file.name = "keywords.txt"
100
+ await message.reply_document(
101
+ document=keyword_file,
102
+ quote=True
103
+ )
104
+ return
105
+ else:
106
+ gfilterlist = f"There are no active gfilters."
107
+
108
+ await message.reply_text(
109
+ text=gfilterlist,
110
+ quote=True,
111
+ parse_mode=enums.ParseMode.MARKDOWN
112
+ )
113
+
114
+ @Client.on_message(filters.command('delg') & filters.incoming & filters.user(ADMINS))
115
+ async def deletegfilter(client, message):
116
+ try:
117
+ cmd, text = message.text.split(" ", 1)
118
+ except:
119
+ await message.reply_text(
120
+ "<i>Mention the gfiltername which you wanna delete!</i>\n\n"
121
+ "<code>/delg gfiltername</code>\n\n"
122
+ "Use /viewgfilters to view all available gfilters",
123
+ quote=True
124
+ )
125
+ return
126
+
127
+ query = text.lower()
128
+
129
+ await delete_gfilter(message, query, 'gfilters')
130
+
131
+ @Client.on_message(filters.command('delallg') & filters.user(ADMINS))
132
+ async def delallgfilters(client, message):
133
+ await message.reply_text(
134
+ f"Do you want to continue??",
135
+ reply_markup=InlineKeyboardMarkup([
136
+ [InlineKeyboardButton(text="YES",callback_data="gfiltersdeleteallconfirm")],
137
+ [InlineKeyboardButton(text="CANCEL",callback_data="gfiltersdeleteallcancel")]
138
+ ]),
139
+ quote=True
140
+ )
plugins/index.py ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import asyncio
3
+ from pyrogram import Client, filters, enums
4
+ from pyrogram.errors import FloodWait
5
+ from pyrogram.errors.exceptions.bad_request_400 import ChannelInvalid, ChatAdminRequired, UsernameInvalid, UsernameNotModified
6
+ from info import ADMINS
7
+ from info import INDEX_REQ_CHANNEL as LOG_CHANNEL
8
+ from database.ia_filterdb import save_file
9
+ from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
10
+ from utils import temp
11
+ import re
12
+ logger = logging.getLogger(__name__)
13
+ logger.setLevel(logging.INFO)
14
+ lock = asyncio.Lock()
15
+
16
+
17
+ @Client.on_callback_query(filters.regex(r'^index'))
18
+ async def index_files(bot, query):
19
+ if query.data.startswith('index_cancel'):
20
+ temp.CANCEL = True
21
+ return await query.answer("Cancelling Indexing")
22
+ _, raju, chat, lst_msg_id, from_user = query.data.split("#")
23
+ if raju == 'reject':
24
+ await query.message.delete()
25
+ await bot.send_message(int(from_user),
26
+ f'Your Submission for indexing {chat} has been decliened by our moderators.',
27
+ reply_to_message_id=int(lst_msg_id))
28
+ return
29
+
30
+ if lock.locked():
31
+ return await query.answer('Wait until previous process complete.', show_alert=True)
32
+ msg = query.message
33
+
34
+ await query.answer('Processing...⏳', show_alert=True)
35
+ if int(from_user) not in ADMINS:
36
+ await bot.send_message(int(from_user),
37
+ f'Your Submission for indexing {chat} has been accepted by our moderators and will be added soon.',
38
+ reply_to_message_id=int(lst_msg_id))
39
+ await msg.edit(
40
+ "Starting Indexing",
41
+ reply_markup=InlineKeyboardMarkup(
42
+ [[InlineKeyboardButton('Cancel', callback_data='index_cancel')]]
43
+ )
44
+ )
45
+ try:
46
+ chat = int(chat)
47
+ except:
48
+ chat = chat
49
+ await index_files_to_db(int(lst_msg_id), chat, msg, bot)
50
+
51
+
52
+ @Client.on_message((filters.forwarded | (filters.regex("(https://)?(t\.me/|telegram\.me/|telegram\.dog/)(c/)?(\d+|[a-zA-Z_0-9]+)/(\d+)$")) & filters.text ) & filters.private & filters.incoming)
53
+ async def send_for_index(bot, message):
54
+ if message.text:
55
+ regex = re.compile("(https://)?(t\.me/|telegram\.me/|telegram\.dog/)(c/)?(\d+|[a-zA-Z_0-9]+)/(\d+)$")
56
+ match = regex.match(message.text)
57
+ if not match:
58
+ return await message.reply('Invalid link')
59
+ chat_id = match.group(4)
60
+ last_msg_id = int(match.group(5))
61
+ if chat_id.isnumeric():
62
+ chat_id = int(("-100" + chat_id))
63
+ elif message.forward_from_chat.type == enums.ChatType.CHANNEL:
64
+ last_msg_id = message.forward_from_message_id
65
+ chat_id = message.forward_from_chat.username or message.forward_from_chat.id
66
+ else:
67
+ return
68
+ try:
69
+ await bot.get_chat(chat_id)
70
+ except ChannelInvalid:
71
+ return await message.reply('This may be a private channel / group. Make me an admin over there to index the files.')
72
+ except (UsernameInvalid, UsernameNotModified):
73
+ return await message.reply('Invalid Link specified.')
74
+ except Exception as e:
75
+ logger.exception(e)
76
+ return await message.reply(f'Errors - {e}')
77
+ try:
78
+ k = await bot.get_messages(chat_id, last_msg_id)
79
+ except:
80
+ return await message.reply('Make Sure That Iam An Admin In The Channel, if channel is private')
81
+ if k.empty:
82
+ return await message.reply('This may be group and iam not a admin of the group.')
83
+
84
+ if message.from_user.id in ADMINS:
85
+ buttons = [
86
+ [
87
+ InlineKeyboardButton('Yes',
88
+ callback_data=f'index#accept#{chat_id}#{last_msg_id}#{message.from_user.id}')
89
+ ],
90
+ [
91
+ InlineKeyboardButton('close', callback_data='close_data'),
92
+ ]
93
+ ]
94
+ reply_markup = InlineKeyboardMarkup(buttons)
95
+ return await message.reply(
96
+ f'Do you Want To Index This Channel/ Group ?\n\nChat ID/ Username: <code>{chat_id}</code>\nLast Message ID: <code>{last_msg_id}</code>',
97
+ reply_markup=reply_markup)
98
+
99
+ if type(chat_id) is int:
100
+ try:
101
+ link = (await bot.create_chat_invite_link(chat_id)).invite_link
102
+ except ChatAdminRequired:
103
+ return await message.reply('Make sure iam an admin in the chat and have permission to invite users.')
104
+ else:
105
+ link = f"@{message.forward_from_chat.username}"
106
+ buttons = [
107
+ [
108
+ InlineKeyboardButton('Accept Index',
109
+ callback_data=f'index#accept#{chat_id}#{last_msg_id}#{message.from_user.id}')
110
+ ],
111
+ [
112
+ InlineKeyboardButton('Reject Index',
113
+ callback_data=f'index#reject#{chat_id}#{message.id}#{message.from_user.id}'),
114
+ ]
115
+ ]
116
+ reply_markup = InlineKeyboardMarkup(buttons)
117
+ await bot.send_message(LOG_CHANNEL,
118
+ f'#IndexRequest\n\nBy : {message.from_user.mention} (<code>{message.from_user.id}</code>)\nChat ID/ Username - <code> {chat_id}</code>\nLast Message ID - <code>{last_msg_id}</code>\nInviteLink - {link}',
119
+ reply_markup=reply_markup)
120
+ await message.reply('ThankYou For the Contribution, Wait For My Moderators to verify the files.')
121
+
122
+
123
+ @Client.on_message(filters.command('setskip') & filters.user(ADMINS))
124
+ async def set_skip_number(bot, message):
125
+ if ' ' in message.text:
126
+ _, skip = message.text.split(" ")
127
+ try:
128
+ skip = int(skip)
129
+ except:
130
+ return await message.reply("Skip number should be an integer.")
131
+ await message.reply(f"Successfully set SKIP number as {skip}")
132
+ temp.CURRENT = int(skip)
133
+ else:
134
+ await message.reply("Give me a skip number")
135
+
136
+
137
+ async def index_files_to_db(lst_msg_id, chat, msg, bot):
138
+ total_files = 0
139
+ duplicate = 0
140
+ errors = 0
141
+ deleted = 0
142
+ no_media = 0
143
+ unsupported = 0
144
+ async with lock:
145
+ try:
146
+ current = temp.CURRENT
147
+ temp.CANCEL = False
148
+ async for message in bot.iter_messages(chat, lst_msg_id, temp.CURRENT):
149
+ if temp.CANCEL:
150
+ await msg.edit(f"Successfully Cancelled!!\n\nSaved <code>{total_files}</code> files to dataBase!\nDuplicate Files Skipped: <code>{duplicate}</code>\nDeleted Messages Skipped: <code>{deleted}</code>\nNon-Media messages skipped: <code>{no_media + unsupported}</code>(Unsupported Media - `{unsupported}` )\nErrors Occurred: <code>{errors}</code>")
151
+ break
152
+ current += 1
153
+ if current % 20 == 0:
154
+ can = [[InlineKeyboardButton('Cancel', callback_data='index_cancel')]]
155
+ reply = InlineKeyboardMarkup(can)
156
+ await msg.edit_text(
157
+ text=f"Total messages fetched: <code>{current}</code>\nTotal messages saved: <code>{total_files}</code>\nDuplicate Files Skipped: <code>{duplicate}</code>\nDeleted Messages Skipped: <code>{deleted}</code>\nNon-Media messages skipped: <code>{no_media + unsupported}</code>(Unsupported Media - `{unsupported}` )\nErrors Occurred: <code>{errors}</code>",
158
+ reply_markup=reply)
159
+ if message.empty:
160
+ deleted += 1
161
+ continue
162
+ elif not message.media:
163
+ no_media += 1
164
+ continue
165
+ elif message.media not in [enums.MessageMediaType.VIDEO, enums.MessageMediaType.AUDIO, enums.MessageMediaType.DOCUMENT]:
166
+ unsupported += 1
167
+ continue
168
+ media = getattr(message, message.media.value, None)
169
+ if not media:
170
+ unsupported += 1
171
+ continue
172
+ media.file_type = message.media.value
173
+ media.caption = message.caption
174
+ aynav, vnay = await save_file(media)
175
+ if aynav:
176
+ total_files += 1
177
+ elif vnay == 0:
178
+ duplicate += 1
179
+ elif vnay == 2:
180
+ errors += 1
181
+ except Exception as e:
182
+ logger.exception(e)
183
+ await msg.edit(f'Error: {e}')
184
+ else:
185
+ await msg.edit(f'Succesfully saved <code>{total_files}</code> to dataBase!\nDuplicate Files Skipped: <code>{duplicate}</code>\nDeleted Messages Skipped: <code>{deleted}</code>\nNon-Media messages skipped: <code>{no_media + unsupported}</code>(Unsupported Media - `{unsupported}` )\nErrors Occurred: <code>{errors}</code>')
plugins/inline.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ from pyrogram import Client, emoji, filters
3
+ from pyrogram.errors.exceptions.bad_request_400 import QueryIdInvalid
4
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, InlineQueryResultCachedDocument, InlineQuery
5
+ from database.ia_filterdb import get_search_results
6
+ from utils import is_req_subscribed, get_size, temp
7
+ from info import CACHE_TIME, AUTH_USERS, AUTH_CHANNEL, CUSTOM_FILE_CAPTION
8
+ from database.connections_mdb import active_connection
9
+
10
+ logger = logging.getLogger(__name__)
11
+ cache_time = 0 if AUTH_USERS or AUTH_CHANNEL else CACHE_TIME
12
+
13
+ async def inline_users(query: InlineQuery):
14
+ if AUTH_USERS:
15
+ if query.from_user and query.from_user.id in AUTH_USERS:
16
+ return True
17
+ else:
18
+ return False
19
+ if query.from_user and query.from_user.id not in temp.BANNED_USERS:
20
+ return True
21
+ return False
22
+
23
+ @Client.on_inline_query()
24
+ async def answer(bot, query):
25
+ """Show search results for given inline query"""
26
+ chat_id = await active_connection(str(query.from_user.id))
27
+
28
+ if not await inline_users(query):
29
+ await query.answer(results=[],
30
+ cache_time=0,
31
+ switch_pm_text='okDa',
32
+ switch_pm_parameter="hehe")
33
+ return
34
+
35
+ if AUTH_CHANNEL and not await is_req_subscribed(bot, query):
36
+ await query.answer(results=[],
37
+ cache_time=0,
38
+ switch_pm_text='You have to subscribe my channel to use the bot',
39
+ switch_pm_parameter="subscribe")
40
+ return
41
+
42
+ results = []
43
+ if '|' in query.query:
44
+ string, file_type = query.query.split('|', maxsplit=1)
45
+ string = string.strip()
46
+ file_type = file_type.strip().lower()
47
+ else:
48
+ string = query.query.strip()
49
+ file_type = None
50
+
51
+ offset = int(query.offset or 0)
52
+ reply_markup = get_reply_markup(query=string)
53
+ files, next_offset, total = await get_search_results(
54
+ chat_id,
55
+ string,
56
+ file_type=file_type,
57
+ max_results=10,
58
+ offset=offset)
59
+
60
+ for file in files:
61
+ title=file.file_name
62
+ size=get_size(file.file_size)
63
+ f_caption=file.caption
64
+ if CUSTOM_FILE_CAPTION:
65
+ try:
66
+ f_caption=CUSTOM_FILE_CAPTION.format(file_name= '' if title is None else title, file_size='' if size is None else size, file_caption='' if f_caption is None else f_caption)
67
+ except Exception as e:
68
+ logger.exception(e)
69
+ f_caption=f_caption
70
+ if f_caption is None:
71
+ f_caption = f"{file.file_name}"
72
+ results.append(
73
+ InlineQueryResultCachedDocument(
74
+ title=file.file_name,
75
+ document_file_id=file.file_id,
76
+ caption=f_caption,
77
+ description=f'Size: {get_size(file.file_size)}\nType: {file.file_type}',
78
+ reply_markup=reply_markup))
79
+
80
+ if results:
81
+ switch_pm_text = f"{emoji.FILE_FOLDER} Results - {total}"
82
+ if string:
83
+ switch_pm_text += f" for {string}"
84
+ try:
85
+ await query.answer(results=results,
86
+ is_personal = True,
87
+ cache_time=cache_time,
88
+ switch_pm_text=switch_pm_text,
89
+ switch_pm_parameter="start",
90
+ next_offset=str(next_offset))
91
+ except QueryIdInvalid:
92
+ pass
93
+ except Exception as e:
94
+ logging.exception(str(e))
95
+ else:
96
+ switch_pm_text = f'{emoji.CROSS_MARK} No results'
97
+ if string:
98
+ switch_pm_text += f' for "{string}"'
99
+
100
+ await query.answer(results=[],
101
+ is_personal = True,
102
+ cache_time=cache_time,
103
+ switch_pm_text=switch_pm_text,
104
+ switch_pm_parameter="okay")
105
+
106
+
107
+ def get_reply_markup(query):
108
+ buttons = [
109
+ [
110
+ InlineKeyboardButton('Search again', switch_inline_query_current_chat=query)
111
+ ]
112
+ ]
113
+ return InlineKeyboardMarkup(buttons)
114
+
115
+
plugins/join_req.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import Client, filters, enums
2
+ from pyrogram.types import ChatJoinRequest
3
+ from database.users_chats_db import db
4
+ from info import ADMINS, AUTH_CHANNEL
5
+
6
+ @Client.on_chat_join_request(filters.chat(AUTH_CHANNEL))
7
+ async def join_reqs(client, message: ChatJoinRequest):
8
+ if not await db.find_join_req(message.from_user.id):
9
+ await db.add_join_req(message.from_user.id)
10
+
11
+ @Client.on_message(filters.command("delreq") & filters.private & filters.user(ADMINS))
12
+ async def del_requests(client, message):
13
+ await db.del_join_req()
14
+ await message.reply("<b>⚙ ꜱᴜᴄᴄᴇꜱꜱғᴜʟʟʏ ᴄʜᴀɴɴᴇʟ ʟᴇғᴛ ᴜꜱᴇʀꜱ ᴅᴇʟᴇᴛᴇᴅ</b>")
plugins/misc.py ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pyrogram import Client, filters, enums
3
+ from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant, MediaEmpty, PhotoInvalidDimensions, WebpageMediaEmpty
4
+ from info import IMDB_TEMPLATE
5
+ from utils import extract_user, get_file_id, get_poster, last_online
6
+ import time
7
+ from datetime import datetime
8
+ from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
9
+ import logging
10
+ logger = logging.getLogger(__name__)
11
+ logger.setLevel(logging.ERROR)
12
+
13
+ @Client.on_message(filters.command('id'))
14
+ async def showid(client, message):
15
+ chat_type = message.chat.type
16
+ if chat_type == enums.ChatType.PRIVATE:
17
+ user_id = message.chat.id
18
+ first = message.from_user.first_name
19
+ last = message.from_user.last_name or ""
20
+ username = message.from_user.username
21
+ dc_id = message.from_user.dc_id or ""
22
+ await message.reply_text(
23
+ f"<b>➲ First Name:</b> {first}\n<b>➲ Last Name:</b> {last}\n<b>➲ Username:</b> {username}\n<b>➲ Telegram ID:</b> <code>{user_id}</code>\n<b>➲ Data Centre:</b> <code>{dc_id}</code>",
24
+ quote=True
25
+ )
26
+
27
+ elif chat_type in [enums.ChatType.GROUP, enums.ChatType.SUPERGROUP]:
28
+ _id = ""
29
+ _id += (
30
+ "<b>➲ Chat ID</b>: "
31
+ f"<code>{message.chat.id}</code>\n"
32
+ )
33
+ if message.reply_to_message:
34
+ _id += (
35
+ "<b>➲ User ID</b>: "
36
+ f"<code>{message.from_user.id if message.from_user else 'Anonymous'}</code>\n"
37
+ "<b>➲ Replied User ID</b>: "
38
+ f"<code>{message.reply_to_message.from_user.id if message.reply_to_message.from_user else 'Anonymous'}</code>\n"
39
+ )
40
+ file_info = get_file_id(message.reply_to_message)
41
+ else:
42
+ _id += (
43
+ "<b>➲ User ID</b>: "
44
+ f"<code>{message.from_user.id if message.from_user else 'Anonymous'}</code>\n"
45
+ )
46
+ file_info = get_file_id(message)
47
+ if file_info:
48
+ _id += (
49
+ f"<b>{file_info.message_type}</b>: "
50
+ f"<code>{file_info.file_id}</code>\n"
51
+ )
52
+ await message.reply_text(
53
+ _id,
54
+ quote=True
55
+ )
56
+
57
+ @Client.on_message(filters.command(["info"]))
58
+ async def who_is(client, message):
59
+ # https://github.com/SpEcHiDe/PyroGramBot/blob/master/pyrobot/plugins/admemes/whois.py#L19
60
+ status_message = await message.reply_text(
61
+ "`Fetching user info...`"
62
+ )
63
+ await status_message.edit(
64
+ "`Processing user info...`"
65
+ )
66
+ from_user = None
67
+ from_user_id, _ = extract_user(message)
68
+ try:
69
+ from_user = await client.get_users(from_user_id)
70
+ except Exception as error:
71
+ await status_message.edit(str(error))
72
+ return
73
+ if from_user is None:
74
+ return await status_message.edit("no valid user_id / message specified")
75
+ message_out_str = ""
76
+ message_out_str += f"<b>➲First Name:</b> {from_user.first_name}\n"
77
+ last_name = from_user.last_name or "<b>None</b>"
78
+ message_out_str += f"<b>➲Last Name:</b> {last_name}\n"
79
+ message_out_str += f"<b>➲Telegram ID:</b> <code>{from_user.id}</code>\n"
80
+ username = from_user.username or "<b>None</b>"
81
+ dc_id = from_user.dc_id or "[User Doesn't Have A Valid DP]"
82
+ message_out_str += f"<b>➲Data Centre:</b> <code>{dc_id}</code>\n"
83
+ message_out_str += f"<b>➲User Name:</b> @{username}\n"
84
+ message_out_str += f"<b>➲User 𝖫𝗂𝗇𝗄:</b> <a href='tg://user?id={from_user.id}'><b>Click Here</b></a>\n"
85
+ if message.chat.type in ((enums.ChatType.SUPERGROUP, enums.ChatType.CHANNEL)):
86
+ try:
87
+ chat_member_p = await message.chat.get_member(from_user.id)
88
+ joined_date = (
89
+ chat_member_p.joined_date or datetime.now()
90
+ ).strftime("%Y.%m.%d %H:%M:%S")
91
+ message_out_str += (
92
+ "<b>➲Joined this Chat on:</b> <code>"
93
+ f"{joined_date}"
94
+ "</code>\n"
95
+ )
96
+ except UserNotParticipant:
97
+ pass
98
+ chat_photo = from_user.photo
99
+ if chat_photo:
100
+ local_user_photo = await client.download_media(
101
+ message=chat_photo.big_file_id
102
+ )
103
+ buttons = [[
104
+ InlineKeyboardButton('🔐 Close', callback_data='close_data')
105
+ ]]
106
+ reply_markup = InlineKeyboardMarkup(buttons)
107
+ await message.reply_photo(
108
+ photo=local_user_photo,
109
+ quote=True,
110
+ reply_markup=reply_markup,
111
+ caption=message_out_str,
112
+ parse_mode=enums.ParseMode.HTML,
113
+ disable_notification=True
114
+ )
115
+ os.remove(local_user_photo)
116
+ else:
117
+ buttons = [[
118
+ InlineKeyboardButton('🔐 Close', callback_data='close_data')
119
+ ]]
120
+ reply_markup = InlineKeyboardMarkup(buttons)
121
+ await message.reply_text(
122
+ text=message_out_str,
123
+ reply_markup=reply_markup,
124
+ quote=True,
125
+ parse_mode=enums.ParseMode.HTML,
126
+ disable_notification=True
127
+ )
128
+ await status_message.delete()
129
+
130
+ @Client.on_message(filters.command(["imdb", 'search']))
131
+ async def imdb_search(client, message):
132
+ if ' ' in message.text:
133
+ k = await message.reply('Searching ImDB')
134
+ r, title = message.text.split(None, 1)
135
+ movies = await get_poster(title, bulk=True)
136
+ if not movies:
137
+ return await message.reply("No results Found")
138
+ btn = [
139
+ [
140
+ InlineKeyboardButton(
141
+ text=f"{movie.get('title')} - {movie.get('year')}",
142
+ callback_data=f"imdb#{movie.movieID}",
143
+ )
144
+ ]
145
+ for movie in movies
146
+ ]
147
+ await k.edit('Here is what i found on IMDb', reply_markup=InlineKeyboardMarkup(btn))
148
+ else:
149
+ await message.reply('Give me a movie / series Name')
150
+
151
+ @Client.on_callback_query(filters.regex('^imdb'))
152
+ async def imdb_callback(bot: Client, quer_y: CallbackQuery):
153
+ i, movie = quer_y.data.split('#')
154
+ imdb = await get_poster(query=movie, id=True)
155
+ btn = [
156
+ [
157
+ InlineKeyboardButton(
158
+ text=f"{imdb.get('title')}",
159
+ url=imdb['url'],
160
+ )
161
+ ]
162
+ ]
163
+ message = quer_y.message.reply_to_message or quer_y.message
164
+ if imdb:
165
+ caption = IMDB_TEMPLATE.format(
166
+ query = imdb['title'],
167
+ title = imdb['title'],
168
+ votes = imdb['votes'],
169
+ aka = imdb["aka"],
170
+ seasons = imdb["seasons"],
171
+ box_office = imdb['box_office'],
172
+ localized_title = imdb['localized_title'],
173
+ kind = imdb['kind'],
174
+ imdb_id = imdb["imdb_id"],
175
+ cast = imdb["cast"],
176
+ runtime = imdb["runtime"],
177
+ countries = imdb["countries"],
178
+ certificates = imdb["certificates"],
179
+ languages = imdb["languages"],
180
+ director = imdb["director"],
181
+ writer = imdb["writer"],
182
+ producer = imdb["producer"],
183
+ composer = imdb["composer"],
184
+ cinematographer = imdb["cinematographer"],
185
+ music_team = imdb["music_team"],
186
+ distributors = imdb["distributors"],
187
+ release_date = imdb['release_date'],
188
+ year = imdb['year'],
189
+ genres = imdb['genres'],
190
+ poster = imdb['poster'],
191
+ plot = imdb['plot'],
192
+ rating = imdb['rating'],
193
+ url = imdb['url'],
194
+ **locals()
195
+ )
196
+ else:
197
+ caption = "No Results"
198
+ if imdb.get('poster'):
199
+ try:
200
+ await quer_y.message.reply_photo(photo=imdb['poster'], caption=caption, reply_markup=InlineKeyboardMarkup(btn))
201
+ except (MediaEmpty, PhotoInvalidDimensions, WebpageMediaEmpty):
202
+ pic = imdb.get('poster')
203
+ poster = pic.replace('.jpg', "._V1_UX360.jpg")
204
+ await quer_y.message.reply_photo(photo=poster, caption=caption, reply_markup=InlineKeyboardMarkup(btn))
205
+ except Exception as e:
206
+ logger.exception(e)
207
+ await quer_y.message.reply(caption, reply_markup=InlineKeyboardMarkup(btn), disable_web_page_preview=False)
208
+ await quer_y.message.delete()
209
+ else:
210
+ await quer_y.message.edit(caption, reply_markup=InlineKeyboardMarkup(btn), disable_web_page_preview=False)
211
+ await quer_y.answer()
212
+
213
+
214
+
plugins/p_ttishow.py ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyrogram import Client, filters, enums
2
+ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery
3
+ from pyrogram.errors.exceptions.bad_request_400 import MessageTooLong, PeerIdInvalid
4
+ from info import ADMINS, LOG_CHANNEL, SUPPORT_CHAT, MELCOW_NEW_USERS, MELCOW_VID, CHNL_LNK, GRP_LNK
5
+ from database.users_chats_db import db
6
+ from database.ia_filterdb import Media
7
+ from utils import get_size, temp, get_settings
8
+ from Script import script
9
+ from pyrogram.errors import ChatAdminRequired
10
+ import asyncio
11
+
12
+ """-----------------------------------------https://t.me/TheMovieProviderBot--------------------------------------"""
13
+
14
+ @Client.on_message(filters.new_chat_members & filters.group)
15
+ async def save_group(bot, message):
16
+ r_j_check = [u.id for u in message.new_chat_members]
17
+ if temp.ME in r_j_check:
18
+ if not await db.get_chat(message.chat.id):
19
+ total=await bot.get_chat_members_count(message.chat.id)
20
+ r_j = message.from_user.mention if message.from_user else "Anonymous"
21
+ await bot.send_message(LOG_CHANNEL, script.LOG_TEXT_G.format(message.chat.title, message.chat.id, total, r_j))
22
+ await db.add_chat(message.chat.id, message.chat.title)
23
+ if message.chat.id in temp.BANNED_CHATS:
24
+ # Inspired from a boat of a banana tree
25
+ buttons = [[
26
+ InlineKeyboardButton('📌 ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ 📌', url=f'https://t.me/HpRequestBot')
27
+ ]]
28
+ reply_markup=InlineKeyboardMarkup(buttons)
29
+ k = await message.reply(
30
+ text='<b>ᴄʜᴀᴛ ɴᴏᴛ ᴀʟʟᴏᴡᴇᴅ 🐞\n\nᴍʏ ᴀᴅᴍɪɴꜱ ʜᴀꜱ ʀᴇꜱᴛʀɪᴄᴛᴇᴅ ᴍᴇ ꜰʀᴏᴍ ᴡᴏʀᴋɪɴɢ ʜᴇʀᴇ ! ɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴋɴᴏᴡ ᴍᴏʀᴇ ᴀʙᴏᴜᴛ ɪᴛ ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ.</b>',
31
+ reply_markup=reply_markup,
32
+ )
33
+
34
+ try:
35
+ await k.pin()
36
+ except:
37
+ pass
38
+ await bot.leave_chat(message.chat.id)
39
+ return
40
+ buttons = [[
41
+ InlineKeyboardButton("🍁 ʜᴏᴡ ᴛᴏ ᴜꜱᴇ 🍁", url="https://t.me/TheMovieProviderBot?start=help")
42
+ ]]
43
+ reply_markup=InlineKeyboardMarkup(buttons)
44
+ await message.reply_text(
45
+ text=f"<b>›› ᴛʜᴀɴᴋꜱ ꜰᴏʀ ᴀᴅᴅɪɴɢ ᴍᴇ ɪɴ {message.chat.title} \n›› ᴅᴏɴ'ᴛ ꜰᴏʀɢᴇᴛ ᴛᴏ ᴍᴀᴋᴇ ᴍᴇ ᴀᴅᴍɪɴ.\n›› ɪꜰ ᴀɴʏ ᴅᴏᴜʙᴛꜱ ᴀʙᴏᴜᴛ ᴜꜱɪɴɢ ᴍᴇ ᴄʟɪᴄᴋ ᴏɴ ʙᴇʟᴏᴡ ʙᴜᴛᴛᴏɴ 👇</b>",
46
+ reply_markup=reply_markup)
47
+ else:
48
+ settings = await get_settings(message.chat.id)
49
+ if settings["welcome"]:
50
+ for u in message.new_chat_members:
51
+ if (temp.MELCOW).get('welcome') is not None:
52
+ try:
53
+ await (temp.MELCOW['welcome']).delete()
54
+ except:
55
+ pass
56
+ temp.MELCOW['welcome'] = await message.reply_video(
57
+ video=(MELCOW_VID),
58
+ caption=(script.MELCOW_ENG.format(u.mention, message.chat.title)),
59
+ reply_markup=InlineKeyboardMarkup(
60
+ [[
61
+ InlineKeyboardButton("📌 ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ 📌", url=f'https://t.me/HpRequestBot')
62
+ ]]
63
+ ),
64
+ parse_mode=enums.ParseMode.HTML
65
+ )
66
+
67
+ if settings["auto_delete"]:
68
+ await asyncio.sleep(600)
69
+ await (temp.MELCOW['welcome']).delete()
70
+
71
+
72
+
73
+
74
+
75
+ @Client.on_message(filters.command('leave') & filters.user(ADMINS))
76
+ async def leave_a_chat(bot, message):
77
+ if len(message.command) == 1:
78
+ return await message.reply('Give me a chat id')
79
+ chat = message.command[1]
80
+ try:
81
+ chat = int(chat)
82
+ except:
83
+ chat = chat
84
+ try:
85
+ buttons = [[
86
+ InlineKeyboardButton("📌 ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ 📌", url="https://t.me/HpRequestBot")
87
+ ]]
88
+ reply_markup=InlineKeyboardMarkup(buttons)
89
+ await bot.send_message(
90
+ chat_id=chat,
91
+ text='<b>ʜᴇʟʟᴏ ꜰʀɪᴇɴᴅꜱ, \nᴍʏ ᴀᴅᴍɪɴ ʜᴀꜱ ᴛᴏʟᴅ ᴍᴇ ᴛᴏ ʟᴇᴀᴠᴇ ꜰʀᴏᴍ ɢʀᴏᴜᴘ, ꜱᴏ ɪ ʜᴀᴠᴇ ᴛᴏ ɢᴏ !/nɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴀᴅᴅ ᴍᴇ ᴀɢᴀɪɴ ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ.</b>',
92
+ reply_markup=reply_markup,
93
+ )
94
+
95
+ await bot.leave_chat(chat)
96
+ await message.reply(f"left the chat `{chat}`")
97
+ except Exception as e:
98
+ await message.reply(f'Error - {e}')
99
+
100
+ @Client.on_message(filters.command('disable') & filters.user(ADMINS))
101
+ async def disable_chat(bot, message):
102
+ if len(message.command) == 1:
103
+ return await message.reply('Give me a chat id')
104
+ r = message.text.split(None)
105
+ if len(r) > 2:
106
+ reason = message.text.split(None, 2)[2]
107
+ chat = message.text.split(None, 2)[1]
108
+ else:
109
+ chat = message.command[1]
110
+ reason = "No reason Provided"
111
+ try:
112
+ chat_ = int(chat)
113
+ except:
114
+ return await message.reply('Give Me A Valid Chat ID')
115
+ cha_t = await db.get_chat(int(chat_))
116
+ if not cha_t:
117
+ return await message.reply("Chat Not Found In DB")
118
+ if cha_t['is_disabled']:
119
+ return await message.reply(f"This chat is already disabled:\nReason-<code> {cha_t['reason']} </code>")
120
+ await db.disable_chat(int(chat_), reason)
121
+ temp.BANNED_CHATS.append(int(chat_))
122
+ await message.reply('Chat Successfully Disabled')
123
+ try:
124
+ buttons = [[
125
+ InlineKeyboardButton('📌 ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ 📌', url=f'https://t.me/HpRequestBot')
126
+ ]]
127
+ reply_markup=InlineKeyboardMarkup(buttons)
128
+ await bot.send_message(
129
+ chat_id=chat_,
130
+ text=f'<b>ʜᴇʟʟᴏ ꜰʀɪᴇɴᴅꜱ, \nᴍʏ ᴀᴅᴍɪɴ ʜᴀꜱ ᴛᴏʟᴅ ᴍᴇ ᴛᴏ ʟᴇᴀᴠᴇ ꜰʀᴏᴍ ɢʀᴏᴜᴘ, ꜱᴏ ɪ ʜᴀᴠᴇ ᴛᴏ ɢᴏ ! \nɪꜰ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴀᴅᴅ ᴍᴇ ᴀɢᴀɪɴ ᴄᴏɴᴛᴀᴄᴛ ꜱᴜᴘᴘᴏʀᴛ..</b> \nReason : <code>{reason}</code>',
131
+ reply_markup=reply_markup)
132
+ await bot.leave_chat(chat_)
133
+ except Exception as e:
134
+ await message.reply(f"Error - {e}")
135
+
136
+
137
+ @Client.on_message(filters.command('enable') & filters.user(ADMINS))
138
+ async def re_enable_chat(bot, message):
139
+ if len(message.command) == 1:
140
+ return await message.reply('Give me a chat id')
141
+ chat = message.command[1]
142
+ try:
143
+ chat_ = int(chat)
144
+ except:
145
+ return await message.reply('Give Me A Valid Chat ID')
146
+ sts = await db.get_chat(int(chat))
147
+ if not sts:
148
+ return await message.reply("Chat Not Found In DB !")
149
+ if not sts.get('is_disabled'):
150
+ return await message.reply('This chat is not yet disabled.')
151
+ await db.re_enable_chat(int(chat_))
152
+ temp.BANNED_CHATS.remove(int(chat_))
153
+ await message.reply("Chat Successfully re-enabled")
154
+
155
+
156
+ @Client.on_message(filters.command('stats') & filters.incoming)
157
+ async def get_ststs(bot, message):
158
+ rju = await message.reply('Fetching stats..')
159
+ total_users = await db.total_users_count()
160
+ totl_chats = await db.total_chat_count()
161
+ files = await Media.count_documents()
162
+ size = await db.get_db_size()
163
+ free = 536870912 - size
164
+ size = get_size(size)
165
+ free = get_size(free)
166
+ await rju.edit(script.STATUS_TXT.format(files, total_users, totl_chats, size, free))
167
+
168
+
169
+ @Client.on_message(filters.command('invite') & filters.user(ADMINS))
170
+ async def gen_invite(bot, message):
171
+ if len(message.command) == 1:
172
+ return await message.reply('Give me a chat id')
173
+ chat = message.command[1]
174
+ try:
175
+ chat = int(chat)
176
+ except:
177
+ return await message.reply('Give Me A Valid Chat ID')
178
+ try:
179
+ link = await bot.create_chat_invite_link(chat)
180
+ except ChatAdminRequired:
181
+ return await message.reply("Invite Link Generation Failed, Iam Not Having Sufficient Rights")
182
+ except Exception as e:
183
+ return await message.reply(f'Error {e}')
184
+ await message.reply(f'Here is your Invite Link {link.invite_link}')
185
+
186
+ @Client.on_message(filters.command('ban') & filters.user(ADMINS))
187
+ async def ban_a_user(bot, message):
188
+ # https://t.me/GetTGLink/4185
189
+ if len(message.command) == 1:
190
+ return await message.reply('Give me a user id / username')
191
+ r = message.text.split(None)
192
+ if len(r) > 2:
193
+ reason = message.text.split(None, 2)[2]
194
+ chat = message.text.split(None, 2)[1]
195
+ else:
196
+ chat = message.command[1]
197
+ reason = "No reason Provided"
198
+ try:
199
+ chat = int(chat)
200
+ except:
201
+ pass
202
+ try:
203
+ k = await bot.get_users(chat)
204
+ except PeerIdInvalid:
205
+ return await message.reply("This is an invalid user, make sure I have met him before.")
206
+ except IndexError:
207
+ return await message.reply("This might be a channel, make sure its a user.")
208
+ except Exception as e:
209
+ return await message.reply(f'Error - {e}')
210
+ else:
211
+ jar = await db.get_ban_status(k.id)
212
+ if jar['is_banned']:
213
+ return await message.reply(f"{k.mention} is already banned\nReason: {jar['ban_reason']}")
214
+ await db.ban_user(k.id, reason)
215
+ temp.BANNED_USERS.append(k.id)
216
+ await message.reply(f"Successfully banned {k.mention}")
217
+
218
+
219
+
220
+ @Client.on_message(filters.command('unban') & filters.user(ADMINS))
221
+ async def unban_a_user(bot, message):
222
+ if len(message.command) == 1:
223
+ return await message.reply('Give me a user id / username')
224
+ r = message.text.split(None)
225
+ if len(r) > 2:
226
+ reason = message.text.split(None, 2)[2]
227
+ chat = message.text.split(None, 2)[1]
228
+ else:
229
+ chat = message.command[1]
230
+ reason = "No reason Provided"
231
+ try:
232
+ chat = int(chat)
233
+ except:
234
+ pass
235
+ try:
236
+ k = await bot.get_users(chat)
237
+ except PeerIdInvalid:
238
+ return await message.reply("This is an invalid user, make sure ia have met him before.")
239
+ except IndexError:
240
+ return await message.reply("Thismight be a channel, make sure its a user.")
241
+ except Exception as e:
242
+ return await message.reply(f'Error - {e}')
243
+ else:
244
+ jar = await db.get_ban_status(k.id)
245
+ if not jar['is_banned']:
246
+ return await message.reply(f"{k.mention} is not yet banned.")
247
+ await db.remove_ban(k.id)
248
+ temp.BANNED_USERS.remove(k.id)
249
+ await message.reply(f"Successfully unbanned {k.mention}")
250
+
251
+
252
+
253
+ @Client.on_message(filters.command('users') & filters.user(ADMINS))
254
+ async def list_users(bot, message):
255
+ # https://t.me/GetTGLink/4184
256
+ raju = await message.reply('Getting List Of Users')
257
+ users = await db.get_all_users()
258
+ out = "Users Saved In DB Are:\n\n"
259
+ async for user in users:
260
+ out += f"<a href=tg://user?id={user['id']}>{user['name']}</a>"
261
+ if user['ban_status']['is_banned']:
262
+ out += '( Banned User )'
263
+ out += '\n'
264
+ try:
265
+ await raju.edit_text(out)
266
+ except MessageTooLong:
267
+ with open('users.txt', 'w+') as outfile:
268
+ outfile.write(out)
269
+ await message.reply_document('users.txt', caption="List Of Users")
270
+
271
+ @Client.on_message(filters.command('chats') & filters.user(ADMINS))
272
+ async def list_chats(bot, message):
273
+ raju = await message.reply('Getting List Of chats')
274
+ chats = await db.get_all_chats()
275
+ out = "Chats Saved In DB Are:\n\n"
276
+ async for chat in chats:
277
+ out += f"**Title:** `{chat['title']}`\n**- ID:** `{chat['id']}`"
278
+ if chat['chat_status']['is_disabled']:
279
+ out += '( Disabled Chat )'
280
+ out += '\n'
281
+ try:
282
+ await raju.edit_text(out)
283
+ except MessageTooLong:
284
+ with open('chats.txt', 'w+') as outfile:
285
+ outfile.write(out)
286
+ await message.reply_document('chats.txt', caption="List Of Chats")
plugins/pmfilter.py ADDED
The diff for this file is too large to render. See raw diff
 
plugins/route.py ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from aiohttp import web
2
+ import re
3
+ import math
4
+ import logging
5
+ import secrets
6
+ import time
7
+ import mimetypes
8
+ from aiohttp.http_exceptions import BadStatusLine
9
+ from lazybot import multi_clients, work_loads, LazyPrincessBot
10
+ from server.exceptions import FIleNotFound, InvalidHash
11
+ from zzint import StartTime, __version__
12
+ from util.custom_dl import ByteStreamer
13
+ from util.time_format import get_readable_time
14
+ from util.render_template import render_page
15
+ from info import *
16
+
17
+
18
+ routes = web.RouteTableDef()
19
+
20
+ @routes.get("/", allow_head=True)
21
+ async def root_route_handler(request):
22
+ return web.json_response("BenFilterBot")
23
+
24
+
25
+ @routes.get(r"/watch/{path:\S+}", allow_head=True)
26
+ async def stream_handler(request: web.Request):
27
+ try:
28
+ path = request.match_info["path"]
29
+ match = re.search(r"^([a-zA-Z0-9_-]{6})(\d+)$", path)
30
+ if match:
31
+ secure_hash = match.group(1)
32
+ id = int(match.group(2))
33
+ else:
34
+ id = int(re.search(r"(\d+)(?:\/\S+)?", path).group(1))
35
+ secure_hash = request.rel_url.query.get("hash")
36
+ return web.Response(text=await render_page(id, secure_hash), content_type='text/html')
37
+ except InvalidHash as e:
38
+ raise web.HTTPForbidden(text=e.message)
39
+ except FIleNotFound as e:
40
+ raise web.HTTPNotFound(text=e.message)
41
+ except (AttributeError, BadStatusLine, ConnectionResetError):
42
+ pass
43
+ except Exception as e:
44
+ logging.critical(e.with_traceback(None))
45
+ raise web.HTTPInternalServerError(text=str(e))
46
+
47
+ @routes.get(r"/{path:\S+}", allow_head=True)
48
+ async def stream_handler(request: web.Request):
49
+ try:
50
+ path = request.match_info["path"]
51
+ match = re.search(r"^([a-zA-Z0-9_-]{6})(\d+)$", path)
52
+ if match:
53
+ secure_hash = match.group(1)
54
+ id = int(match.group(2))
55
+ else:
56
+ id = int(re.search(r"(\d+)(?:\/\S+)?", path).group(1))
57
+ secure_hash = request.rel_url.query.get("hash")
58
+ return await media_streamer(request, id, secure_hash)
59
+ except InvalidHash as e:
60
+ raise web.HTTPForbidden(text=e.message)
61
+ except FIleNotFound as e:
62
+ raise web.HTTPNotFound(text=e.message)
63
+ except (AttributeError, BadStatusLine, ConnectionResetError):
64
+ pass
65
+ except Exception as e:
66
+ logging.critical(e.with_traceback(None))
67
+ raise web.HTTPInternalServerError(text=str(e))
68
+
69
+ class_cache = {}
70
+
71
+ async def media_streamer(request: web.Request, id: int, secure_hash: str):
72
+ range_header = request.headers.get("Range", 0)
73
+
74
+ index = min(work_loads, key=work_loads.get)
75
+ faster_client = multi_clients[index]
76
+
77
+ if MULTI_CLIENT:
78
+ logging.info(f"Client {index} is now serving {request.remote}")
79
+
80
+ if faster_client in class_cache:
81
+ tg_connect = class_cache[faster_client]
82
+ logging.debug(f"Using cached ByteStreamer object for client {index}")
83
+ else:
84
+ logging.debug(f"Creating new ByteStreamer object for client {index}")
85
+ tg_connect = ByteStreamer(faster_client)
86
+ class_cache[faster_client] = tg_connect
87
+ logging.debug("before calling get_file_properties")
88
+ file_id = await tg_connect.get_file_properties(id)
89
+ logging.debug("after calling get_file_properties")
90
+
91
+ if file_id.unique_id[:6] != secure_hash:
92
+ logging.debug(f"Invalid hash for message with ID {id}")
93
+ raise InvalidHash
94
+
95
+ file_size = file_id.file_size
96
+
97
+ if range_header:
98
+ from_bytes, until_bytes = range_header.replace("bytes=", "").split("-")
99
+ from_bytes = int(from_bytes)
100
+ until_bytes = int(until_bytes) if until_bytes else file_size - 1
101
+ else:
102
+ from_bytes = request.http_range.start or 0
103
+ until_bytes = (request.http_range.stop or file_size) - 1
104
+
105
+ if (until_bytes > file_size) or (from_bytes < 0) or (until_bytes < from_bytes):
106
+ return web.Response(
107
+ status=416,
108
+ body="416: Range not satisfiable",
109
+ headers={"Content-Range": f"bytes */{file_size}"},
110
+ )
111
+
112
+ chunk_size = 1024 * 1024
113
+ until_bytes = min(until_bytes, file_size - 1)
114
+
115
+ offset = from_bytes - (from_bytes % chunk_size)
116
+ first_part_cut = from_bytes - offset
117
+ last_part_cut = until_bytes % chunk_size + 1
118
+
119
+ req_length = until_bytes - from_bytes + 1
120
+ part_count = math.ceil(until_bytes / chunk_size) - math.floor(offset / chunk_size)
121
+ body = tg_connect.yield_file(
122
+ file_id, index, offset, first_part_cut, last_part_cut, part_count, chunk_size
123
+ )
124
+
125
+ mime_type = file_id.mime_type
126
+ file_name = file_id.file_name
127
+ disposition = "attachment"
128
+
129
+ if mime_type:
130
+ if not file_name:
131
+ try:
132
+ file_name = f"{secrets.token_hex(2)}.{mime_type.split('/')[1]}"
133
+ except (IndexError, AttributeError):
134
+ file_name = f"{secrets.token_hex(2)}.unknown"
135
+ else:
136
+ if file_name:
137
+ mime_type = mimetypes.guess_type(file_id.file_name)
138
+ else:
139
+ mime_type = "application/octet-stream"
140
+ file_name = f"{secrets.token_hex(2)}.unknown"
141
+
142
+ return web.Response(
143
+ status=206 if range_header else 200,
144
+ body=body,
145
+ headers={
146
+ "Content-Type": f"{mime_type}",
147
+ "Content-Range": f"bytes {from_bytes}-{until_bytes}/{file_size}",
148
+ "Content-Length": str(req_length),
149
+ "Content-Disposition": f'{disposition}; filename="{file_name}"',
150
+ "Accept-Ranges": "bytes",
151
+ },
152
+ )
render.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ # A Docker web service
3
+ - type: web
4
+ name: TheMovieProviderBot
5
+ env: python
6
+ startCommand: python3 bot.py
7
+ buildCommand: pip3 install -U -r requirements.txt
8
+ repo: https://github.com/HarshalPurohitEdits/TheMovieProviderBot.git # optional
9
+ region: oregon # optional (defaults to oregon)
10
+ plan: free # optional (defaults to starter)
11
+ branch: main # optional (defaults to master)
12
+ numInstances: 1 # optional (defaults to 1)
13
+ healthCheckPath: /
14
+
15
+ #End of yaml
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ python-telegram-bot==13.15
3
+ pymongo
runtime.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ python-3.10.8
server/TheMovieProviderBot ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+
4
+ # import re
5
+ # import math
6
+ # import logging
7
+ # import secrets
8
+ # import mimetypes
9
+ # from aiohttp import web
10
+ # from aiohttp.http_exceptions import BadStatusLine
11
+ # from lazybot import multi_clients, work_loads, StreamBot
12
+ # from server.exceptions import FIleNotFound, InvalidHash
13
+ # from zzint import StartTime, __version__
14
+ # from ..util.custom_dl import ByteStreamer
15
+ # from util.render_template import render_page
16
+ # from info import *
17
+
18
+
19
+ # routes = web.RouteTableDef()
20
+
21
+ # @routes.get("/", allow_head=True)
22
+ # async def root_route_handler(request):
23
+ # return web.json_response("in & as LazyDeveloper...")
24
+
25
+
26
+ # @routes.get(r"/watch/{path:\S+}", allow_head=True)
27
+ # async def stream_handler(request: web.Request):
28
+ # try:
29
+ # path = request.match_info["path"]
30
+ # match = re.search(r"^([a-zA-Z0-9_-]{6})(\d+)$", path)
31
+ # if match:
32
+ # secure_hash = match.group(1)
33
+ # id = int(match.group(2))
34
+ # else:
35
+ # id = int(re.search(r"(\d+)(?:\/\S+)?", path).group(1))
36
+ # secure_hash = request.rel_url.query.get("hash")
37
+ # return web.Response(text=await render_page(id, secure_hash), content_type='text/html')
38
+ # except InvalidHash as e:
39
+ # raise web.HTTPForbidden(text=e.message)
40
+ # except FIleNotFound as e:
41
+ # raise web.HTTPNotFound(text=e.message)
42
+ # except (AttributeError, BadStatusLine, ConnectionResetError):
43
+ # pass
44
+ # except Exception as e:
45
+ # logging.critical(e.with_traceback(None))
46
+ # raise web.HTTPInternalServerError(text=str(e))
47
+
48
+ # @routes.get(r"/{path:\S+}", allow_head=True)
49
+ # async def stream_handler(request: web.Request):
50
+ # try:
51
+ # path = request.match_info["path"]
52
+ # match = re.search(r"^([a-zA-Z0-9_-]{6})(\d+)$", path)
53
+ # if match:
54
+ # secure_hash = match.group(1)
55
+ # id = int(match.group(2))
56
+ # else:
57
+ # id = int(re.search(r"(\d+)(?:\/\S+)?", path).group(1))
58
+ # secure_hash = request.rel_url.query.get("hash")
59
+ # return await media_streamer(request, id, secure_hash)
60
+ # except InvalidHash as e:
61
+ # raise web.HTTPForbidden(text=e.message)
62
+ # except FIleNotFound as e:
63
+ # raise web.HTTPNotFound(text=e.message)
64
+ # except (AttributeError, BadStatusLine, ConnectionResetError):
65
+ # pass
66
+ # except Exception as e:
67
+ # logging.critical(e.with_traceback(None))
68
+ # raise web.HTTPInternalServerError(text=str(e))
69
+
70
+ # class_cache = {}
71
+
72
+ # async def media_streamer(request: web.Request, id: int, secure_hash: str):
73
+ # range_header = request.headers.get("Range", 0)
74
+
75
+ # index = min(work_loads, key=work_loads.get)
76
+ # faster_client = multi_clients[index]
77
+
78
+ # if MULTI_CLIENT:
79
+ # logging.info(f"Client {index} is now serving {request.remote}")
80
+
81
+ # if faster_client in class_cache:
82
+ # tg_connect = class_cache[faster_client]
83
+ # logging.debug(f"Using cached ByteStreamer object for client {index}")
84
+ # else:
85
+ # logging.debug(f"Creating new ByteStreamer object for client {index}")
86
+ # tg_connect = ByteStreamer(faster_client)
87
+ # class_cache[faster_client] = tg_connect
88
+ # logging.debug("before calling get_file_properties")
89
+ # file_id = await tg_connect.get_file_properties(id)
90
+ # logging.debug("after calling get_file_properties")
91
+
92
+ # if file_id.unique_id[:6] != secure_hash:
93
+ # logging.debug(f"Invalid hash for message with ID {id}")
94
+ # raise InvalidHash
95
+
96
+ # file_size = file_id.file_size
97
+
98
+ # if range_header:
99
+ # from_bytes, until_bytes = range_header.replace("bytes=", "").split("-")
100
+ # from_bytes = int(from_bytes)
101
+ # until_bytes = int(until_bytes) if until_bytes else file_size - 1
102
+ # else:
103
+ # from_bytes = request.http_range.start or 0
104
+ # until_bytes = (request.http_range.stop or file_size) - 1
105
+
106
+ # if (until_bytes > file_size) or (from_bytes < 0) or (until_bytes < from_bytes):
107
+ # return web.Response(
108
+ # status=416,
109
+ # body="416: Range not satisfiable",
110
+ # headers={"Content-Range": f"bytes */{file_size}"},
111
+ # )
112
+
113
+ # chunk_size = 1024 * 1024
114
+ # until_bytes = min(until_bytes, file_size - 1)
115
+
116
+ # offset = from_bytes - (from_bytes % chunk_size)
117
+ # first_part_cut = from_bytes - offset
118
+ # last_part_cut = until_bytes % chunk_size + 1
119
+
120
+ # req_length = until_bytes - from_bytes + 1
121
+ # part_count = math.ceil(until_bytes / chunk_size) - math.floor(offset / chunk_size)
122
+ # body = tg_connect.yield_file(
123
+ # file_id, index, offset, first_part_cut, last_part_cut, part_count, chunk_size
124
+ # )
125
+
126
+ # mime_type = file_id.mime_type
127
+ # file_name = file_id.file_name
128
+ # disposition = "attachment"
129
+
130
+ # if mime_type:
131
+ # if not file_name:
132
+ # try:
133
+ # file_name = f"{secrets.token_hex(2)}.{mime_type.split('/')[1]}"
134
+ # except (IndexError, AttributeError):
135
+ # file_name = f"{secrets.token_hex(2)}.unknown"
136
+ # else:
137
+ # if file_name:
138
+ # mime_type = mimetypes.guess_type(file_id.file_name)
139
+ # else:
140
+ # mime_type = "application/octet-stream"
141
+ # file_name = f"{secrets.token_hex(2)}.unknown"
142
+
143
+ # return web.Response(
144
+ # status=206 if range_header else 200,
145
+ # body=body,
146
+ # headers={
147
+ # "Content-Type": f"{mime_type}",
148
+ # "Content-Range": f"bytes {from_bytes}-{until_bytes}/{file_size}",
149
+ # "Content-Length": str(req_length),
150
+ # "Content-Disposition": f'{disposition}; filename="{file_name}"',
151
+ # "Accept-Ranges": "bytes",
152
+ # },
153
+ # )
server/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ # Made with Love by HP
server/exceptions.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ class InvalidHash(Exception):
2
+ message = "Invalid hash"
3
+
4
+ class FIleNotFound(Exception):
5
+ message = "File not found"
start.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if [ -z $UPSTREAM_REPO ]
2
+ then
3
+ echo "Cloning main Repository"
4
+ git clone https://github.com/HarshalPurohitEdits/TheMovieProviderBot.git /TheMovieProviderBot
5
+ else
6
+ echo "Cloning Custom Repo from $UPSTREAM_REPO "
7
+ git clone $UPSTREAM_REPO /TheMovieProviderBot
8
+ fi
9
+ cd /TheMovieProviderBot
10
+ pip3 install -U -r requirements.txt
11
+ echo "Starting TheMovieProviderBot...."
12
+ python3 bot.py
template/dl.html ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- this code is written by @biisal tg:biisal-files -->
2
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
3
+
4
+
5
+ <!DOCTYPE html>
6
+ <html lang="en">
7
+
8
+ <head>
9
+ <meta charset="UTF-8">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
+ <title>{{file_name}}</title>
12
+ <link rel="stylesheet" href="https://unpkg.com/sheryjs/dist/Shery.css" />
13
+ <link rel="stylesheet" href="https://aeditx03.github.io/resources/StreamCSS.css">
14
+ <link rel="stylesheet" href="https://aeditx03.github.io/resources/playerCss.css">
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500;700&display=swap" rel="stylesheet">
18
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
19
+ integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
20
+ crossorigin="anonymous" referrerpolicy="no-referrer" />
21
+ <script src="https://cdn.tailwindcss.com"></script>
22
+
23
+ </head>
24
+ <!-- this code is written by @biisal tg:biisal-files -->
25
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
26
+
27
+ <body>
28
+ <nav>
29
+ <div class="nleft">
30
+ <a href="https://t.me/TheMovieProviderBot">
31
+ <!-- if u are trying to change the header name please remove the title text from bottom line -->
32
+ <h4 id="heading" style="z-index: 100;" class="magnet">MOVIE PROVIDER</h4>
33
+ </a>
34
+ </div>
35
+ <div class="nryt">
36
+ <a class="home-btn magnet" href="#main" onclick="toggleWidthnav(this)">HOME</a>
37
+
38
+ <a href="#sec1" class="about-btn magnet" onclick="toggleWidthnav(this)">ABOUT</a>
39
+ </div>
40
+ </nav>
41
+ <center>
42
+ <div class="about-nav">
43
+ <a href="#sec1" class="wlcm magnet" onclick="toggleWidth(this)">WELCOME</a>
44
+ <a href="#sec2" class="abt-chnl magnet" onclick="toggleWidth(this)">CHANNELS</a>
45
+ <a href="#sec3" class="magnet bot-btn" onclick="toggleWidth(this) , bot_btn_clicked()">BOTS</a>
46
+ <a href="#sec4" class="magnet contact-btn" onclick="toggleWidth(this)">LET'S TALK</a>
47
+ </div>
48
+ </center>
49
+ <!-- this code is written by @biisal tg:biisal-files -->
50
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
51
+
52
+ <div class="outer">
53
+ <div class="inner">
54
+ <div class="main" id="main">
55
+ <video id="player" class="player" src="{{file_url}}" type="video/mp4" playsinline controls
56
+ width="100%"></video>
57
+ <div class="player"></div>
58
+ <div class="file-name">
59
+ <h4>File name : </h4>
60
+ <br>
61
+ <p id="myDiv">{{file_name}}</p>
62
+ </div>
63
+ <div class="downloadBtn">
64
+ <button class="magnet" onclick="vlc_player()"><img src="https://i.postimg.cc/15TQ4y7B/vlc.png"
65
+ alt="">watch in VLC PLAYER</button>
66
+ <button class="magnet" onclick="mx_player()"><img src="https://i.postimg.cc/sx4Msv4T/mx.png"
67
+ alt="">watch in MX PLAYER</button>
68
+ <button class="magnet" onclick="playit_player()"><img src="https://i.postimg.cc/RVGWYJFF/playit.png"
69
+ alt="">watch in PLAYit
70
+ PLAYER</button>
71
+ <button class="magnet" onclick="km_player()"><img src="https://i.postimg.cc/wT9tFQ9Z/km.png"
72
+ alt="">watch in KM PLAYER</button>
73
+ <button class="magnet" onclick="s_player()"><img src="https://i.postimg.cc/XYJr6NGg/s.png"
74
+ alt="">watch in S PLAYER</button>
75
+ <button class="magnet" onclick="hd_player()"><img src="https://i.postimg.cc/rFT43LNh/hd.png"
76
+ alt="">watch in HD
77
+ PLAYER(4K)</button>
78
+ <button class="magnet" onclick="bisalDownload()"><img style="height: 35px;"
79
+ src="https://i.postimg.cc/Zncc9YLq/Pngtree-download-icon-3581467.png" alt="">download video
80
+ </button>
81
+ </div>
82
+
83
+ </div>
84
+ <div class="abt">
85
+ <div class="about">
86
+ <div class="about-dets">
87
+ <div class="abt-sec" id="sec1" style="padding: 160px 30px;">
88
+ <h1 style="text-align: center;">WELCOME TO OUR <Span>STREAMING WEBSITE</Span></h1>
89
+ <p style="text-align: center; line-height: 2;word-spacing: 2px; letter-spacing: 0.8px;">
90
+ We're
91
+ thrilled to have <span>you</span> here.
92
+ Get ready for an
93
+ amazing <span>experience</span>
94
+ filled with <span>entertainment</span>, <span>fun</span>, and <span>surprises</span>.
95
+ Grab
96
+ your snacks, sit back, and <span>enjoy</span> the show !
97
+ </p>
98
+ </div>
99
+ <div class="abt-sec" id="sec2">
100
+ <h1>OUR ALL <span>CHANNELS</span> LIST</h1>
101
+ <div class="links chnl-link">
102
+ <a class="magnet" href="https://t.me/HP_MOVIES_WORLD"><button>HP MOVIES
103
+ WORLD</button></a>
104
+ <a class="magnet" href="https://t.me/MoviesLinkSearchBot2"><button>MOVIE SEARCH
105
+ BOT²</button></a>
106
+ <a class="magnet" href="https://t.me/MoviesLinkSearchBot3"><button>MOVIE SEARCH
107
+ BOT³</button></a>
108
+ <a class="magnet" href="https://t.me/HpMovieReqest"><button>MOVIE REQUEST
109
+ GROUP</button></a>
110
+ <a class="magnet" href="https://t.me/+_mQHFKrbsiQyOTQ1"><button>HP REQUEST
111
+ LOGS</button></a>
112
+ </div>
113
+ </div>
114
+ <div class="abt-sec" id="sec3">
115
+ <h1>OUR ALL <span>BOTS</span> LIST</h1>
116
+ <div class="links bot-link">
117
+ <a class="magnet" href="https://t.me/TheMovieProviderBot"><button>THE MOVIE
118
+ PROVIDER</button></a>
119
+ </div>
120
+ </div>
121
+ <div class="abt-sec" id="sec4">
122
+ <!-- this code is written by @biisal tg:biisal-files -->
123
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
124
+
125
+ <p style="text-align: center;">YOU CAN <Span>TALK</Span> WITH US FOR YOUR <Span>SUPPORT</Span> AND YOU CAN <Span>REPORT</Span> THROUGH
126
+ TELEGRAM</p>
127
+ <div class="links contact">
128
+ <a href="https://t.me/HpRequestBot"><button>CONTACT US</button></a>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <footer>
136
+ <div class="mid">
137
+ <h1 class="mid-text">VISIT <a href="#sec3" onclick="bot_btn_clicked()"><span>OUR BOT</span></a>
138
+ FOR
139
+ MORE
140
+ INFO</h1>
141
+ </div>
142
+
143
+ <div class="last-text">
144
+ <p class="text-center pb-20 pr-6 pl-6 absolute" style="font-weight: 500;">
145
+ Welcome to our online streaming platform! Our website allows users to generate streamable links for
146
+ various files using Telegram bot. Please note that we are not responsible for the content shared or
147
+ streamed through our service. Users are encouraged to respect copyright laws and adhere to our
148
+ community
149
+ guidelines. Enjoy easy, hassle-free file streaming service.
150
+ </p>
151
+ </div>
152
+
153
+ <!-- this code is written by @biisal tg:biisal-files -->
154
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
155
+
156
+
157
+
158
+ <div class="copyright ">
159
+ <h5 class="text-center">Copyright © 2023 <a href="https://t.me/DeletedFromEarth"><span
160
+ style="font-weight: 700;">HP</span></a>. All
161
+ Rights Reserved.</h5>
162
+ <div class="icons">
163
+ <a href="https://github.com/HarshalPurohitEdits"><i class="fa-brands fa-github fa-lg"></i></a>
164
+ <a href="https://t.me/bisal_Files"><i class="fa-brands fa-telegram fa-lg"></i></a>
165
+ </div>
166
+ <h4 style="font-weight: 700;">This Page Is Designed By <a
167
+ href="https://t.me/DeletedFromEarth"><span>HP</span></a></h4>
168
+ </div>
169
+ </footer>
170
+ </body>
171
+
172
+
173
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
174
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
175
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.155.0/three.min.js"></script>
176
+ <script src="https://cdn.jsdelivr.net/gh/automat/controlkit.js@master/bin/controlKit.min.js"></script>
177
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sheryjs/dist/Shery.js"></script>
178
+ <script>
179
+ document.addEventListener("DOMContentLoaded", function () {
180
+ const uncopyableElement = document.querySelector(".uncopyable");
181
+
182
+ uncopyableElement.addEventListener("selectstart", function (event) {
183
+ event.preventDefault();
184
+ });
185
+ });
186
+ </script>
187
+ <script src="js/wow.min.js"></script>
188
+ <script>
189
+ new WOW().init();
190
+ </script>
191
+ <script src="https://cdn.plyr.io/3.6.9/plyr.js"></script>
192
+ <script src="https://aeditx03.github.io/resources/StreamJs.js"></script>
193
+
194
+ </html>
195
+
196
+ <!-- this code is written by @biisal tg:biisal-files -->
197
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
template/req.html ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- this code is written by @biisal tg:biisal-files -->
2
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
3
+
4
+
5
+ <!DOCTYPE html>
6
+ <html lang="en">
7
+
8
+ <head>
9
+ <meta charset="UTF-8">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
+ <title>{{file_name}}</title>
12
+ <link rel="stylesheet" href="https://unpkg.com/sheryjs/dist/Shery.css" />
13
+ <link rel="stylesheet" href="https://aeditx03.github.io/resources/StreamCSS.css">
14
+ <link rel="stylesheet" href="https://aeditx03.github.io/resources/playerCss.css">
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500;700&display=swap" rel="stylesheet">
18
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
19
+ integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
20
+ crossorigin="anonymous" referrerpolicy="no-referrer" />
21
+ <script src="https://cdn.tailwindcss.com"></script>
22
+
23
+ </head>
24
+ <!-- this code is written by @biisal tg:biisal-files -->
25
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
26
+
27
+ <body>
28
+ <nav>
29
+ <div class="nleft">
30
+ <a href="https://t.me/TheMovieProviderBot">
31
+ <!-- if u are trying to change the header name please remove the title text from bottom line -->
32
+ <h4 id="heading" style="z-index: 100;" class="magnet">MOVIE PROVIDER</h4>
33
+ </a>
34
+ </div>
35
+ <div class="nryt">
36
+ <a class="home-btn magnet" href="#main" onclick="toggleWidthnav(this)">HOME</a>
37
+
38
+ <a href="#sec1" class="about-btn magnet" onclick="toggleWidthnav(this)">ABOUT</a>
39
+ </div>
40
+ </nav>
41
+ <center>
42
+ <div class="about-nav">
43
+ <a href="#sec1" class="wlcm magnet" onclick="toggleWidth(this)">WELCOME</a>
44
+ <a href="#sec2" class="abt-chnl magnet" onclick="toggleWidth(this)">CHANNELS</a>
45
+ <a href="#sec3" class="magnet bot-btn" onclick="toggleWidth(this) , bot_btn_clicked()">BOTS</a>
46
+ <a href="#sec4" class="magnet contact-btn" onclick="toggleWidth(this)">LET'S TALK</a>
47
+ </div>
48
+ </center>
49
+ <!-- this code is written by @biisal tg:biisal-files -->
50
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
51
+
52
+ <div class="outer">
53
+ <div class="inner">
54
+ <div class="main" id="main">
55
+ <video id="player" class="player" src="{{file_url}}" type="video/mp4" playsinline controls
56
+ width="100%"></video>
57
+ <div class="player"></div>
58
+ <div class="file-name">
59
+ <h4>File name : </h4>
60
+ <br>
61
+ <p id="myDiv">{{file_name}}</p>
62
+ </div>
63
+ <div class="downloadBtn">
64
+ <button class="magnet" onclick="vlc_player()"><img src="https://i.postimg.cc/15TQ4y7B/vlc.png"
65
+ alt="">watch in VLC PLAYER</button>
66
+ <button class="magnet" onclick="mx_player()"><img src="https://i.postimg.cc/sx4Msv4T/mx.png"
67
+ alt="">watch in MX PLAYER</button>
68
+ <button class="magnet" onclick="playit_player()"><img src="https://i.postimg.cc/RVGWYJFF/playit.png"
69
+ alt="">watch in PLAYit
70
+ PLAYER</button>
71
+ <button class="magnet" onclick="km_player()"><img src="https://i.postimg.cc/wT9tFQ9Z/km.png"
72
+ alt="">watch in KM PLAYER</button>
73
+ <button class="magnet" onclick="s_player()"><img src="https://i.postimg.cc/XYJr6NGg/s.png"
74
+ alt="">watch in S PLAYER</button>
75
+ <button class="magnet" onclick="hd_player()"><img src="https://i.postimg.cc/rFT43LNh/hd.png"
76
+ alt="">watch in HD
77
+ PLAYER(4K)</button>
78
+ <button class="magnet" onclick="bisalDownload()"><img style="height: 35px;"
79
+ src="https://i.postimg.cc/Zncc9YLq/Pngtree-download-icon-3581467.png" alt="">download video
80
+ </button>
81
+ </div>
82
+
83
+ </div>
84
+ <div class="abt">
85
+ <div class="about">
86
+ <div class="about-dets">
87
+ <div class="abt-sec" id="sec1" style="padding: 160px 30px;">
88
+ <h1 style="text-align: center;">WELCOME TO OUR <Span>STREAMING WEBSITE</Span></h1>
89
+ <p style="text-align: center; line-height: 2;word-spacing: 2px; letter-spacing: 0.8px;">
90
+ We're
91
+ thrilled to have <span>you</span> here.
92
+ Get ready for an
93
+ amazing <span>experience</span>
94
+ filled with <span>entertainment</span>, <span>fun</span>, and <span>surprises</span>.
95
+ Grab
96
+ your snacks, sit back, and <span>enjoy</span> the show !
97
+ </p>
98
+ </div>
99
+ <div class="abt-sec" id="sec2">
100
+ <h1>OUR ALL <span>CHANNELS</span> LIST</h1>
101
+ <div class="links chnl-link">
102
+ <a class="magnet" href="https://t.me/HP_MOVIES_WORLD"><button>HP MOVIES
103
+ WORLD</button></a>
104
+ <a class="magnet" href="https://t.me/MoviesLinkSearchBot2"><button>MOVIE SEARCH
105
+ BOT²</button></a>
106
+ <a class="magnet" href="https://t.me/MoviesLinkSearchBot3"><button>MOVIE SEARCH
107
+ BOT³</button></a>
108
+ <a class="magnet" href="https://t.me/HpMovieReqest"><button>MOVIE REQUEST
109
+ GROUP</button></a>
110
+ <a class="magnet" href="https://t.me/+_mQHFKrbsiQyOTQ1"><button>HP REQUEST
111
+ LOGS</button></a>
112
+ </div>
113
+ </div>
114
+ <div class="abt-sec" id="sec3">
115
+ <h1>OUR ALL <span>BOTS</span> LIST</h1>
116
+ <div class="links bot-link">
117
+ <a class="magnet" href="https://t.me/TheMovieProviderBot"><button>THE MOVIE
118
+ PROVIDER</button></a>
119
+ </div>
120
+ </div>
121
+ <div class="abt-sec" id="sec4">
122
+ <!-- this code is written by @biisal tg:biisal-files -->
123
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
124
+
125
+ <p style="text-align: center;">YOU CAN <Span>TALK</Span> WITH US FOR YOUR <Span>SUPPORT</Span> AND YOU CAN <Span>REPORT</Span> THROUGH
126
+ TELEGRAM</p>
127
+ <div class="links contact">
128
+ <a href="https://t.me/HpRequestBot"><button>CONTACT US</button></a>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <footer>
136
+ <div class="mid">
137
+ <h1 class="mid-text">VISIT <a href="#sec3" onclick="bot_btn_clicked()"><span>OUR BOT</span></a>
138
+ FOR
139
+ MORE
140
+ INFO</h1>
141
+ </div>
142
+
143
+ <div class="last-text">
144
+ <p class="text-center pb-20 pr-6 pl-6 absolute" style="font-weight: 500;">
145
+ Welcome to our online streaming platform! Our website allows users to generate streamable links for
146
+ various files using Telegram bot. Please note that we are not responsible for the content shared or
147
+ streamed through our service. Users are encouraged to respect copyright laws and adhere to our
148
+ community
149
+ guidelines. Enjoy easy, hassle-free file streaming service.
150
+ </p>
151
+ </div>
152
+
153
+ <!-- this code is written by @biisal tg:biisal-files -->
154
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
155
+
156
+
157
+
158
+ <div class="copyright ">
159
+ <h5 class="text-center">Copyright © 2023 <a href="https://t.me/DeletedFromEarth"><span
160
+ style="font-weight: 700;">HP</span></a>. All
161
+ Rights Reserved.</h5>
162
+ <div class="icons">
163
+ <a href="https://github.com/HarshalPurohitEdits"><i class="fa-brands fa-github fa-lg"></i></a>
164
+ <a href="https://t.me/bisal_Files"><i class="fa-brands fa-telegram fa-lg"></i></a>
165
+ </div>
166
+ <h4 style="font-weight: 700;">This Page Is Designed By <a
167
+ href="https://t.me/DeletedFromEarth"><span>HP</span></a></h4>
168
+ </div>
169
+ </footer>
170
+ </body>
171
+
172
+
173
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
174
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
175
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.155.0/three.min.js"></script>
176
+ <script src="https://cdn.jsdelivr.net/gh/automat/controlkit.js@master/bin/controlKit.min.js"></script>
177
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sheryjs/dist/Shery.js"></script>
178
+ <script>
179
+ document.addEventListener("DOMContentLoaded", function () {
180
+ const uncopyableElement = document.querySelector(".uncopyable");
181
+
182
+ uncopyableElement.addEventListener("selectstart", function (event) {
183
+ event.preventDefault();
184
+ });
185
+ });
186
+ </script>
187
+ <script src="js/wow.min.js"></script>
188
+ <script>
189
+ new WOW().init();
190
+ </script>
191
+ <script src="https://cdn.plyr.io/3.6.9/plyr.js"></script>
192
+ <script src="https://aeditx03.github.io/resources/StreamJs.js"></script>
193
+
194
+ </html>
195
+
196
+ <!-- this code is written by @biisal tg:biisal-files -->
197
+ <!-- stealing credit doesn't make you developer..so try to give full credit to the developer 😊 u will not loose anything for giving proper credit.instead -->
util/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ # Made with love by HP