-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
011ab95
commit 0461de5
Showing
1 changed file
with
39 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,50 @@ | ||
import random | ||
from pyrogram import Client, filters | ||
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup | ||
from config import LOGGER_ID as LOG_GROUP_ID | ||
from config import LOGGER_ID as BOTADDLOGS | ||
from FIXXMUSIC import app | ||
from pyrogram.errors import RPCError | ||
from typing import Union, Optional | ||
from PIL import Image, ImageDraw, ImageFont | ||
import asyncio, os, aiohttp | ||
from pathlib import Path | ||
from pyrogram.enums import ParseMode | ||
from pyrogram import Client, filters | ||
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup | ||
|
||
photo = [ | ||
"https://telegra.ph/file/1949480f01355b4e87d26.jpg", | ||
"https://telegra.ph/file/3ef2cc0ad2bc548bafb30.jpg", | ||
"https://telegra.ph/file/a7d663cd2de689b811729.jpg", | ||
"https://telegra.ph/file/6f19dc23847f5b005e922.jpg", | ||
"https://telegra.ph/file/2973150dd62fd27a3a6ba.jpg", | ||
] | ||
async def new_message(chat_id: int, message: str, reply_markup=None): | ||
await app.send_message(chat_id=chat_id, text=message, reply_markup=reply_markup) | ||
|
||
@app.on_message(filters.new_chat_members, group=2) | ||
async def join_watcher(_, message): | ||
chat = message.chat | ||
link = await app.export_chat_invite_link(chat.id) | ||
for member in message.new_chat_members: | ||
if member.id == app.id: | ||
count = await app.get_chat_members_count(chat.id) | ||
msg = ( | ||
f"๐ แดแดsษชแด สแดแด แดแด แด แดแด ษชษด แด ษดแดแดก ษขสแดแดแด\n\n" | ||
f"____________________________________\n\n" | ||
f"๐ แดสแดแด ษดแดแดแด: {chat.title}\n" | ||
f"๐ แดสแดแด ษชแด : {chat.id}\n" | ||
f"๐ แดสแดแด แดsแดสษดแดแดแด: @{chat.username}\n" | ||
f"๐ฐ แดสแดแด สษชษดแด: [แดสษชแดแด]({link})\n" | ||
f"๐ ษขสแดแดแด แดแดแดสแดสs: {count}\n" | ||
f"๐ค แดแด แด แดแด สส: {message.from_user.mention}" | ||
) | ||
await app.send_photo(LOG_GROUP_ID, photo=random.choice(photo), caption=msg, reply_markup=InlineKeyboardMarkup([ | ||
[InlineKeyboardButton(f"sแดแด ษขสแดแดแด๐", url=f"{link}")] | ||
])) | ||
@app.on_message(filters.new_chat_members) | ||
async def on_new_chat_members(client: Client, message: Message): | ||
if (await client.get_me()).id in [user.id for user in message.new_chat_members]: | ||
added_by = message.from_user.mention if message.from_user else "แดษดแดษดแดแดกษด แดsแดส" | ||
title = message.chat.title | ||
username = f"@{message.chat.username}" | ||
chat_id = message.chat.id | ||
am = f"โซ <b><u>ษดแดแดก ษขสแดแดแด</u></b> :\n\nแดสแดแด ษชแด : {chat_id}\nแดสแดแด แดsแดสษดแดแดแด : {username}\nแดสแดแด แดษชแดสแด : {title}\n\nแดแด แด แดแด สส : {added_by}" | ||
reply_markup = InlineKeyboardMarkup([ | ||
[ | ||
InlineKeyboardButton( | ||
message.from_user.first_name, | ||
user_id=message.from_user.id | ||
) | ||
] | ||
]) | ||
|
||
|
||
await new_message(BOTADDLOGS, am, reply_markup) | ||
|
||
@app.on_message(filters.left_chat_member) | ||
async def on_left_chat_member(_, message: Message): | ||
if (await app.get_me()).id == message.left_chat_member.id: | ||
remove_by = message.from_user.mention if message.from_user else "๐ษดแดษดแดแดกษด ๐sแดส" | ||
async def on_left_chat_member(client: Client, message: Message): | ||
if (await client.get_me()).id == message.left_chat_member.id: | ||
remove_by = message.from_user.mention if message.from_user else "แดษดแดษดแดแดกษด แดsแดส" | ||
title = message.chat.title | ||
username = f"@{message.chat.username}" if message.chat.username else "๐สษชแด แดแดแด ๐สแดแด" | ||
username = f"@{message.chat.username}" | ||
chat_id = message.chat.id | ||
left = f"โซ <b><u>#๐แดาแด_๐สแดแดแด</u></b> โซ\n\n๐สแดแด ๐ษชแดสแด : {title}\n\n๐สแดแด ๐แด : {chat_id}\n\n๐แดแดแดแด แดแด ๐ส : {remove_by}\n\n๐แดแด : @{app.username}" | ||
await app.send_photo(LOG_GROUP_ID, photo=random.choice(photo), caption=left) | ||
ambye = f"โซ <b><u>สแดาแด ษขสแดแดแด</u></b> :\n\nแดสแดแด ษชแด : {chat_id}\nแดสแดแด แดsแดสษดแดแดแด : {username}\nแดสแดแด แดษชแดสแด : {title}\n\nสแดแดแดแด แดแด สส : {remove_by}" | ||
reply_markup = InlineKeyboardMarkup([ | ||
[ | ||
InlineKeyboardButton( | ||
message.from_user.first_name, | ||
user_id=message.from_user.id | ||
) | ||
] | ||
]) | ||
|
||
|
||
await new_message(BOTADDLOGS, ambye, reply_markup) |