mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 13:34:08 +00:00
🐛 rate fix invalid syntax
This commit is contained in:
parent
ab728765ae
commit
0d04b67924
8
rate.py
8
rate.py
@ -53,10 +53,10 @@ async def rate(context):
|
|||||||
return
|
return
|
||||||
if not context.parameter:
|
if not context.parameter:
|
||||||
await context.edit(
|
await context.edit(
|
||||||
f"{lang_rate["help"]}{', '.join(currencies)}")
|
f"{lang_rate['help']}{', '.join(currencies)}")
|
||||||
return
|
return
|
||||||
if len(context.parameter) != 3:
|
if len(context.parameter) != 3:
|
||||||
await context.edit(f"{lang_rate["help"]}{', '.join(currencies)}")
|
await context.edit(f"{lang_rate['help']}{', '.join(currencies)}")
|
||||||
return
|
return
|
||||||
FROM = context.parameter[0].upper().strip()
|
FROM = context.parameter[0].upper().strip()
|
||||||
TO = context.parameter[1].upper().strip()
|
TO = context.parameter[1].upper().strip()
|
||||||
@ -66,10 +66,10 @@ async def rate(context):
|
|||||||
NB = 1.0
|
NB = 1.0
|
||||||
if currencies.count(FROM) == 0:
|
if currencies.count(FROM) == 0:
|
||||||
await context.edit(
|
await context.edit(
|
||||||
f"{FROM}{lang_rate["nc"]}{', '.join(currencies)}")
|
f"{FROM}{lang_rate['nc']}{', '.join(currencies)}")
|
||||||
return
|
return
|
||||||
if currencies.count(TO) == 0:
|
if currencies.count(TO) == 0:
|
||||||
await context.edit(f"{TO}{lang_rate["nc"]}{', '.join(currencies)}")
|
await context.edit(f"{TO}{lang_rate['nc']}{', '.join(currencies)}")
|
||||||
return
|
return
|
||||||
rate_num = round(rates[TO] / rates[FROM] * NB, 2)
|
rate_num = round(rates[TO] / rates[FROM] * NB, 2)
|
||||||
await context.edit(f'{FROM} : {TO} = {NB} : {rate_num}')
|
await context.edit(f'{FROM} : {TO} = {NB} : {rate_num}')
|
||||||
|
Loading…
Reference in New Issue
Block a user