Sarenrae: test commit
This commit is contained in:
parent
2e8a18f36b
commit
ddbe7a4f46
@ -20,14 +20,14 @@ class Sarenrae(commands.Cog):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.conf = Config.get_conf(self, identifier=UID, force_registration=True)
|
self.conf = Config.get_conf(self, identifier=UID, force_registration=True)
|
||||||
default_global = {
|
default_global = {
|
||||||
"pf2_token": "",
|
"token": "",
|
||||||
}
|
}
|
||||||
self.conf.register_global(**default_global)
|
self.conf.register_global(**default_global)
|
||||||
|
|
||||||
@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.pf2_token()}
|
headers = {"Authorization": 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,5 +39,7 @@ 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):
|
||||||
self.conf.pf2_token.set(args[0])
|
for arg in args:
|
||||||
return await ctx.send(f"Set token to {self.conf.pf2_token()}")
|
await ctx.send(arg)
|
||||||
|
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