forked from TeamUltroid/Ultroid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstopresume.py
More file actions
56 lines (47 loc) · 1.49 KB
/
Copy pathstopresume.py
File metadata and controls
56 lines (47 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Ultroid - UserBot
# Copyright (C) 2021 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
from . import *
@asst.on_message(
filters.command(["stop", f"stop@{vcusername}"])
& filters.user(VC_AUTHS())
& ~filters.edited
)
async def stopvc(_, message):
ms = message.text.split(" ", maxsplit=1)
try:
chat = (await Client.get_chat(ms[1])).id
except IndexError:
chat = message.chat.id
except Exception as Ex:
return await eor(message, str(Ex))
CallsClient.pause_stream(chat)
await eor(message, "Stopped Voice Call")
@Client.on_message(
filters.command("stop", HNDLR) & filters.user(VC_AUTHS()) & ~filters.edited
)
async def ustop(_, message):
await stopvc(_, message)
@asst.on_message(
filters.command(["resume", f"resume@{vcusername}"])
& filters.user(VC_AUTHS())
& ~filters.edited
)
async def resume_vc(_, message):
ms = message.text.split(" ", maxsplit=1)
try:
chat = (await Client.get_chat(ms[1])).id
except IndexError:
chat = message.chat.id
except Exception as Ex:
return await eor(message, str(Ex))
CallsClient.resume_stream(chat)
await eor(message, "Resumed VC")
@Client.on_message(
filters.command("resume", HNDLR) & filters.user(VC_AUTHS()) & ~filters.edited
)
async def vcresume(_, message):
await resume_vc(_, message)