|
|
|
@ -69,3 +69,30 @@ def network(update, context):
|
|
|
|
|
))
|
|
|
|
|
except:
|
|
|
|
|
update.message.reply_text('Something borked -_-')
|
|
|
|
|
|
|
|
|
|
@log_event
|
|
|
|
|
@check_debug
|
|
|
|
|
def price(update, context):
|
|
|
|
|
try:
|
|
|
|
|
data = {
|
|
|
|
|
'localization': False,
|
|
|
|
|
'tickers': False,
|
|
|
|
|
'market_data': True,
|
|
|
|
|
'community_data': False,
|
|
|
|
|
'developer_data': False,
|
|
|
|
|
'sparkline': False
|
|
|
|
|
}
|
|
|
|
|
headers = {'accept': 'application/json'}
|
|
|
|
|
url = 'https://api.coingecko.com/api/v3/coins/wownero'
|
|
|
|
|
r = requests.get(url, headers=headers, data=data, timeout=5)
|
|
|
|
|
r.raise_for_status()
|
|
|
|
|
j = r.json()
|
|
|
|
|
mcap = j['market_cap_rank']
|
|
|
|
|
sats = j['market_data']['current_price']['btc']
|
|
|
|
|
mname = j['tickers'][0]['market']['name']
|
|
|
|
|
volbtc = j['tickers'][0]['converted_volume']['btc']
|
|
|
|
|
tgt = j['tickers'][0]['target']
|
|
|
|
|
bse = j['tickers'][0]['base']
|
|
|
|
|
update.message.reply_text(f'{tgt}-{bse} is {sats:.8f} {tgt} on {mname} with {volbtc:.2f} {tgt} volume. Currently market cap rank #{mcap}.')
|
|
|
|
|
except:
|
|
|
|
|
update.message.reply_text('Something borked -_-')
|
|
|
|
|