Skip to content

Commit

Permalink
Update 6 files
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiiRepair committed Oct 13, 2023
1 parent 56b0eba commit 8ea20f8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
4 changes: 1 addition & 3 deletions bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@

# ------------------------------------------------------------------------------

tgcalls = GroupCallFactory(
userbot, GroupCallFactory.MTPROTO_CLIENT_TYPE.PYROGRAM
).get_group_call()
tgcalls = GroupCallFactory(userbot, GroupCallFactory.MTPROTO_CLIENT_TYPE.PYROGRAM)

# ------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions bot/commands/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ async def _(client: Client, message: Message):
try:
if VOICE_CHATS.get(message.chat.id) is not None:
raise Exception("Streaming is active")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await message.reply(
"**__Master, what do you need? \U0001f917 \n\nVoice Chat started successfully__** \u2728",
)
Expand Down
4 changes: 2 additions & 2 deletions bot/commands/play_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ async def _(client: Client, message: Message):
await sleep(2)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_audio(audiobook, repeat=False)
if "epub" in mime_type:
Expand Down
14 changes: 7 additions & 7 deletions bot/commands/play_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ async def _(client: Client, message: Message):
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_audio(url, repeat=False)
await _message.edit(
Expand Down Expand Up @@ -160,8 +160,8 @@ async def _(client: Client, message: Message):
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_audio(media, repeat=False)
await _message.delete()
Expand All @@ -186,10 +186,10 @@ async def _(client: Client, message: Message):
),
)
return await _message.pin()
except Exception as e:
logging.error(e)
except Exception as err:
logging.error(err)
await _message.edit(
f"**__Oops master, something wrong has happened.__** \n\n`Error: {e}`",
f"**__Oops master, something wrong has happened.__** \n\n`Error: {err}`",
)
if message.chat.id in VOICE_CHATS:
await VOICE_CHATS[message.chat.id].stop()
Expand Down
13 changes: 8 additions & 5 deletions bot/commands/play_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ async def _(client: Client, message: Message):
file=query,
type_of="video_stream",
)
await _message.edit("🔄 **__Starting live video stream...__**")
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_video(
query,
Expand Down Expand Up @@ -132,8 +135,8 @@ async def _(client: Client, message: Message):
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_video(
url,
Expand Down Expand Up @@ -209,8 +212,8 @@ async def _(client: Client, message: Message):
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_video(
media,
Expand Down
4 changes: 2 additions & 2 deletions bot/commands/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ async def _(client: Client, message: Message):
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
VOICE_CHATS[message.chat.id] = tgcalls.get_group_call()
await VOICE_CHATS[message.chat.id].start(message.chat.id)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_video(
video,
Expand Down

0 comments on commit 8ea20f8

Please sign in to comment.