mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Sync to latest pyroforok & add some minor fix..
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
6f02488e88
commit
247257f7bd
6 changed files with 33 additions and 32 deletions
10
.github/workflows/notify.yml
vendored
10
.github/workflows/notify.yml
vendored
|
|
@ -19,8 +19,16 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Notify the commit on Telegram.
|
||||
- name: Notify the commit on Telegram YasirPediaFeed.
|
||||
uses: EverythingSuckz/github-telegram-notify@main
|
||||
with:
|
||||
bot_token: '${{ secrets.BOT_TOKEN }}'
|
||||
chat_id: '${{ secrets.CHAT_ID }}'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Notify the commit on Telegram SecretGrup.
|
||||
uses: EverythingSuckz/github-telegram-notify@main
|
||||
with:
|
||||
bot_token: '${{ secrets.BOT_TOKEN }}'
|
||||
chat_id: '-1001777794636'
|
||||
thread_id: '436403'
|
||||
|
|
@ -174,7 +174,10 @@ async def kickFunc(client: Client, ctx: Message, strings) -> "Message":
|
|||
return await ctx.reply_msg(strings("kick_sudo_err"))
|
||||
if user_id in (await list_admins(ctx.chat.id)):
|
||||
return await ctx.reply_msg(strings("kick_admin_err"))
|
||||
try:
|
||||
user = await app.get_users(user_id)
|
||||
except PeerIdInvalid:
|
||||
return await ctx.reply_msg(strings("user_not_found"))
|
||||
msg = strings("kick_msg").format(
|
||||
mention=user.mention,
|
||||
id=user.id,
|
||||
|
|
@ -213,6 +216,8 @@ async def banFunc(client, message, strings):
|
|||
|
||||
try:
|
||||
mention = (await app.get_users(user_id)).mention
|
||||
except PeerIdInvalid:
|
||||
return await message.reply_text(strings("user_not_found"))
|
||||
except IndexError:
|
||||
mention = (
|
||||
message.reply_to_message.sender_chat.title
|
||||
|
|
@ -535,7 +540,7 @@ async def mute(client, message, strings):
|
|||
if len(time_value[:-1]) < 3:
|
||||
await message.chat.restrict_member(
|
||||
user_id,
|
||||
permissions=ChatPermissions(),
|
||||
permissions=ChatPermissions(all_perms=False),
|
||||
until_date=temp_mute,
|
||||
)
|
||||
await message.reply_text(msg, reply_markup=keyboard)
|
||||
|
|
@ -546,7 +551,7 @@ async def mute(client, message, strings):
|
|||
return
|
||||
if reason:
|
||||
msg += strings("banned_reason").format(reas=reason)
|
||||
await message.chat.restrict_member(user_id, permissions=ChatPermissions())
|
||||
await message.chat.restrict_member(user_id, permissions=ChatPermissions(all_perms=False))
|
||||
await message.reply_text(msg, reply_markup=keyboard)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ async def blacklist_filters_re(_, message):
|
|||
try:
|
||||
await message.chat.restrict_member(
|
||||
user.id,
|
||||
ChatPermissions(),
|
||||
ChatPermissions(all_perms=False),
|
||||
until_date=int(time() + 3600),
|
||||
)
|
||||
except Exception:
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ async def locks_func(_, message):
|
|||
await tg_lock(message, permissions, data[parameter], state == "lock")
|
||||
elif parameter == "all" and state == "lock":
|
||||
try:
|
||||
await app.set_chat_permissions(chat_id, ChatPermissions())
|
||||
await app.set_chat_permissions(chat_id, ChatPermissions(all_perms=True))
|
||||
await message.reply_text(f"Locked Everything in {message.chat.title}")
|
||||
except ChatAdminRequired:
|
||||
await message.reply_msg(
|
||||
|
|
@ -177,24 +177,8 @@ async def locks_func(_, message):
|
|||
await app.set_chat_permissions(
|
||||
chat_id,
|
||||
ChatPermissions(
|
||||
can_send_messages=True,
|
||||
can_send_plain=True,
|
||||
can_send_media_messages=True,
|
||||
can_send_docs=True,
|
||||
can_send_inline=True,
|
||||
can_send_photos=True,
|
||||
can_send_videos=True,
|
||||
can_send_roundvideos=True,
|
||||
can_send_audios=True,
|
||||
can_send_voices=True,
|
||||
can_send_stickers=True,
|
||||
can_send_gifs=True,
|
||||
can_add_web_page_previews=True,
|
||||
can_send_polls=True,
|
||||
can_change_info=False,
|
||||
can_invite_users=True,
|
||||
can_pin_messages=False,
|
||||
),
|
||||
all_perms=True,
|
||||
)
|
||||
)
|
||||
await message.reply(f"Unlocked Everything in {message.chat.title}")
|
||||
except ChatAdminRequired:
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ from pyrogram.errors import (
|
|||
ChatNotModified,
|
||||
ChatRestricted,
|
||||
PeerIdInvalid,
|
||||
QueryIdInvalid
|
||||
)
|
||||
from pyrogram.types import ChatPermissions, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
|
||||
|
|
@ -257,6 +258,7 @@ async def nightmode_handler(_, msg, strings):
|
|||
@app.on_callback_query(filters.regex(r"^nightmd$"))
|
||||
@use_chat_lang()
|
||||
async def callbackanightmd(c, q, strings):
|
||||
try:
|
||||
await q.answer(
|
||||
strings("nmd_cb").format(
|
||||
bname=c.me.first_name, ver=__version__, pyver=platform.python_version()
|
||||
|
|
@ -264,3 +266,5 @@ async def callbackanightmd(c, q, strings):
|
|||
show_alert=True,
|
||||
cache_time=10,
|
||||
)
|
||||
except QueryIdInvalid:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ async def getDataNodrakor(msg, kueri, CurrentPage, user, strings):
|
|||
return None, 0, None
|
||||
text = BeautifulSoup(data, "lxml")
|
||||
entry = text.find_all(class_="entry-header")
|
||||
if "Tidak Ditemukan" in entry[0].text:
|
||||
if "Nothing Found" in entry[0].text:
|
||||
if not kueri:
|
||||
await msg.edit_msg(strings("no_result"), del_in=5)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue