mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-08 04:44:51 +00:00
Fixx
This commit is contained in:
parent
a587b365a8
commit
3f84bb7b1b
2 changed files with 6 additions and 2 deletions
|
|
@ -60,6 +60,10 @@ class Database:
|
||||||
async def delete_user(self, user_id):
|
async def delete_user(self, user_id):
|
||||||
await self.col.delete_many({"id": int(user_id)})
|
await self.col.delete_many({"id": int(user_id)})
|
||||||
|
|
||||||
|
async def is_chat_exist(self, id):
|
||||||
|
user = await self.grp.find_one({"id": int(id)})
|
||||||
|
return bool(user)
|
||||||
|
|
||||||
async def get_banned(self):
|
async def get_banned(self):
|
||||||
users = self.col.find({"ban_status.is_banned": True})
|
users = self.col.find({"ban_status.is_banned": True})
|
||||||
chats = self.grp.find({"chat_status.is_disabled": True})
|
chats = self.grp.find({"chat_status.is_disabled": True})
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@ async def ban_reply(self: Client, ctx: Message):
|
||||||
@app.on_message(filters.group & filters.incoming, group=3)
|
@app.on_message(filters.group & filters.incoming, group=3)
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
async def grp_bd(self: Client, ctx: Message, strings):
|
async def grp_bd(self: Client, ctx: Message, strings):
|
||||||
chck = await db.get_chat(ctx.chat.id)
|
if not await db.is_chat_exist(ctx.chat.id):
|
||||||
if not chck:
|
|
||||||
total = await self.get_chat_members_count(ctx.chat.id)
|
total = await self.get_chat_members_count(ctx.chat.id)
|
||||||
r_j = ctx.from_user.mention if ctx.from_user else "Anonymous"
|
r_j = ctx.from_user.mention if ctx.from_user else "Anonymous"
|
||||||
await self.send_message(
|
await self.send_message(
|
||||||
|
|
@ -26,6 +25,7 @@ async def grp_bd(self: Client, ctx: Message, strings):
|
||||||
strings("log_bot_added", context="grup_tools").format(ttl=ctx.chat.title, cid=ctx.chat.id, tot=total, r_j=r_j),
|
strings("log_bot_added", context="grup_tools").format(ttl=ctx.chat.title, cid=ctx.chat.id, tot=total, r_j=r_j),
|
||||||
)
|
)
|
||||||
await db.add_chat(ctx.chat.id, ctx.chat.title)
|
await db.add_chat(ctx.chat.id, ctx.chat.title)
|
||||||
|
chck = await db.get_chat(ctx.chat.id)
|
||||||
if chck['is_disabled']:
|
if chck['is_disabled']:
|
||||||
buttons = [[InlineKeyboardButton("Support", url=f"https://t.me/{SUPPORT_CHAT}")]]
|
buttons = [[InlineKeyboardButton("Support", url=f"https://t.me/{SUPPORT_CHAT}")]]
|
||||||
reply_markup = InlineKeyboardMarkup(buttons)
|
reply_markup = InlineKeyboardMarkup(buttons)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue