bandaid to fix coinlib's api
This commit is contained in:
parent
784310e162
commit
90d59aff50
|
@ -10,6 +10,7 @@ import config
|
||||||
from module import commands, example, require_admin
|
from module import commands, example, require_admin
|
||||||
|
|
||||||
URI = "https://coinlib.io/api/v1"
|
URI = "https://coinlib.io/api/v1"
|
||||||
|
HEADERS = {'cookie': "SESSIONID=91049a9e2e89f6a39f827378dd10184f;"}
|
||||||
|
|
||||||
@commands("crypto", "coin")
|
@commands("crypto", "coin")
|
||||||
@example(".crypto btc",
|
@example(".crypto btc",
|
||||||
|
@ -28,7 +29,7 @@ def crypto(bot, trigger):
|
||||||
symbol = trigger.args[1]
|
symbol = trigger.args[1]
|
||||||
if symbol:
|
if symbol:
|
||||||
params["symbol"] = symbol
|
params["symbol"] = symbol
|
||||||
res = requests.get(URI + "/coin", params=params)
|
res = requests.get(URI + "/coin", params=params, headers=HEADERS)
|
||||||
if res.status_code in [400, 401]:
|
if res.status_code in [400, 401]:
|
||||||
return bot.msg(f"Error: {res.json()['error']}")
|
return bot.msg(f"Error: {res.json()['error']}")
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user