mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 10:44:50 +00:00
Fix perm (#42)
This commit is contained in:
parent
e67c971000
commit
0304645b73
2 changed files with 6 additions and 2 deletions
|
|
@ -127,6 +127,11 @@ async def check_perms(
|
|||
sender = message.reply_text
|
||||
chat = message.chat
|
||||
# TODO: Cache all admin permissions in db.
|
||||
if not message.from_user:
|
||||
# For anonymous admins
|
||||
if message.sender_chat and message.sender_chat.id == message.chat.id:
|
||||
return True
|
||||
return False
|
||||
user = await chat.get_member(message.from_user.id)
|
||||
if user.status == enums.ChatMemberStatus.OWNER:
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ async def currency(c: Client, m: Message):
|
|||
last_update = data["time_last_update_utc"]
|
||||
except KeyError:
|
||||
return await kirimPesan(m, "<code>Invalid response from api !</i>")
|
||||
|
||||
await kirimPesan(m, "**CURRENCY EXCHANGE RATE RESULT:**\n\n" f"`{amount}` **{target_code}** = `{round(conversion_result)}` **{base_code}**\n" f"<b>Rate Today</b> = `{round(conversion_rate)}`\n" f"<b>Last Update:</b> {last_update}")
|
||||
await kirimPesan(m, "**CURRENCY EXCHANGE RATE RESULT:**\n\n" f"`{amount}` **{base_code}** = `{round(conversion_result)}` **{target_code}**\n" f"<b>Rate Today</b> = `{round(conversion_rate)}`\n" f"<b>Last Update:</b> {last_update}")
|
||||
except:
|
||||
await kirimPesan(m, "Failed convert currency, maybe you give wrong currency format or api down.")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue