Add exchange_rate.py
This commit is contained in:
parent
f1031437c5
commit
a96ea5993d
1 changed files with 11 additions and 0 deletions
11
bots/discord/slash/exchange_rate.py
Normal file
11
bots/discord/slash/exchange_rate.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import discord
|
||||
|
||||
from bots.discord.client import client
|
||||
from bots.discord.slash_parser import slash_parser
|
||||
|
||||
@client.slash_command(description="Convert currency prices according to the exchange rate of the day.")
|
||||
@discord.option(name="amount", default=1.0, description="The amount of base currency.")
|
||||
@discord.option(name="base", description="The base currency unit.")
|
||||
@discord.option(name="target", description="The target currency unit.")
|
||||
async def exchange_rate(ctx: discord.ApplicationContext, amount: float, base: str, target: str):
|
||||
await slash_parser(ctx, f"{amount}{base} {target}")
|
Reference in a new issue