Archived
1
0
Fork 0

Add exchange_rate.py

This commit is contained in:
多羅狼 2023-12-18 19:53:33 +08:00 committed by GitHub
parent f1031437c5
commit a96ea5993d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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}")