Skip to content

Commit

Permalink
Update callbacks.py and play_song.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiiRepair committed Aug 6, 2023
1 parent 6d430a7 commit 6976452
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tlg_bot/kreacher/plugins/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def _(event):
if VOICE_CHATS[chat.id].is_video_paused:
await VOICE_CHATS[chat.id].set_pause(True)
await kreacher.edit_message(event.sender_id, event.message_id,
f"\U00002378 <i>Started Video Streaming!</i>",
"\U00002378 <i>Started Video Streaming!</i>",
file=thumb,
buttons=[
[Button.inline("\U000023ee ʙᴀᴄᴋ", data="back_callback"),
Expand All @@ -30,7 +30,7 @@ async def _(event):
return await sleep(3)
await VOICE_CHATS[chat.id].set_pause(True)
await kreacher.edit_message(event.sender_id, event.message_id,
f"\U00002378 <i>Started Video Streaming!</i>",
"\U00002378 <i>Started Video Streaming!</i>",
file=thumb,
buttons=[
[Button.inline("\U000023ee ʙᴀᴄᴋ", data="back_callback"),
Expand Down
18 changes: 9 additions & 9 deletions tlg_bot/kreacher/plugins/play_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ async def play_song(event):
videoid = search[4]
thumb = await gen_thumb(videoid)
format = "best[height<=?720][width<=?1280]"
hm, url = await ytdl(format, url)
hm, url = await ytdl(format, ref)
if hm == 0:
await msg.edit(f"`{ytlink}`")
await msg.edit(f"`{url}`")
elif chat.id in QUEUE:
pos = add_to_queue(chat, name, url, ref, "audio")
caption = f"✨ **ᴀᴅᴅᴇᴅ ᴛᴏ ǫᴜᴇᴜᴇ ᴀᴛ** {pos}\n\n❄ **ᴛɪᴛʟᴇ :** [{songname}]({url})\n⏱ **ᴅᴜʀᴀᴛɪᴏɴ :** {duration} ᴍɪɴᴜᴛᴇs\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
caption = f"✨ **ᴀᴅᴅᴇᴅ ᴛᴏ ǫᴜᴇᴜᴇ ᴀᴛ** {pos}\n\n❄ **ᴛɪᴛʟᴇ :** [{name}]({url})\n⏱ **ᴅᴜʀᴀᴛɪᴏɴ :** {duration} ᴍɪɴᴜᴛᴇs\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
await msg.delete()
await event.client.send_file(chat.id, thumb, caption=caption, buttons=[[Button.inline("cʟᴏꜱᴇ", data="cls")]])
else:
try:
await ins.join(chat.id)
await ins.start_audio(ytlink, repeat=False)
await ins.start_audio(url, repeat=False)
VOICE_CHATS[chat.id] = ins
add_to_queue(chat, name, ytlink, url, "Audio", 0)
caption = f"➻ **sᴛᴀʀᴛᴇᴅ sᴛʀᴇᴀᴍɪɴɢ**\n\n🌸 **ᴛɪᴛʟᴇ :** [{songname}]({url})\n⏱ **ᴅᴜʀᴀᴛɪᴏɴ :** {duration} ᴍɪɴᴜᴛᴇs\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
add_to_queue(chat, name, url, ref, "audio")
caption = f"➻ **sᴛᴀʀᴛᴇᴅ sᴛʀᴇᴀᴍɪɴɢ**\n\n🌸 **ᴛɪᴛʟᴇ :** [{name}]({url})\n⏱ **ᴅᴜʀᴀᴛɪᴏɴ :** {duration} ᴍɪɴᴜᴛᴇs\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
await msg.delete()
await event.client.send_file(chat.id, thumb, caption=caption, buttons=[[Button.inline("cʟᴏꜱᴇ", data="cls")]])
except Exception as ep:
Expand All @@ -112,7 +112,7 @@ async def play_song(event):
name = "Voice Note"
if chat.id in QUEUE:
pos = add_to_queue(chat, name, url, ref, "audio")
caption = f"✨ **ᴀᴅᴅᴇᴅ ᴛᴏ ǫᴜᴇᴜᴇ ᴀᴛ** {pos}\n\n❄ **ᴛɪᴛʟᴇ :** [{songname}]({url})\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
caption = f"✨ **ᴀᴅᴅᴇᴅ ᴛᴏ ǫᴜᴇᴜᴇ ᴀᴛ** {pos}\n\n❄ **ᴛɪᴛʟᴇ :** [{name}]({url})\n🥀 **ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ :** {from_user}"
await event.client.send_file(chat.id, ngantri, caption=caption, buttons=[[Button.inline("cʟᴏꜱᴇ", data="cls")]])
await msg.delete()
else:
Expand All @@ -121,8 +121,8 @@ async def play_song(event):
await ins.start_audio(dl, repeat=False)
VOICE_CHATS[chat.id] = ins
add_to_queue(chat, name, url, ref, "audio")
caption = f"<b>Started Streaming</b>\n\n <b>Title: </b> [{songname}]({link})\n <b>Requested by: </b> {from_user}"
await event.client.send_file(chat.id, fotoplay, caption=caption, buttons=buttons=[
caption = f"<b>Started Streaming</b>\n\n <b>Title: </b> [{name}]({link})\n <b>Requested by: </b> {from_user}"
await event.client.send_file(chat.id, fotoplay, caption=caption, buttons=[
[Button.inline("\U000023ee ʙᴀᴄᴋ", data="back_callback"),
Button.inline("\U0001F501 ᴘᴀᴜsᴇ",
data="pause_or_resume_callback"),
Expand Down

0 comments on commit 6976452

Please sign in to comment.