Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: Aditya <xditya@ultroid.tech> Co-authored-by: Kaif <88398455+kaif-00z@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: 1Danish-00 <danish@ultroid.tech> Co-authored-by: smartman_ru <bblkovo@gmail.com>
102 lines
2.7 KiB
Python
102 lines
2.7 KiB
Python
# 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("**ERROR:**\n{}".format(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("**ERROR:**\n{}".format(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("**ERROR:**\n{}".format(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("**ERROR:**\n{}".format(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("**ERROR:**\n{}".format(str(e)))
|
|
else:
|
|
chat = event.chat_id
|
|
ultSongs = Player(chat)
|
|
ultSongs.group_call.restart_playout()
|
|
await event.eor("`Re-playing the current song.`")
|