-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvctools.py
101 lines (85 loc) · 2.67 KB
/
vctools.py
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Ultroid - UserBot
# Copyright (C) 2021-2022 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/>.
"""
✘ Commands Available -
• `{i}mutevc`
Mute playback.
• `{i}unmutevc`
UnMute playback.
• `{i}pausevc`
Pause playback.
• `{i}resumevc`
Resume playback.
• `{i}replay`
Re-play the current song from the beginning.
"""
from . import vc_asst, Player, get_string
@vc_asst("mutevc")
async def mute(event):
if len(event.text.split()) > 1:
chat = event.text.split()[1]
try:
chat = await event.client.parse_id(chat)
except Exception as e:
return await event.eor(f"**ERROR:**\n{str(e)}")
else:
chat = event.chat_id
ultSongs = Player(chat)
await ultSongs.group_call.set_is_mute(True)
await event.eor(get_string("vcbot_12"))
@vc_asst("unmutevc")
async def unmute(event):
if len(event.text.split()) > 1:
chat = event.text.split()[1]
try:
chat = await event.client.parse_id(chat)
except Exception as e:
return await event.eor(f"**ERROR:**\n{str(e)}")
else:
chat = event.chat_id
ultSongs = Player(chat)
await ultSongs.group_call.set_is_mute(False)
await event.eor("`UnMuted playback in this chat.`")
@vc_asst("pausevc")
async def pauser(event):
if len(event.text.split()) > 1:
chat = event.text.split()[1]
try:
chat = await event.client.parse_id(chat)
except Exception as e:
return await event.eor(f"**ERROR:**\n{str(e)}")
else:
chat = event.chat_id
ultSongs = Player(chat)
await ultSongs.group_call.set_pause(True)
await event.eor(get_string("vcbot_14"))
@vc_asst("resumevc")
async def resumer(event):
if len(event.text.split()) > 1:
chat = event.text.split()[1]
try:
chat = await event.client.parse_id(chat)
except Exception as e:
return await event.eor(f"**ERROR:**\n{str(e)}")
else:
chat = event.chat_id
ultSongs = Player(chat)
await ultSongs.group_call.set_pause(False)
await event.eor(get_string("vcbot_13"))
@vc_asst("replay")
async def replayer(event):
if len(event.text.split()) > 1:
chat = event.text.split()[1]
try:
chat = await event.client.parse_id(chat)
except Exception as e:
return await event.eor(f"**ERROR:**\n{str(e)}")
else:
chat = event.chat_id
ultSongs = Player(chat)
ultSongs.group_call.restart_playout()
await event.eor("`Re-playing the current song.`")