This commit is contained in:
yasirarism 2023-06-16 15:19:15 +00:00 committed by GitHub
parent 600b8f1136
commit dca3ed129f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -211,14 +211,14 @@ async def server_stats(self: Client, ctx: Message) -> "Message":
@app.on_message(filters.command("gban", COMMAND_HANDLER) & filters.user(SUDO))
async def ban_globally(self: Client, ctx: Message):
user_id, reason = await extract_user_and_reason(ctx)
user = await app.get_users(user_id)
from_user = ctx.from_user
if not user_id:
return await ctx.reply_text("I can't find that user.")
if not reason:
return await ctx.reply("No reason provided.")
user = await app.get_users(user_id)
from_user = ctx.from_user
if user_id in [from_user.id, self.me.id] or user_id in SUDO:
return await ctx.reply_text("I can't ban that user.")
served_chats = await db.get_all_chats()
@ -275,7 +275,7 @@ __**New Global Ban**__
async def unban_globally(self: Client, ctx: Message):
user_id = await extract_user(ctx)
if not user_id:
return await message.reply_text("I can't find that user.")
return await ctx.reply_text("I can't find that user.")
user = await app.get_users(user_id)
is_gbanned = await is_gbanned_user(user.id)