Skip to content

Commit

Permalink
[SeinaTools] fix perms + silent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Sep 24, 2023
1 parent 478550e commit e4c4d2e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion seinatools/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ async def on_red_api_tokens_update(
await self.cog_load()

@commands.is_owner()
@commands.bot_has_permissions(embed_links=True, add_reactions=True)
@commands.command(name="spy")
async def _spy(
self,
Expand Down Expand Up @@ -245,6 +246,7 @@ async def _spy(
return

@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
@commands.group(name="botstat", aliases=["botstatset"], invoke_without_command=True)
async def _botstat(self, ctx: commands.Context, /):
"""
Expand Down Expand Up @@ -310,6 +312,7 @@ async def _embed(self, ctx: commands.Context, true_or_false: bool):
return await ctx.tick()

@commands.is_owner()
@commands.bot_has_permissions(attach_files=True)
@commands.command(
name="screenshot", aliases=["ss"]
) # https://discord.com/channels/133049272517001216/133251234164375552/941197661426565150
Expand All @@ -333,7 +336,12 @@ async def _screenshot(self, ctx: commands.Context, url: str, wait: Optional[int]
},
)

await page.goto(url)
try:
await page.goto(url)
except Exception as e:
log.exception(
f"Something went wrong trying to fetch the url: {box(str(e), lang='py')}"
)

if wait != None:
await page.wait_for_timeout(wait)
Expand Down Expand Up @@ -419,6 +427,7 @@ async def _spotify(self, ctx: commands.Context, user: Optional[discord.Member] =

if not token:
await ctx.send("You have not provided an api key yet.")
return

if not user:
user: discord.Member = ctx.author
Expand Down

0 comments on commit e4c4d2e

Please sign in to comment.