# Copyright (C) 2021 By VeezMusicProject from pyrogram import Client, filters from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup from config import ( ASSISTANT_NAME, BOT_NAME, BOT_USERNAME, GROUP_SUPPORT, OWNER_NAME, UPDATES_CHANNEL, ) @Client.on_callback_query(filters.regex("cbstart")) async def cbstart(_, query: CallbackQuery): await query.edit_message_text( 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 and video on groups through the new Telegram's video chats!** šŸ’” **Find out all the Bot's commands and how they work by clicking on the Ā» šŸ“š Commands button!** šŸ”– **To know how to use this bot, please click on the Ā» ā“ Basic Guide button!**""", reply_markup=InlineKeyboardMarkup( [ [ 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" ) ], ] ), disable_web_page_preview=True, ) @Client.on_callback_query(filters.regex("cbhowtouse")) async def cbguides(_, query: CallbackQuery): await query.edit_message_text( f"""ā“ **Basic Guide for using this bot:** 1.) **First, add me to your group.** 2.) **Then, promote me as administrator and give all permissions except Anonymous Admin.** 3.) **After promoting me, type /reload in group to refresh the admin data.** 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/music.** 5.) **Sometimes, reloading the bot by using /reload command can help you to fix some problem.** šŸ“Œ **If the userbot not joined to video chat, make sure if the video chat already turned on, or type /userbotleave then type /userbotjoin again.** šŸ’” **If you have a follow-up questions about this bot, you can tell it on my support chat here: @{GROUP_SUPPORT}** āš” __Powered by {BOT_NAME} A.I__""", reply_markup=InlineKeyboardMarkup( [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbstart")]] ), ) @Client.on_callback_query(filters.regex("cbcmds")) async def cbcmds(_, query: CallbackQuery): await query.edit_message_text( f"""āœØ **Hello [{query.message.chat.first_name}](tg://user?id={query.message.chat.id}) !** Ā» **press the button below to read the explanation and see the list of available commands !** āš” __Powered by {BOT_NAME} A.I__""", reply_markup=InlineKeyboardMarkup( [ [ InlineKeyboardButton("šŸ‘·šŸ» Admin Cmd", callback_data="cbadmin"), InlineKeyboardButton("šŸ§™šŸ» Sudo Cmd", callback_data="cbsudo"), ],[ InlineKeyboardButton("šŸ“š Basic Cmd", callback_data="cbbasic") ],[ InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbstart") ], ] ), ) @Client.on_callback_query(filters.regex("cbbasic")) async def cbbasic(_, query: CallbackQuery): await query.edit_message_text( f"""šŸ® here is the basic commands: Ā» /play (song name/link) - play music on video chat Ā» /stream (query/link) - stream the yt live/radio live music Ā» /vplay (video name/link) - play video on video chat Ā» /vstream - play live video from yt live Ā» /playlist - show you the playlist Ā» /video (query) - download video from youtube Ā» /song (query) - download song from youtube Ā» /lyric (query) - scrap the song lyric Ā» /search (query) - search a youtube video link Ā» /ping - show the bot ping status Ā» /uptime - show the bot uptime status Ā» /alive - show the bot alive info (in group) āš”ļø __Powered by {BOT_NAME} AI__""", reply_markup=InlineKeyboardMarkup( [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbcmds")]] ), ) @Client.on_callback_query(filters.regex("cbadmin")) async def cbadmin(_, query: CallbackQuery): await query.edit_message_text( f"""šŸ® here is the admin commands: Ā» /pause - pause the stream Ā» /resume - resume the stream Ā» /skip - switch to next stream Ā» /stop - stop the streaming Ā» /vmute - mute the userbot on voice chat Ā» /vunmute - unmute the userbot on voice chat Ā» /reload - reload bot and refresh the admin data Ā» /userbotjoin - invite the userbot to join group Ā» /userbotleave - order userbot to leave from group āš”ļø __Powered by {BOT_NAME} AI__""", reply_markup=InlineKeyboardMarkup( [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbcmds")]] ), ) @Client.on_callback_query(filters.regex("cbsudo")) async def cbsudo(_, query: CallbackQuery): await query.edit_message_text( f"""šŸ® here is the sudo commands: Ā» /rmw - clean all raw files Ā» /rmd - clean all downloaded files Ā» /leaveall - order userbot to leave from all group āš” __Powered by {BOT_NAME} AI__""", reply_markup=InlineKeyboardMarkup( [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbcmds")]] ), ) @Client.on_callback_query(filters.regex("cbmenu")) async def cbmenu(_, query: CallbackQuery): a = await _.get_chat_member(query.message.chat.id, query.from_user.id) if not a.can_manage_voice_chats: return await query.answer("šŸ’” only admin with manage voice chats permission that can tap this button !", show_alert=True) await query.edit_message_text( f"āš™ļø **settings of** {query.message.chat.title}\n\nāø : pause stream\nā–¶ļø : resume stream\nšŸ”‡ : mute userbot\nšŸ”Š : unmute userbot\nā¹ : stop stream", reply_markup=InlineKeyboardMarkup( [[ InlineKeyboardButton("ā¹", callback_data="cbstop"), InlineKeyboardButton("āø", callback_data="cbpause"), InlineKeyboardButton("ā–¶ļø", callback_data="cbresume"), ],[ InlineKeyboardButton("šŸ”‡", callback_data="cbmute"), InlineKeyboardButton("šŸ”Š", callback_data="cbunmute"), ],[ InlineKeyboardButton("šŸ—‘ Close", callback_data="cls")], ] ), ) @Client.on_callback_query(filters.regex("cls")) async def close(_, query: CallbackQuery): a = await _.get_chat_member(query.message.chat.id, query.from_user.id) if not a.can_manage_voice_chats: return await query.answer("šŸ’” only admin with manage voice chats permission that can tap this button !", show_alert=True) await query.message.delete()