Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 5b84b27

Browse files
committed
Rejoin vc
1 parent 525f01a commit 5b84b27

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Command | Description
4848
/telegram | Play A Song Directly From Telegram File.
4949
/queue | Check Queue Status.
5050
/joinvc | Join Voice Chat.
51+
/rejoinvc | Rejoin Voice Chat.
5152
/leavevc | Leave Voice Chat.
5253
/volume [1-200] | Adjust Volume.
5354
/pause | Pause Music.

main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ async def joinvc(_, message):
7272
await send(str(e))
7373

7474

75+
@app.on_message(filters.command("rejoinvc") & filters.user(SUDOERS))
76+
async def joinvc(_, message):
77+
try:
78+
if vc.is_connected:
79+
await send("__**Bot Is Already In Voice Chat.**__")
80+
return
81+
chat_id = message.chat.id
82+
await vc.reconnect()
83+
await send("__**Joined The Voice Chat.**__")
84+
except Exception as e:
85+
print(str(e))
86+
await send(str(e))
87+
88+
7589
@app.on_message(filters.command("leavevc") & filters.user(SUDOERS))
7690
async def leavevc(_, message):
7791
if not vc.is_connected:

misc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
**/play** __youtube/saavn/deezer Song_Name__
66
**/telegram** __Play From Telegram Audio.__
77
**/joinvc** __Join Voice Chat.__
8+
**/rejoinvc** __Rejoin Voice Chat.__
89
**/leavevc** __Leave Voice Chat.__
910
**/volume [1-200]** __Adjust Volume.__
1011
**/pause** __Pause Music.__

0 commit comments

Comments
 (0)