diff --git a/tg_bot/modules/admin.py b/tg_bot/modules/admin.py index e4085dd9..7dd738c3 100644 --- a/tg_bot/modules/admin.py +++ b/tg_bot/modules/admin.py @@ -323,31 +323,15 @@ def rmchatpic(bot: Bot, update: Update): @run_async def adminlist(bot: Bot, update: Update): administrators = update.effective_chat.get_administrators() - msg = update.effective_message text = "Admins in *{}*:".format(update.effective_chat.title or "this chat") for admin in administrators: user = admin.user - status = admin.status - name = "[{}](tg://user?id={})".format(user.first_name + " " + (user.last_name or ""), user.id) - if user.username: - name = name = escape_markdown("@" + user.username) - if status == "creator": - text += "\n 🔱 Creator:" - text += "\n` • `{} \n\n • *Administrators*:".format(name) - for admin in administrators: - user = admin.user - status = admin.status - chat = update.effective_chat - count = chat.get_members_count() - name = "[{}](tg://user?id={})".format(user.first_name + " " + (user.last_name or ""), user.id) + name = "[{}](tg://user?id={})".format(user.first_name + (user.last_name or ""), user.id) if user.username: name = escape_markdown("@" + user.username) - - if status == "administrator": - text += "\n`👮🏻 `{}".format(name) - members = "\n\n*Members:*\n`🙍‍♂️ ` {} users".format(count) - - msg.reply_text(text + members, parse_mode=ParseMode.MARKDOWN) + text += "\n - {}".format(name) + + update.effective_message.reply_text(text, parse_mode=ParseMode.MARKDOWN) diff --git a/tg_bot/plugins/start.py b/tg_bot/plugins/start.py new file mode 100644 index 00000000..1fd7a520 --- /dev/null +++ b/tg_bot/plugins/start.py @@ -0,0 +1,32 @@ +from pyrogram import Filters, InlineKeyboardMarkup, InlineKeyboardButton + +from ..config import Config +from ..screenshotbot import ScreenShotBot + + +@ScreenShotBot.on_message(Filters.private & Filters.command("start")) +async def start(c, m): + + if not await c.db.is_user_exist(m.chat.id): + await c.db.add_user(m.chat.id) + await c.send_message( + Config.LOG_CHANNEL, + f"New User [{m.from_user.first_name}](tg://user?id={m.chat.id}) started." + ) + + await m.reply_text( + text=f"Hi there {m.from_user.first_name}.\n\nI'm Screenshot Generator Bot. I can provide screenshots from your video files with out downloading the entire file (almost instantly). For more details check /help.", + quote=True, + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton('📌 Support Group', url='https://t.me/InFoTelGroup'), + InlineKeyboardButton('🔖 Projects Channel', url='https://t.me/TGBotsZ') + ], + [ + InlineKeyboardButton('💡 Source Code', url='https://github.com/TGExplore/Screenshot-Bot'), + InlineKeyboardButton('👨 Master', url='https://t.me/odbots') + ] + ] + ) + )