Skip to content

Commit

Permalink
Dahlah pusing
Browse files Browse the repository at this point in the history
Signed-off-by: Yasir Aris M <[email protected]>
  • Loading branch information
yasirarism committed Oct 21, 2023
1 parent 38c007c commit 2abd624
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
8 changes: 5 additions & 3 deletions misskaty/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ async def banFunc(client, message, strings):
keyboard = ikb({"🚨 Unban 🚨": f"unban_{user_id}"})
try:
await message.chat.ban_member(user_id)
await message.reply_text(msg, reply_markup=keyboard)
except Exception as err:
await message.reply(f"ERROR: {err}")
await message.reply_msg(msg, reply_markup=keyboard)
except ChatAdminRequired:
await message.reply("Please give me permission to banned members..!!!")


# Unban members
Expand Down Expand Up @@ -287,6 +287,8 @@ async def unban_func(_, message, strings):
await message.reply_msg(strings("unban_success").format(umention=umention))
except PeerIdInvalid:
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
Expand Down
4 changes: 2 additions & 2 deletions misskaty/plugins/ban_user_or_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ async def ban_a_user(bot, message):
isban, alesan = await db.get_ban_status(k.id)
if isban:
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 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))
Expand Down
2 changes: 1 addition & 1 deletion misskaty/plugins/chatbot_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def bard_chatbot(_, ctx: Message, strings):
strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5
)
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)
try:
req = await fetch.get(
Expand Down
8 changes: 4 additions & 4 deletions misskaty/plugins/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Any, Optional, Tuple

import aiohttp
import contextlib
import cloudscraper
import requests
from apscheduler.schedulers.asyncio import AsyncIOScheduler
Expand All @@ -27,7 +28,7 @@
from pyrogram import Client
from pyrogram import __version__ as pyrover
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.types import (
InlineKeyboardButton,
Expand Down Expand Up @@ -124,12 +125,11 @@ async def log_file(_, ctx: Message, strings):

@app.on_message(filters.command(["donate"], COMMAND_HANDLER))
async def donate(self: Client, ctx: Message):
try:
with contextlib.suppress(ChatSendPlainForbidden, ChatSendPhotosForbidden):
await ctx.reply_photo(
"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",
)
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 ctx.chat.leave()

Expand Down Expand Up @@ -387,7 +387,7 @@ async def shell_cmd(_, ctx: Message, strings):
& filters.user(SUDO)
)
@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)
)
@user.on_message(filters.command(["ev", "run", "meval"], ".") & filters.me)
Expand Down
4 changes: 2 additions & 2 deletions misskaty/plugins/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def save_filters(_, m):
}
await save_filter(chat_id, name, _filter)
await m.reply_msg(f"__**Saved filter {name}.**__")
await m.stop_propagation()
m.stop_propagation()


@app.on_message(filters.command("filters") & ~filters.private)
Expand Down Expand Up @@ -101,7 +101,7 @@ async def del_filter(_, m):
await m.reply_msg(f"**Deleted filter {name}.**")
else:
await m.reply_msg("**No such filter.**")
await m.stop_propagation()
m.stop_propagation()


@app.on_message(
Expand Down

0 comments on commit 2abd624

Please sign in to comment.