Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions tg_bot/modules/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
32 changes: 32 additions & 0 deletions tg_bot/plugins/start.py
Original file line number Diff line number Diff line change
@@ -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')
]
]
)
)