mirror of
https://github.com/Redume/Shirino.git
synced 2025-05-19 02:05:26 +01:00
chore: added a new field for period customization
This commit is contained in:
parent
722b79b523
commit
5fe0a5ae3a
1 changed files with 9 additions and 3 deletions
|
@ -5,10 +5,16 @@ import aiohttp
|
|||
|
||||
config = yaml.safe_load(open('../config.yaml', 'r', encoding='utf-8'))
|
||||
|
||||
async def create_chart(from_currency: str, conv_currency: str) -> (dict, None):
|
||||
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=3)) as session:
|
||||
async def create_chart(
|
||||
from_currency: str,
|
||||
conv_currency: str,
|
||||
period: str) -> (dict, None):
|
||||
async with aiohttp.ClientSession(
|
||||
timeout=aiohttp.ClientTimeout(total=3)
|
||||
) as session:
|
||||
async with session.get(
|
||||
f'{config["kekkai_instance"]}/api/getChart/month/', params={
|
||||
f'{config["kekkai_instance"]}/api/getChart/{period}/',
|
||||
params={
|
||||
'from_currency': from_currency,
|
||||
'conv_currency': conv_currency
|
||||
}) as res:
|
||||
|
|
Loading…
Add table
Reference in a new issue