Sarenrae: fix permanent token storage
This commit is contained in:
parent
ddbe7a4f46
commit
b9929e1c1c
@ -27,7 +27,7 @@ class Sarenrae(commands.Cog):
|
|||||||
@commands.command()
|
@commands.command()
|
||||||
async def ancestry(self, ctx, *args):
|
async def ancestry(self, ctx, *args):
|
||||||
name = args[0]
|
name = args[0]
|
||||||
headers = {"Authorization": self.conf.token()}
|
headers = {"Authorization": await self.conf.token()}
|
||||||
req = requests.get(f"https://api.pathfinder2.fr/v1/pf2/ancestry?name={name}", headers=headers).json()
|
req = requests.get(f"https://api.pathfinder2.fr/v1/pf2/ancestry?name={name}", headers=headers).json()
|
||||||
html = req["results"][0]["data"]["description"]["value"]
|
html = req["results"][0]["data"]["description"]["value"]
|
||||||
filename = f"ancestry-{name}"
|
filename = f"ancestry-{name}"
|
||||||
@ -39,7 +39,5 @@ class Sarenrae(commands.Cog):
|
|||||||
@commands.command()
|
@commands.command()
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
async def sarenrae_token(self, ctx, *args):
|
async def sarenrae_token(self, ctx, *args):
|
||||||
for arg in args:
|
await self.conf.token.set(args[0])
|
||||||
await ctx.send(arg)
|
return await ctx.send(f"Set token to {await self.conf.token()}")
|
||||||
self.conf.token.set(args[0])
|
|
||||||
return await ctx.send(f"Set token to {self.conf.token()}")
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user