Skip to content

Commit

Permalink
fix: chat to user
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Gorn committed Jun 9, 2024
1 parent 8399c6b commit 341e1d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Bot/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pyrogram.errors import FloodWait, Forbidden, BadRequest


@Client.on_message(filters.private & filters.command('broadcast') & filters.reply & myFilters.database & filters.chat(chats=client.config.OWNER_ID))
@Client.on_message(filters.private & filters.command('broadcast') & filters.reply & myFilters.database & filters.user(users=client.config.OWNER_ID))
async def broadcast(bot: Client, update: Message):
message = await update.reply(text='Broadcast started...')
async for user in client.database.xurluploader.users.find({}):
Expand All @@ -26,12 +26,12 @@ async def broadcast(bot: Client, update: Message):
await message.edit(text='Broadcast done.')


@Client.on_message(filters.private & filters.command('broadcast') & ~filters.reply & myFilters.database & filters.chat(chats=client.config.OWNER_ID))
@Client.on_message(filters.private & filters.command('broadcast') & ~filters.reply & myFilters.database & filters.user(users=client.config.OWNER_ID))
async def broadcast_no_reply(bot: Client, update: Message):
await update.reply('Reply to a message.')


@Client.on_message(filters.private & filters.command('ban') & myFilters.database & filters.chat(chats=client.config.OWNER_ID))
@Client.on_message(filters.private & filters.command('ban') & myFilters.database & filters.user(users=client.config.OWNER_ID))
async def ban(bot: Client, update: Message):
try:
user_id = int(update.command[1])
Expand All @@ -47,7 +47,7 @@ async def ban(bot: Client, update: Message):
await update.reply('User ID is not exist in database.')


@Client.on_message(filters.private & filters.command('unban') & myFilters.database & filters.chat(chats=client.config.OWNER_ID))
@Client.on_message(filters.private & filters.command('unban') & myFilters.database & filters.user(users=client.config.OWNER_ID))
async def unban(bot: Client, update: Message):
try:
user_id = int(update.command[1])
Expand Down
4 changes: 2 additions & 2 deletions Bot/plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .. import client


@Client.on_message(filters.private & filters.command("help") & filters.chat(client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.command("help") & filters.user(client.config.AUTH_USERS))
async def help(bot: Client, update: Message):
await bot.send_message(
chat_id=update.chat.id,
Expand All @@ -18,7 +18,7 @@ async def help(bot: Client, update: Message):
)


@Client.on_message(filters.private & filters.command("start") & filters.chat(client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.command("start") & filters.user(client.config.AUTH_USERS))
async def start(bot: Client, update: Message):
await bot.send_message(
chat_id=update.chat.id,
Expand Down
2 changes: 1 addition & 1 deletion Bot/plugins/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pattern=r'(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*))(.*)?')


@Client.on_message(filters.private & filters.regex(pattern=URL_REGEX) & filters.chat(chats=client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.regex(pattern=URL_REGEX) & filters.user(users=client.config.AUTH_USERS))
async def echo_http(bot: Client, update: Message):
if client.database:
user = await client.database.xurluploader.users.find_one({'id': update.from_user.id})
Expand Down
6 changes: 3 additions & 3 deletions Bot/plugins/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def no_args_filter(_, __, m: Message):
return True if len(m.command) == 1 else False


@Client.on_message(filters.private & filters.command('caption') & filters.chat(client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.command('caption') & filters.user(client.config.AUTH_USERS))
async def custom_caption(bot: Client, update: Message):
if client.database:
user = await client.database.xurluploader.users.find_one({'id': update.from_user.id})
Expand All @@ -34,7 +34,7 @@ async def custom_caption(bot: Client, update: Message):
client.custom_caption[update.from_user.id] = caption


@Client.on_message(filters.private & filters.command('thumbnail') & ~filters.reply & (filters.regex(pattern=URL_REGEX) | filters.create(no_args_filter)) & filters.chat(client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.command('thumbnail') & ~filters.reply & (filters.regex(pattern=URL_REGEX) | filters.create(no_args_filter)) & filters.user(client.config.AUTH_USERS))
async def custom_thumbnail(bot: Client, update: Message):
if client.database:
user = await client.database.xurluploader.users.find_one({'id': update.from_user.id})
Expand All @@ -59,7 +59,7 @@ async def custom_thumbnail(bot: Client, update: Message):
client.custom_thumbnail[update.from_user.id] = thumbnail


@Client.on_message(filters.private & filters.command('thumbnail') & filters.reply & filters.create(reply_to_photo_filter) & filters.chat(client.config.AUTH_USERS))
@Client.on_message(filters.private & filters.command('thumbnail') & filters.reply & filters.create(reply_to_photo_filter) & filters.user(client.config.AUTH_USERS))
async def custom_thumbnail_reply(bot: Client, update: Message):
client.custom_thumbnail[update.from_user.id] = await update.reply_to_message.download(file_name=f'{client.config.DOWNLOAD_LOCATION}/{update.from_user.id}.jpg')
await update.reply(text='Custom thumbnail updated.')

0 comments on commit 341e1d0

Please sign in to comment.