Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
837f55b
Create README.md
MrProgrammer72 Apr 27, 2023
0a8f828
Delete README.md
MrProgrammer72 Apr 27, 2023
165f93b
Create README.md
MrProgrammer72 Apr 27, 2023
d7df95d
Create CODEOWNERS
MrProgrammer72 Apr 27, 2023
957f792
Create README.md
MrProgrammer72 Apr 27, 2023
e1cd740
Create dependabot.yml
MrProgrammer72 Apr 27, 2023
5b3a379
Delete README.md
MrProgrammer72 Apr 27, 2023
32a5690
Create JAY DEVELOPER
MrProgrammer72 Apr 27, 2023
6ff8a05
Add files via upload
MrProgrammer72 Apr 27, 2023
e669f3e
Add files via upload
MrProgrammer72 Apr 27, 2023
7946936
Create JAY DEVELOPER
MrProgrammer72 Apr 27, 2023
b5690d5
Add files via upload
MrProgrammer72 Apr 27, 2023
ba8aa4e
Add files via upload
MrProgrammer72 Apr 27, 2023
65af3a9
Add files via upload
MrProgrammer72 Apr 27, 2023
91718e3
Create .gitignore
MrProgrammer72 Apr 27, 2023
382573b
Create .dockerignore
MrProgrammer72 Apr 27, 2023
0403e13
Create GJ516Music
MrProgrammer72 Apr 27, 2023
d97d358
Delete GJ516Music
MrProgrammer72 Apr 27, 2023
120854e
Delete GJ516music directory
MrProgrammer72 Apr 27, 2023
ea681d3
Create JAY DEVELOPER
MrProgrammer72 Apr 27, 2023
24149c3
Add files via upload
MrProgrammer72 Apr 27, 2023
2b8987c
Add files via upload
MrProgrammer72 Apr 27, 2023
b05cba9
Create JAY DEVELOPER
MrProgrammer72 Apr 27, 2023
7093c18
Add files via upload
MrProgrammer72 Apr 27, 2023
81983a5
Add files via upload
MrProgrammer72 Apr 27, 2023
3d06fb4
Update sample.env
MrProgrammer72 Apr 27, 2023
ec101d5
Update GJ516
MrProgrammer72 Apr 27, 2023
0e32c59
Update LICENSE
MrProgrammer72 Apr 27, 2023
044b4af
Update Procfile
MrProgrammer72 Apr 27, 2023
844461d
Update app.json
MrProgrammer72 Apr 27, 2023
a653486
Update heroku.yml
MrProgrammer72 Apr 27, 2023
e7abf47
Update config.py
MrProgrammer72 Apr 27, 2023
7c02707
Update config.py
MrProgrammer72 Apr 27, 2023
7e9b162
Update config.py
MrProgrammer72 Apr 27, 2023
dbb1b6e
Update Dockerfile
MrProgrammer72 Apr 27, 2023
42062fd
Update README.md
MrProgrammer72 Apr 27, 2023
857d58d
Update config.py
MrProgrammer72 Apr 27, 2023
0a68a85
Update __main__.py
MrProgrammer72 Apr 27, 2023
fc3c3c5
Update __main__.py
MrProgrammer72 Apr 27, 2023
89be441
Update __init__.py
MrProgrammer72 Apr 27, 2023
242da67
Update __init__.py
MrProgrammer72 Apr 27, 2023
82476f9
Update __init__.py
MrProgrammer72 Apr 27, 2023
9237199
Update active.py
MrProgrammer72 Apr 27, 2023
8dc0ae8
Update admins.py
MrProgrammer72 Apr 27, 2023
5dbacc0
Update admins.py
MrProgrammer72 Apr 27, 2023
435813d
Update admins.py
MrProgrammer72 Apr 27, 2023
9dfa2c4
Update clear.py
MrProgrammer72 Apr 27, 2023
f9eff08
Update dossier.py
MrProgrammer72 Apr 27, 2023
3ba50e1
Update downloaders.py
MrProgrammer72 Apr 27, 2023
1d9cf05
Update errors.py
MrProgrammer72 Apr 27, 2023
819d006
Update formatters.py
MrProgrammer72 Apr 27, 2023
0ab8a37
Update gets.py
MrProgrammer72 Apr 27, 2023
a0efd1d
Update inline.py
MrProgrammer72 Apr 27, 2023
589c457
Update inline.py
MrProgrammer72 Apr 27, 2023
cca3a02
Update inline.py
MrProgrammer72 Apr 27, 2023
4594214
Update thumbnails.py
MrProgrammer72 Apr 27, 2023
115a40b
Update queue.py
MrProgrammer72 Apr 27, 2023
29ec2a8
Update inline.py
MrProgrammer72 Apr 27, 2023
97ceb5a
Update inline.py
MrProgrammer72 Apr 27, 2023
b95edfd
Update inline.py
MrProgrammer72 Apr 27, 2023
b2b29bd
Update play.py
MrProgrammer72 Apr 27, 2023
a920c31
Update play.py
MrProgrammer72 Apr 27, 2023
470ab7a
Update __init__.py
MrProgrammer72 Apr 27, 2023
4cd0822
Update activevc.py
MrProgrammer72 Apr 27, 2023
29e4d53
Update activevc.py
MrProgrammer72 Apr 27, 2023
e525303
Update activevc.py
MrProgrammer72 Apr 27, 2023
ba0b7a9
Update assistant.py
MrProgrammer72 Apr 27, 2023
143ac44
Update inline.py
MrProgrammer72 Apr 27, 2023
85a3931
Update ping.py
MrProgrammer72 Apr 27, 2023
a44856d
Update ping.py
MrProgrammer72 Apr 27, 2023
7b6146c
Update sudoers.py
MrProgrammer72 Apr 27, 2023
4365520
Update stop.py
MrProgrammer72 Apr 27, 2023
bf8f54b
Update dossier.py
MrProgrammer72 Apr 28, 2023
e48132a
Update dossier.py
MrProgrammer72 Apr 28, 2023
cb1e9ec
Update dossier.py
MrProgrammer72 Apr 28, 2023
4035b0d
Update dossier.py
MrProgrammer72 Apr 28, 2023
37f06ab
Update __init__.py
MrProgrammer72 Apr 28, 2023
5d9fb8c
Update __init__.py
MrProgrammer72 Apr 28, 2023
641990a
Update __init__.py
MrProgrammer72 Apr 28, 2023
3756e95
Update assistant.py
MrProgrammer72 Apr 28, 2023
d0e4083
Update broadcast.py
MrProgrammer72 Apr 28, 2023
ead5dc5
Update broadcast.py
MrProgrammer72 Apr 28, 2023
aa70af9
Update callback.py
MrProgrammer72 Apr 28, 2023
04dfb29
Update callback.py
MrProgrammer72 Apr 28, 2023
3522856
Update callback.py
MrProgrammer72 Apr 28, 2023
46b7cd9
Update cleaner.py
MrProgrammer72 Apr 28, 2023
06d4794
Update eval.py
MrProgrammer72 Apr 28, 2023
8c2f01a
Update inline.py
MrProgrammer72 Apr 28, 2023
ad5c527
Update leaveall.py
MrProgrammer72 Apr 28, 2023
22afea8
Update leaveall.py
MrProgrammer72 Apr 28, 2023
851078b
Update pause.py
MrProgrammer72 Apr 30, 2023
cd76835
Update ping.py
MrProgrammer72 Apr 30, 2023
8bc6636
Update play.py
MrProgrammer72 Apr 30, 2023
031d1af
Update play.py
MrProgrammer72 Apr 30, 2023
74310dc
Update play.py
MrProgrammer72 Apr 30, 2023
a086c33
Update resume.py
MrProgrammer72 Apr 30, 2023
496b99b
Update search.py
MrProgrammer72 Apr 30, 2023
2d7fc75
Update search.py
MrProgrammer72 Apr 30, 2023
74ee0fc
Update skip.py
MrProgrammer72 Apr 30, 2023
d98c6df
Update song.py
MrProgrammer72 May 1, 2023
db66900
Update ping.py
MrProgrammer72 May 1, 2023
363c1ff
Update speedtest.py
MrProgrammer72 May 1, 2023
4c4bd52
Update start.py
MrProgrammer72 May 1, 2023
6ffa9db
Update stop.py
MrProgrammer72 May 1, 2023
82cd614
Update stop.py
MrProgrammer72 May 1, 2023
d283c40
Update sudoers.py
MrProgrammer72 May 2, 2023
2fc7a8a
Update sysstats.py
MrProgrammer72 May 2, 2023
414c8d7
Update sysstats.py
MrProgrammer72 May 2, 2023
7fa3ab5
Update variables.py
MrProgrammer72 May 2, 2023
8b5b1f3
Update variables.py
MrProgrammer72 May 2, 2023
273c780
Update watcher.py
MrProgrammer72 May 2, 2023
63b71f7
Update watcher.py
MrProgrammer72 May 2, 2023
47c86e9
Update inline.py
MrProgrammer72 May 2, 2023
caa8ec0
Update inline.py
MrProgrammer72 May 2, 2023
08f397b
Update inline.py
MrProgrammer72 May 2, 2023
a50f548
Update assistant.py
MrProgrammer72 May 7, 2023
18c29c4
Update assistant.py
MrProgrammer72 May 7, 2023
2392a24
Update __main__.py
MrProgrammer72 May 9, 2023
cdfa22f
Update assistant.py
MrProgrammer72 May 9, 2023
c6b6979
Update broadcast.py
MrProgrammer72 May 9, 2023
bbaa435
Update __init__.py
MrProgrammer72 May 9, 2023
7176626
Update dossier.py
MrProgrammer72 May 9, 2023
a9fa8d1
Update config.py
MrProgrammer72 May 9, 2023
77c7160
Update config.py
MrProgrammer72 May 9, 2023
a168ed9
Update inline.py
MrProgrammer72 May 9, 2023
37a70f8
Update play.py
MrProgrammer72 May 9, 2023
01c9e72
Update play.py
MrProgrammer72 May 10, 2023
79e24d9
Update play.py
MrProgrammer72 May 10, 2023
40528b0
Update inline.py
MrProgrammer72 May 10, 2023
4eb6006
Update inline.py
MrProgrammer72 May 10, 2023
90d5bf1
Update README.md
MrProgrammer72 May 13, 2023
d4250be
Update README.md
MrProgrammer72 May 13, 2023
bab3685
Update README.md
MrProgrammer72 May 13, 2023
0069db5
Update README.md
MrProgrammer72 May 13, 2023
66fc1be
Update README.md
MrProgrammer72 May 13, 2023
b508223
Update README.md
MrProgrammer72 May 13, 2023
58024df
Update README.md
MrProgrammer72 May 13, 2023
eb39989
Update config.py
MrProgrammer72 May 17, 2023
34745a3
Update inline.py
MrProgrammer72 May 26, 2023
1551e7e
Update inline.py
MrProgrammer72 Jun 1, 2023
ec68d84
Update inline.py
MrProgrammer72 Jun 1, 2023
8069ea9
Update inline.py
MrProgrammer72 Jun 1, 2023
ff5fa06
Update inline.py
MrProgrammer72 Jun 1, 2023
82a41e6
Update play.py
MrProgrammer72 Jun 1, 2023
c8eb676
Update inline.py
MrProgrammer72 Jun 1, 2023
cd40c9c
Update config.py
MrProgrammer72 Jun 1, 2023
10f1d3a
Update ping.py
MrProgrammer72 Jun 3, 2023
bbaea37
Update dossier.py
MrProgrammer72 Jun 3, 2023
0130183
Update play.py
MrProgrammer72 Jun 5, 2023
36e64c0
Update play.py
MrProgrammer72 Jun 5, 2023
28f120a
Update config.py
MrProgrammer72 Jun 5, 2023
0358619
Update inline.py
MrProgrammer72 Jun 5, 2023
a4e7eb3
Update play.py
MrProgrammer72 Jun 5, 2023
4e3f12c
Update play.py
MrProgrammer72 Jun 5, 2023
6dd2a88
Update inline.py
MrProgrammer72 Jun 5, 2023
aec5d4e
Update inline.py
MrProgrammer72 Jun 5, 2023
75dd0d3
Update config.py
MrProgrammer72 Jun 5, 2023
c71212e
Update play.py
MrProgrammer72 Jun 5, 2023
71a155f
Update inline.py
MrProgrammer72 Jun 5, 2023
157adfd
Update inline.py
MrProgrammer72 Jun 6, 2023
68f33f9
Update inline.py
MrProgrammer72 Jun 6, 2023
b991cbe
Update inline.py
MrProgrammer72 Jun 6, 2023
95611cb
Update inline.py
MrProgrammer72 Jun 6, 2023
e32fe28
Update inline.py
MrProgrammer72 Jun 6, 2023
06e528e
Update config.py
MrProgrammer72 Jun 6, 2023
1dadf7b
Update config.py
MrProgrammer72 Jun 6, 2023
95a5a4f
Update inline.py
MrProgrammer72 Jun 6, 2023
d4a5c02
Update inline.py
MrProgrammer72 Jun 6, 2023
bde2ae4
Update inline.py
MrProgrammer72 Jun 9, 2023
82d23bd
Update play.py
MrProgrammer72 Jul 2, 2023
d4385a9
Update dossier.py
MrProgrammer72 Jul 2, 2023
5988f4d
Delete inline.py
MrProgrammer72 Jul 2, 2023
246fb08
Add files via upload
MrProgrammer72 Jul 2, 2023
0847d53
Delete play.py
MrProgrammer72 Jul 2, 2023
2daf99e
Add files via upload
MrProgrammer72 Jul 2, 2023
726907c
Update play.py
MrProgrammer72 Jul 2, 2023
6fb1ced
Update play.py
MrProgrammer72 Jul 2, 2023
61abbe4
Update inline.py
MrProgrammer72 Jul 2, 2023
6d2824c
Update inline.py
MrProgrammer72 Jul 2, 2023
59b0b95
Update inline.py
MrProgrammer72 Jul 2, 2023
e33a5a5
Update play.py
MrProgrammer72 Jul 2, 2023
35ac745
Update inline.py
MrProgrammer72 Jul 2, 2023
1199e0c
Update config.py
MrProgrammer72 Jul 2, 2023
d4ee129
Update config.py
MrProgrammer72 Jul 2, 2023
d38e187
Update app.json
MrProgrammer72 Jul 2, 2023
06a6f88
Update config.py
MrProgrammer72 Jul 2, 2023
b963660
Update README.md
MrProgrammer72 Jul 2, 2023
a02610b
Update inline.py
MrProgrammer72 Jul 2, 2023
3d05926
Update play.py
MrProgrammer72 Jul 2, 2023
e09ae34
Update play.py
MrProgrammer72 Jul 2, 2023
854af4b
Update play.py
MrProgrammer72 Jul 2, 2023
eabfa07
Update inline.py
MrProgrammer72 Jul 2, 2023
68535d6
Update play.py
MrProgrammer72 Jul 2, 2023
3b5e3b3
Update dossier.py
MrProgrammer72 Jul 2, 2023
6936aa4
Update inline.py
MrProgrammer72 Jul 4, 2023
303d3ed
Update inline.py
MrProgrammer72 Jul 4, 2023
7e8b8c6
Update inline.py
MrProgrammer72 Jul 4, 2023
a3913a9
Update README.md
MrProgrammer72 Jul 14, 2023
6f954b2
Update README.md
MrProgrammer72 Jul 14, 2023
a6f5044
Update README.md
MrProgrammer72 Jul 14, 2023
162b850
Update activevc.py
MrProgrammer72 Oct 28, 2023
022630c
Update ping.py
MrProgrammer72 Nov 16, 2023
080d659
Update config.py
MrProgrammer72 Nov 16, 2023
bfce73e
Update config.py
MrProgrammer72 Nov 16, 2023
35cccc6
Update config.py
MrProgrammer72 Nov 16, 2023
ac9e3dd
Update config.py
MrProgrammer72 Nov 16, 2023
f7fe6c5
Update config.py
MrProgrammer72 Nov 16, 2023
d855817
Update requirements.txt
MrProgrammer72 Dec 7, 2023
d36945a
Update ping.py
MrProgrammer72 Dec 7, 2023
b6205cb
Update config.py
MrProgrammer72 Dec 7, 2023
bb242ca
Update ping.py
MrProgrammer72 Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.env
*.log
.git/
.idea/
str.py
Procfile
README.md
downloads/
raw_files/
.gitignore
runtime.txt
__pycache__/
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@export_gabbar
102 changes: 102 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

<h2 align="center">
──「 𝗚𝗝𝟱𝟭𝟲 𝗩𝗰 𝗣𝗹𝗮𝘆𝗲𝗿 」──
</h2>
<p align="center">
<img src="https://telegra.ph/file/2c7df8cf19467cfeb4356.jpg">
</p> ━━━━━━━━━━━━━━━━━━━━
<p align="center">
<a href="https://github.com/MrProgrammer72/GJ516VCBOT/stargazers"><img src="https://img.shields.io/github/stars/MrProgrammer72/GJ516VCBOT?color=black&logo=github&logoColor=black&style=for-the-badge" alt="Stars" /></a> <a href="https://github.com/MrProgrammer72/GJ516VCBOT/network/members"> <img src="https://img.shields.io/github/forks/MrProgrammer72/GJ516VCBOT?color=black&logo=github&logoColor=black&style=for-the-badge" /></a>
<a href="https://www.python.org/"> <img src="https://img.shields.io/badge/Written%20in-Python-skyblue?style=for-the-badge&logo=python" alt="Python" /> </a>
</p>
━━━━━━━━━━━━━━━━━━━━
<details>
<summary> 𝗥𝗲𝗾𝘂𝗶𝗿𝗲𝗺𝗲𝗻𝘁𝘀 📝</summary>

- FFmpeg
- NodeJS [nodesource.com](https://nodesource.com/)
- Python 3.7 or higher
- [PyTgCalls](https://github.com/pytgcalls/pytgcalls)
</details>
<details>
<summary> 𝗙𝗲𝗮𝘁𝘂𝗿𝗲𝘀 🔮</summary>

- Yt-dL Fix
- Updated Plug-in
- Super Fast Bot
- No Lag Hang
- Fast Download Song From Server
- Program Updated
- Smooth Player
</details>
<details>
<summary> 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 🛠</summary>

- `/play <song name>` - play song you requested
- `/song <song name>` - download songs you want quickly
- `/ping` - Bot Online or Offine

#### Admins Only 👷‍♂️

- `/pause` - pause song play
- `/resume` - resume song play
- `/skip` - play next song
- `/end` - stop music play
</details>

<details>
<summary>𝗦𝗲𝘀𝘀𝗶𝗼𝗻 🥀</summary>

- 🧪 Get `SESSION_NAME` variable:
- [``Pyrogram Session``](https://telegram.me/)
</details>

<details>
<summary>
𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 𝗺𝗲𝘁𝗵𝗼𝗱𝘀 🚀
</summary>


## ᴅᴇᴘʟᴏʏ ᴛᴏ ʜᴇʀᴏᴋᴜ 🚀

<p align="center"><a href="https://heroku.com/deploy?template=https://github.com/MrProgrammer72/GJ516Music"> <img src="https://img.shields.io/badge/Deploy%20To%20Heroku-orange?style=for-the-badge&logo=heroku" width="200" height="35.45"/></a></p>

The easiest way to host this bot, Deploy on Heroku, Change the app country to Europe (it will help to make the bot more stable).

## ᴅᴇᴩʟᴏʏ ᴏɴ ᴏᴋᴛᴇᴛᴏ

<p align="center"><a href="https://cloud.okteto.com/deploy?repository=https://github.com/MrProgrammer72/GJ516Music"><img src="https://img.shields.io/badge/Deploy%20To%20Okteto-informational?style=for-the-badge&logo=Okteto" width="200" height="35.45"/></a></p>

The second easiest way to host this bot, Deploy on Okteto Cloud
## ᴅᴇᴘʟᴏʏ ᴏɴ ᴠᴘꜱ ꜱᴇʀᴠᴇʀ's 📡

<p>

Checkout [Docs](https://github.com/MrProgrammer72/GJ516Music/wiki) for Detailed Explanation on VPS Deploy
</p>

</details>

━━━━━━━━━━━━━━━━━━━━

<h3 align="center">
─「 sᴜᴩᴩᴏʀᴛ 」─
</h3>

<p align="center">
<a href="https://t.me/GJ516_DISCUSS_GROUP"><img src="https://img.shields.io/badge/-Support%20Group-blue.svg?style=for-the-badge&logo=Telegram"></a>
</p>
<p align="center">
<a href="https://telegram.me/myworldGJ516"><img src="https://img.shields.io/badge/-Support%20Channel-blue.svg?style=for-the-badge&logo=Telegram"></a>
</p>
━━━━━━━━━━━━━━━━━━━━
<h3 align="center">
─「 ᴄʀᴇᴅɪᴛs 」─
</h3>

- <b>[ᴅᴇᴠᴇʟᴏᴘᴇʀ](https://github.com/MrProgrammer72) ➻ [sᴏᴍᴇᴛʜɪɴɢ](https://github.com/MrProgrammer72/GJ516VCBOT) </b>
- <p align="center">
<img src="https://te.legra.ph/file/c45bdbdc46b3f95143e89.jpg">
</p>

━━━━━━━━━━━━━━━━━━━━
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: pip
  directory: "/"
  schedule:
    interval: daily
    time: "00:00"
    timezone: "Asia/Kolkata"
  labels:
    - "dependencies"
  open-pull-requests-limit: 50
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.env
*.log
venv/
.idea/
*.session
raw_files/
downloads/
__pycache__/
*.session-journal
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM nikolaik/python-nodejs:python3.9-nodejs18

RUN apt-get update -y && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends ffmpeg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . /app/
WORKDIR /app/

RUN pip3 install --no-cache-dir --upgrade --requirement requirements.txt

CMD bash GJ516
1 change: 1 addition & 0 deletions GJ516
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 -m GJ516Music
32 changes: 32 additions & 0 deletions GJ516Music/Helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License
#
# Copyright (c) 2023 MrProgrammer72
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from .active import *
from .admins import *
from .clear import _clear_
from .dossier import *
from .errors import *
from .formatters import *
from .gets import *
from .inline import *
from .queue import *
from .thumbnails import *
60 changes: 60 additions & 0 deletions GJ516Music/Helpers/active.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# MIT License
#
# Copyright (c) 2023 MrProgrammer72
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

active = []
stream = {}


async def is_active_chat(chat_id: int) -> bool:
if chat_id not in active:
return False
else:
return True


async def add_active_chat(chat_id: int):
if chat_id not in active:
active.append(chat_id)


async def remove_active_chat(chat_id: int):
if chat_id in active:
active.remove(chat_id)


async def get_active_chats() -> list:
return active


async def is_streaming(chat_id: int) -> bool:
run = stream.get(chat_id)
if not run:
return False
return run


async def stream_on(chat_id: int):
stream[chat_id] = True


async def stream_off(chat_id: int):
stream[chat_id] = False
91 changes: 91 additions & 0 deletions GJ516Music/Helpers/admins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# MIT License
#
# Copyright (c) 2023 MrProgrammer72
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Callable

from pyrogram.enums import ChatMemberStatus
from pyrogram.types import CallbackQuery, Message

from GJ516Music import SUDOERS, app

from .active import is_active_chat


def admin_check(func: Callable) -> Callable:
async def non_admin(_, message: Message):
if not await is_active_chat(message.chat.id):
return await message.reply_text("𝘽𝙤𝙩 𝙞𝙨 𝙉𝙤𝙩 𝙎𝙩𝙧𝙚𝙖𝙢𝙞𝙣𝙜 𝙊𝙣 𝙑𝙞𝙙𝙚𝙤𝙘𝙝𝙖𝙩")

if message.from_user.id in SUDOERS:
return await func(_, message)

check = await app.get_chat_member(message.chat.id, message.from_user.id)
if check.status not in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR]:
return await message.reply_text(
"𝙔𝙤𝙪'𝙖𝙧𝙚 𝙉𝙤𝙩 𝘼𝙣 𝙅𝙖𝙮 𝘼𝙙𝙢𝙞𝙣, 𝙋𝙡𝙚𝙖𝙨𝙚 𝙎𝙩𝙖𝙮 𝙄𝙣 𝙔𝙤𝙪𝙧 𝙇𝙞𝙢𝙞𝙩𝙨."
)

admin = (
await app.get_chat_member(message.chat.id, message.from_user.id)
).privileges
if admin.can_manage_video_chats:
return await func(_, message)
else:
return await message.reply_text(
"𝙔𝙤𝙪 𝘿𝙤𝙣'𝙩 𝙃𝙖𝙫𝙚 𝙋𝙚𝙧𝙢𝙞𝙨𝙨𝙞𝙤𝙣 𝙏𝙤 𝙈𝙖𝙣𝙖𝙜𝙚 𝙑𝙞𝙙𝙚𝙤𝘾𝙝𝙖𝙩𝙨, 𝙋𝙡𝙚𝙖𝙨𝙚 𝙎𝙩𝙖𝙮 𝙄𝙣 𝙔𝙤𝙪𝙧 𝙇𝙞𝙢𝙞𝙩𝙨"
)

return non_admin


def admin_check_cb(func: Callable) -> Callable:
async def cb_non_admin(_, query: CallbackQuery):
if not await is_active_chat(query.message.chat.id):
return await query.answer(
"𝘽𝙤𝙩 𝙞𝙨 𝙉𝙤𝙩 𝙎𝙩𝙧𝙚𝙖𝙢𝙞𝙣𝙜 𝙊𝙣 𝙑𝙞𝙙𝙚𝙤𝙘𝙝𝙖𝙩", show_alert=True
)

if query.from_user.id in SUDOERS:
return await func(_, query)

try:
check = await app.get_chat_member(query.message.chat.id, query.from_user.id)
except:
return
if check.status not in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR]:
return await query.answer(
"𝙔𝙤𝙪'𝙖𝙧𝙚 𝙉𝙤𝙩 𝘼𝙣 𝙅𝙖𝙮 𝘼𝙙𝙢𝙞𝙣, 𝙋𝙡𝙚𝙖𝙨𝙚 𝙎𝙩𝙖𝙮 𝙄𝙣 𝙔𝙤𝙪𝙧 𝙇𝙞𝙢𝙞𝙩𝙨.",
show_alert=True,
)

admin = (
await app.get_chat_member(query.message.chat.id, query.from_user.id)
).privileges
if admin.can_manage_video_chats:
return await func(_, query)
else:
return await query.answer(
"𝙔𝙤𝙪 𝘿𝙤𝙣'𝙩 𝙃𝙖𝙫𝙚 𝙋𝙚𝙧𝙢𝙞𝙨𝙨𝙞𝙤𝙣 𝙏𝙤 𝙈𝙖𝙣𝙖𝙜𝙚 𝙑𝙞𝙙𝙚𝙤𝘾𝙝𝙖𝙩𝙨, 𝙋𝙡𝙚𝙖𝙨𝙚 𝙎𝙩𝙖𝙮 𝙄𝙣 𝙔𝙤𝙪𝙧 𝙇𝙞𝙢𝙞𝙩𝙨",
show_alert=True,
)

return cb_non_admin
32 changes: 32 additions & 0 deletions GJ516Music/Helpers/clear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License
#
# Copyright (c) 2023 MrProgrammer72
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from GJ516Music import GJ516db
from GJ516Music.Helpers import remove_active_chat


async def _clear_(chat_id):
try:
GJ516db[chat_id] = []
await remove_active_chat(chat_id)
except:
return
Loading