Fixing the flows command
This commit is contained in:
parent
90ae182c8d
commit
88b0783ecb
@ -299,12 +299,14 @@ class Cheeky(commands.Cog):
|
|||||||
|
|
||||||
await ctx.respond(":8ball: %s :8ball:" % result)
|
await ctx.respond(":8ball: %s :8ball:" % result)
|
||||||
|
|
||||||
@commands.command(name="flows")
|
@commands.slash_command(
|
||||||
|
name="flows", description="Gets the river flow stats for 3 rivers"
|
||||||
|
)
|
||||||
async def flows(self, ctx: commands.Context):
|
async def flows(self, ctx: commands.Context):
|
||||||
import river_stats
|
import river_stats
|
||||||
|
|
||||||
result = river_stats.get_stats()
|
result = river_stats.get_stats()
|
||||||
await ctx.reply(embed=result)
|
await ctx.respond(embed=result)
|
||||||
|
|
||||||
@commands.slash_command(
|
@commands.slash_command(
|
||||||
guild_ids=None,
|
guild_ids=None,
|
||||||
|
@ -76,7 +76,7 @@ class StarCitizen(commands.Cog):
|
|||||||
returns a list of all ships in the game, which can then be passed to the /ship command for auto complete
|
returns a list of all ships in the game, which can then be passed to the /ship command for auto complete
|
||||||
"""
|
"""
|
||||||
url = "https://starcitizen.tools/Category:Ships"
|
url = "https://starcitizen.tools/Category:Ships"
|
||||||
response = requests.get(url, timeout=5).text
|
response = requests.get(url, timeout=25).text
|
||||||
soup = BeautifulSoup(response, "html.parser")
|
soup = BeautifulSoup(response, "html.parser")
|
||||||
h2_heading = soup.find("h2", text='Pages in category "Ships"')
|
h2_heading = soup.find("h2", text='Pages in category "Ships"')
|
||||||
return [link.text for link in h2_heading.find_next("div").find_all("a")]
|
return [link.text for link in h2_heading.find_next("div").find_all("a")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user