rename get_wiki_page_url to get_page_link

This commit is contained in:
Denis-Cosmin Nutiu 2024-01-29 22:16:11 +02:00
parent 0deaa1a248
commit 06fa385294
2 changed files with 3 additions and 3 deletions

View file

@ -24,5 +24,5 @@ class PathfinderWikiCog(commands.Cog):
inter: disnake.ApplicationCommandInteraction, inter: disnake.ApplicationCommandInteraction,
query: str = commands.Param(autocomplete=pathfinder_wiki_lookup_autocomplete), query: str = commands.Param(autocomplete=pathfinder_wiki_lookup_autocomplete),
): ):
wiki_link = PathfinderWikiClient.get_wiki_page_url(query) wiki_link = PathfinderWikiClient.get_page_link(query)
await inter.send(f"@{inter.author} here's the wiki link: {wiki_link}") await inter.send(f"@{inter.author} here's the wiki link: {wiki_link}")

View file

@ -56,7 +56,7 @@ class PathfinderWikiClient:
return list(map(_convert_to_page, result.get("pages", []))) return list(map(_convert_to_page, result.get("pages", [])))
@staticmethod @staticmethod
def get_wiki_page_url(page_key) -> str: def get_page_link(page_key) -> str:
return f"https://pathfinderwiki.com/wiki/{page_key}" return f"https://pathfinderwiki.com/wiki/{page_key}"
async def close(self): async def close(self):
@ -66,6 +66,6 @@ class PathfinderWikiClient:
if __name__ == "__main__": if __name__ == "__main__":
pf = PathfinderWikiClient() pf = PathfinderWikiClient()
asyncio.run(pf.search_pages("zom")) asyncio.run(pf.search_pages("zom"))
print(pf.get_wiki_page_url("zombie_lord")) print(pf.get_page_link("zombie_lord"))
asyncio.run(pf.close()) asyncio.run(pf.close())