video-stream/program/callback.py

113 lines
4.2 KiB
Python
Raw Normal View History

2021-10-11 03:16:54 +00:00
# Copyright (C) 2021 By VeezMusicProject
from pyrogram import Client, filters
2021-10-25 11:42:34 +00:00
from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup
from config import (
ASSISTANT_NAME,
BOT_NAME,
BOT_USERNAME,
GROUP_SUPPORT,
OWNER_NAME,
UPDATES_CHANNEL,
)
2021-10-11 03:16:54 +00:00
@Client.on_callback_query(filters.regex("cbstart"))
async def cbstart(_, query: CallbackQuery):
await query.edit_message_text(
2021-10-25 11:42:34 +00:00
f"""✨ **Welcome [{query.message.chat.first_name}](tg://user?id={query.message.chat.id}) !**\n
💭 **[{BOT_NAME}](https://t.me/{BOT_USERNAME}) allows you to play music on groups through the new Telegram's voice chats!**
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
💡 **Find out all the Bot's commands and how they work by clicking on the » 📚 Commands button!**
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
**To know how to use this bot, please click on the » Basic Guide button!**""",
2021-10-11 03:16:54 +00:00
reply_markup=InlineKeyboardMarkup(
2021-10-25 11:42:34 +00:00
[
[
InlineKeyboardButton(
" Add me to your Group ",
url=f"https://t.me/{BOT_USERNAME}?startgroup=true",
)
],
[InlineKeyboardButton("❓ Basic Guide", callback_data="cbhowtouse")],
[
InlineKeyboardButton("📚 Commands", callback_data="cbcmds"),
InlineKeyboardButton("❤ Donate", url=f"https://t.me/{OWNER_NAME}"),
],
[
InlineKeyboardButton(
"👥 Official Group", url=f"https://t.me/{GROUP_SUPPORT}"
),
InlineKeyboardButton(
"📣 Official Channel", url=f"https://t.me/{UPDATES_CHANNEL}"
),
],
[
InlineKeyboardButton(
"🌐 Source Code", url="https://github.com/levina-lab/video-stream"
)
],
]
2021-10-11 03:16:54 +00:00
),
2021-10-25 11:42:34 +00:00
disable_web_page_preview=True,
2021-10-11 03:16:54 +00:00
)
2021-10-25 11:42:34 +00:00
@Client.on_callback_query(filters.regex("cbhowtouse"))
async def cbguides(_, query: CallbackQuery):
2021-10-11 03:16:54 +00:00
await query.edit_message_text(
2021-10-25 11:42:34 +00:00
f"""❓ **Basic Guide for using this bot:**
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
1.) **first, add me to your group.**
2.) **then promote me as admin and give all permissions except anonymous admin.**
3.) **add @{ASSISTANT_NAME} to your group or type /userbotjoin to invite her.**
4.) **turn on the video chat first before start to play video.**
5.) **all the command list you can see on » 📚 Commands button, find it on start home, tap the » Go Back button below.**
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
💡 **If you have a follow-up questions about this bot, you can tell it on my support chat here: @{GROUP_SUPPORT}**
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
__Powered by {BOT_NAME} A.I__""",
reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton("🔙 Go Back", callback_data="cbstart")]]
),
)
2021-10-11 03:16:54 +00:00
2021-10-25 11:42:34 +00:00
@Client.on_callback_query(filters.regex("cbcmds"))
async def cbhelps(_, query: CallbackQuery):
await query.edit_message_text(
f"""📚 Here is the Commands list:
» /mplay - play music on voice chat
» /vstream - enter the radio link
» /gplay - play from other source
» /vplay - play video on video chat
» /vstream - for m3u8/live link
» /vplaylist - show you the playlist
2021-10-25 11:53:50 +00:00
» /video (query) - download video from youtube
» /song (query) - download song from youtube
» /lyric (query) - scrap the song lyric
2021-10-25 11:56:24 +00:00
» /search (query) - search a youtube video link
2021-10-25 11:47:53 +00:00
» /queue - show you the queue list (admin only)
» /vpause - pause the stream (admin only)
» /vresume - resume the stream (admin only)
» /vskip - switch to next stream (admin only)
» /vstop - stop the streaming (admin only)
» /userbotjoin - invite the userbot to join chat (admin only)
» /userbotleave - order userbot to leave from group (admin only)
» /restart - restart the bot (sudo only)
» /rmw - clean raw files (sudo only)
» /rmd - clean downloaded files (sudo only)
» /leaveall - order userbot leave from all group (sudo only)
2021-10-25 11:42:34 +00:00
__Powered by {BOT_NAME} AI__""",
2021-10-11 03:16:54 +00:00
reply_markup=InlineKeyboardMarkup(
2021-10-25 11:42:34 +00:00
[[InlineKeyboardButton("🔙 Go Back", callback_data="cbstart")]]
),
)
2021-10-11 03:16:54 +00:00
@Client.on_callback_query(filters.regex("cls"))
async def close(_, query: CallbackQuery):
await query.message.delete()