Dahlah pusing

Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
Yasir Aris M 2023-10-21 23:29:23 +07:00
parent 38c007c624
commit 2abd624896
5 changed files with 14 additions and 12 deletions

View file

@ -254,9 +254,9 @@ async def banFunc(client, message, strings):
keyboard = ikb({"🚨 Unban 🚨": f"unban_{user_id}"}) keyboard = ikb({"🚨 Unban 🚨": f"unban_{user_id}"})
try: try:
await message.chat.ban_member(user_id) await message.chat.ban_member(user_id)
await message.reply_text(msg, reply_markup=keyboard) await message.reply_msg(msg, reply_markup=keyboard)
except Exception as err: except ChatAdminRequired:
await message.reply(f"ERROR: {err}") await message.reply("Please give me permission to banned members..!!!")
# Unban members # Unban members
@ -287,6 +287,8 @@ async def unban_func(_, message, strings):
await message.reply_msg(strings("unban_success").format(umention=umention)) await message.reply_msg(strings("unban_success").format(umention=umention))
except PeerIdInvalid: except PeerIdInvalid:
await message.reply_msg(strings("unknown_id", context="general")) await message.reply_msg(strings("unknown_id", context="general"))
except ChatAdminRequired:
await message.reply("Please give me permission to unban members..!!!")
# Ban users listed in a message # Ban users listed in a message

View file

@ -90,10 +90,10 @@ async def ban_a_user(bot, message):
isban, alesan = await db.get_ban_status(k.id) isban, alesan = await db.get_ban_status(k.id)
if isban: if isban:
return await message.reply( return await message.reply(
f"{k.mention} is already banned\nReason: {alesan['reason']}" f"{k.mention} is already banned\n<b>Reason:</b> {alesan['reason']}"
) )
await db.ban_user(k.id, reason) await db.ban_user(k.id, reason)
await message.reply(f"Successfully banned user {k.mention}!! Reason: {reason}") await message.reply(f"Successfully banned user {k.mention}!!\n<b>Reason:</b> {reason}")
@app.on_message(filters.command("unbanuser", COMMAND_HANDLER) & filters.user(SUDO)) @app.on_message(filters.command("unbanuser", COMMAND_HANDLER) & filters.user(SUDO))

View file

@ -29,7 +29,7 @@ async def bard_chatbot(_, ctx: Message, strings):
strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5 strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5
) )
if not BARD_API: if not BARD_API:
return await ctx.reply_msg("BARD_API env is mising!!!") return await ctx.reply_msg("BARD_API env is missing!!!")
msg = await ctx.reply_msg(strings("find_answers_str"), quote=True) msg = await ctx.reply_msg(strings("find_answers_str"), quote=True)
try: try:
req = await fetch.get( req = await fetch.get(

View file

@ -15,6 +15,7 @@ from time import time
from typing import Any, Optional, Tuple from typing import Any, Optional, Tuple
import aiohttp import aiohttp
import contextlib
import cloudscraper import cloudscraper
import requests import requests
from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.schedulers.asyncio import AsyncIOScheduler
@ -27,7 +28,7 @@ from psutil import net_io_counters, virtual_memory
from pyrogram import Client from pyrogram import Client
from pyrogram import __version__ as pyrover from pyrogram import __version__ as pyrover
from pyrogram import enums, filters from pyrogram import enums, filters
from pyrogram.errors import ChatSendPhotosForbidden, FloodWait, MessageTooLong, PeerIdInvalid from pyrogram.errors import ChatSendPhotosForbidden, FloodWait, MessageTooLong, PeerIdInvalid, ChatSendPlainForbidden
from pyrogram.raw.types import UpdateBotStopped from pyrogram.raw.types import UpdateBotStopped
from pyrogram.types import ( from pyrogram.types import (
InlineKeyboardButton, InlineKeyboardButton,
@ -124,12 +125,11 @@ async def log_file(_, ctx: Message, strings):
@app.on_message(filters.command(["donate"], COMMAND_HANDLER)) @app.on_message(filters.command(["donate"], COMMAND_HANDLER))
async def donate(self: Client, ctx: Message): async def donate(self: Client, ctx: Message):
try: with contextlib.suppress(ChatSendPlainForbidden, ChatSendPhotosForbidden):
await ctx.reply_photo( await ctx.reply_photo(
"https://img.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg", "https://img.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg",
caption=f"Hi {ctx.from_user.mention}, If you find this bot useful, you can make a donation to the account below. Because this bot server uses VPS and is not free. Thank You..\n\n<b>Indonesian Payment:</b>\n<b>QRIS:</b> https://img.yasirweb.eu.org/file/b1c86973ae4e55721983a.jpg (Yasir Store)\n<b>Mayar:</b> https://yasirarism.mayar.link/payme\n<b>Bank Jago:</b> 109641845083 (Yasir Aris M)\n\nFor international people can use PayPal to support me or via GitHub Sponsor:\nhttps://paypal.me/yasirarism\nhttps://github.com/sponsors/yasirarism\n\n<b>Source:</b> @BeriKopi", caption=f"Hi {ctx.from_user.mention}, If you find this bot useful, you can make a donation to the account below. Because this bot server uses VPS and is not free. Thank You..\n\n<b>Indonesian Payment:</b>\n<b>QRIS:</b> https://img.yasirweb.eu.org/file/b1c86973ae4e55721983a.jpg (Yasir Store)\n<b>Mayar:</b> https://yasirarism.mayar.link/payme\n<b>Bank Jago:</b> 109641845083 (Yasir Aris M)\n\nFor international people can use PayPal to support me or via GitHub Sponsor:\nhttps://paypal.me/yasirarism\nhttps://github.com/sponsors/yasirarism\n\n<b>Source:</b> @BeriKopi",
) )
except ChatSendPhotosForbidden:
await self.send_message(LOG_CHANNEL, f"❗️ <b>WARNING</b>\nI'm leaving from {ctx.chat.id} since i didn't have sufficient admin permissions.") await self.send_message(LOG_CHANNEL, f"❗️ <b>WARNING</b>\nI'm leaving from {ctx.chat.id} since i didn't have sufficient admin permissions.")
await ctx.chat.leave() await ctx.chat.leave()
@ -387,7 +387,7 @@ async def shell_cmd(_, ctx: Message, strings):
& filters.user(SUDO) & filters.user(SUDO)
) )
@app.on_edited_message( @app.on_edited_message(
(filters.command(["ev", "run", "meval"]) | filters.regex(r"app.run\(\)$")) (filters.command(["ev", "run", "meval"], COMMAND_HANDLER) | filters.regex(r"app.run\(\)$"))
& filters.user(SUDO) & filters.user(SUDO)
) )
@user.on_message(filters.command(["ev", "run", "meval"], ".") & filters.me) @user.on_message(filters.command(["ev", "run", "meval"], ".") & filters.me)

View file

@ -71,7 +71,7 @@ async def save_filters(_, m):
} }
await save_filter(chat_id, name, _filter) await save_filter(chat_id, name, _filter)
await m.reply_msg(f"__**Saved filter {name}.**__") await m.reply_msg(f"__**Saved filter {name}.**__")
await m.stop_propagation() m.stop_propagation()
@app.on_message(filters.command("filters") & ~filters.private) @app.on_message(filters.command("filters") & ~filters.private)
@ -101,7 +101,7 @@ async def del_filter(_, m):
await m.reply_msg(f"**Deleted filter {name}.**") await m.reply_msg(f"**Deleted filter {name}.**")
else: else:
await m.reply_msg("**No such filter.**") await m.reply_msg("**No such filter.**")
await m.stop_propagation() m.stop_propagation()
@app.on_message( @app.on_message(