From 126376ef9918f7089f64549fc6b53f8a7d2d09b5 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:42:34 +0700 Subject: [PATCH] change --- program/callback.py | 194 ++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 114 deletions(-) diff --git a/program/callback.py b/program/callback.py index 07e5491..ca913c1 100644 --- a/program/callback.py +++ b/program/callback.py @@ -1,135 +1,101 @@ # Copyright (C) 2021 By VeezMusicProject from pyrogram import Client, filters -from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery - -from config import Veez - - -@Client.on_callback_query(filters.regex("cbguide")) -async def cbguide(_, query: CallbackQuery): - await query.edit_message_text( - f"""ā“ HOW TO USE THIS BOT: - -1.) first, add me to your group. -2.) then promote me as admin and give all permissions except anonymous admin. -3.) add @{Veez.ASSISTANT_NAME } to your group. -4.) turn on the voice chat first before start to stream video. -5.) type /vplay (reply to video) to start streaming. -6.) type /vstop to end the video streaming. - -šŸ“ **note: stream & stop command can only be executed by group admin only!** - -āš” __Maintained by Veez Project Team__""", - reply_markup=InlineKeyboardMarkup( - [[ - InlineKeyboardButton( - "šŸ” Go Back", callback_data="cbstart") - ]] - )) +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"āœØ **Hello there, I am a telegram group video streaming bot.**\n\nšŸ’­ **I was created to stream videos in group " - f"video chats easily.**\n\nā” **To find out how to use me, please press the help button below** šŸ‘‡šŸ»", + 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!** + +šŸ’” **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/{Veez.BOT_USERNAME}?startgroup=true") - ], [ - InlineKeyboardButton( - "ā” HOW TO USE THIS BOT", callback_data="cbguide") - ], [ - InlineKeyboardButton( - "šŸŒ Terms & Condition", callback_data="cbinfo") - ], [ - InlineKeyboardButton( - "šŸ’¬ Group", url=f"https://t.me/{Veez.GROUP_NAME}"), - InlineKeyboardButton( - "šŸ“£ Channel", url=f"https://t.me/{Veez.CHANNEL_NAME}") - ], [ - InlineKeyboardButton( - "šŸ§™šŸ»ā€ā™‚ļø Owner", url=f"https://t.me/{Veez.OWNER_NAME}") - ], [ - InlineKeyboardButton( - "šŸ“š All Command List", callback_data="cblist") - ]] - )) - - -@Client.on_callback_query(filters.regex("cbinfo")) -async def cbinfo(_, query: CallbackQuery): - await query.edit_message_text( - f"""šŸŒ **bot information !** - -šŸ¤– __This bot was created to stream video in telegram group video chats using several methods from WebRTC.__ - -šŸ’” __Powered by PyTgcalls the Async client API for the Telegram Group Calls, and Pyrogram the telegram MTProto API -Client Library and Framework in Pure Python for Users and Bots.__ - -šŸ‘ØšŸ»ā€šŸ’» __Thanks to the developers who participated in the development of this bot, the list of devs can be seen below:__ - -šŸ‘©šŸ»ā€āœˆļø Ā» [Levina Shavila](https://github.com/levina-lab) -šŸ¤µšŸ» Ā» [Sammy-XD](https://github.com/Sammy-XD) -šŸ¤µšŸ» Ā» [Zxce3](https://github.com/Zxce3) -šŸ¤µšŸ» Ā» [Tofik Denianto](https://github.com/tofikdn) -šŸ¤µšŸ» Ā» [Shohih Abdul](https://github.com/DoellBarr) - -__This bot licensed under GNU-GPL 3.0 License__""", - reply_markup=InlineKeyboardMarkup( - [[ - InlineKeyboardButton( - "šŸ” Go Back", callback_data="cbstart") - ]] + [ + [ + 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 + disable_web_page_preview=True, ) -@Client.on_callback_query(filters.regex("cblist")) -async def cblist(_, query: CallbackQuery): +@Client.on_callback_query(filters.regex("cbhowtouse")) +async def cbguides(_, query: CallbackQuery): await query.edit_message_text( - f"""šŸ“š All Command List: + f"""ā“ **Basic Guide for using this bot:** -Ā» /vplay (reply to video or yt/live url) - to stream video -Ā» /vstop - stop the video streaming -Ā» /song (song name) - download song from YT -Ā» /vsong (video name) - download video from YT -Ā» /lyric (song name) - lyric scrapper -Ā» /vjoin - invite assistant join to your group -Ā» /vleave - order assistant leave from your group +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.** -šŸŽŠ FUN CMD: +šŸ’” **If you have a follow-up questions about this bot, you can tell it on my support chat here: @{GROUP_SUPPORT}** -Ā» /asupan - check it by yourself -Ā» /chika - check it by yourself -Ā» /wibu - check it by yourself -Ā» /truth - check it by yourself -Ā» /dare - check it by yourself - -šŸ”° EXTRA CMD: - -Ā» /tts (reply to text) - text to speech -Ā» /alive - check bot alive status -Ā» /ping - check bot ping status -Ā» /uptime - check bot uptime status -Ā» /sysinfo - check bot system information - -šŸ’” SUDO ONLY: - -Ā» /rmd - remove all downloaded files -Ā» /rmw - remove all downloaded raw files -Ā» /leaveall - order assistant leave from all group - -āš” __Maintained by Veez Project Team__""", +āš” __Powered by {BOT_NAME} A.I__""", reply_markup=InlineKeyboardMarkup( - [[ - InlineKeyboardButton( - "šŸ” Go Back", callback_data="cbstart") - ]] - )) + [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbstart")]] + ), + ) + + +@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 +Ā» /queue - show you the queue list +Ā» /vpause - pause the stream +Ā» /vresume - resume the stream +Ā» /vskip - switch to next stream +Ā» /vstop - stop the streaming +Ā» /restart - restart the bot (sudo user only) + +āš” __Powered by {BOT_NAME} AI__""", + reply_markup=InlineKeyboardMarkup( + [[InlineKeyboardButton("šŸ”™ Go Back", callback_data="cbstart")]] + ), + ) @Client.on_callback_query(filters.regex("cls"))