🐛 rate fix invalid syntax

This commit is contained in:
Xtao_dada 2021-04-13 00:10:31 +08:00 committed by GitHub
parent ab728765ae
commit 0d04b67924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,10 +53,10 @@ async def rate(context):
return
if not context.parameter:
await context.edit(
f"{lang_rate["help"]}{', '.join(currencies)}")
f"{lang_rate['help']}{', '.join(currencies)}")
return
if len(context.parameter) != 3:
await context.edit(f"{lang_rate["help"]}{', '.join(currencies)}")
await context.edit(f"{lang_rate['help']}{', '.join(currencies)}")
return
FROM = context.parameter[0].upper().strip()
TO = context.parameter[1].upper().strip()
@ -66,10 +66,10 @@ async def rate(context):
NB = 1.0
if currencies.count(FROM) == 0:
await context.edit(
f"{FROM}{lang_rate["nc"]}{', '.join(currencies)}")
f"{FROM}{lang_rate['nc']}{', '.join(currencies)}")
return
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
rate_num = round(rates[TO] / rates[FROM] * NB, 2)
await context.edit(f'{FROM} : {TO} = {NB} : {rate_num}')