More logging

This commit is contained in:
Zeva Rose 2022-03-23 19:04:31 -06:00
parent b0c461ab7d
commit 1225034f72
5 changed files with 35 additions and 3 deletions

View file

@ -407,7 +407,7 @@ class Jarvis(Snake):
url=after.jump_url, url=after.jump_url,
) )
embed.set_footer( embed.set_footer(
text=f"{after.author.user.username}#{after.author.discriminator} | {after.author.id}" text=f"{after.author.username}#{after.author.discriminator} | {after.author.id}"
) )
await channel.send(embed=embed) await channel.send(embed=embed)
if not isinstance(after.channel, DMChannel) and not after.author.bot: if not isinstance(after.channel, DMChannel) and not after.author.bot:
@ -475,6 +475,9 @@ class Jarvis(Snake):
url=message.jump_url, url=message.jump_url,
) )
embed.set_footer( embed.set_footer(
text=f"{message.author.user.username}#{message.author.discriminator} | {message.author.id}" text=(
f"{message.author.username}#{message.author.discriminator} | "
f"{message.author.id}"
)
) )
await channel.send(embed=embed) await channel.send(embed=embed)

View file

@ -87,6 +87,9 @@ class WarningCog(ModcaseCog):
.sort("created_at", -1) .sort("created_at", -1)
.to_list(None) .to_list(None)
) )
if len(warnings) == 0:
await ctx.send("That user has no warnings.", ephemeral=True)
return
active_warns = get_all(warnings, active=True) active_warns = get_all(warnings, active=True)
pages = [] pages = []

View file

@ -88,8 +88,9 @@ class DevCog(Scale):
title = attach.filename title = attach.filename
elif url.match(data): elif url.match(data):
try: try:
if await get_size(data) > MAX_FILESIZE: if (size := await get_size(data)) > MAX_FILESIZE:
await ctx.send("Please hash files that are <= 5GB in size", ephemeral=True) await ctx.send("Please hash files that are <= 5GB in size", ephemeral=True)
self.logger.debug(f"Refused to hash file of size {convert_bytesize(size)}")
return return
except Exception as e: except Exception as e:
await ctx.send(f"Failed to retrieve URL: ```\n{e}\n```", ephemeral=True) await ctx.send(f"Failed to retrieve URL: ```\n{e}\n```", ephemeral=True)

View file

@ -277,6 +277,29 @@ class RemindmeCog(Scale):
component.disabled = True component.disabled = True
await message.edit(components=components) await message.edit(components=components)
@slash_command(
name="reminders",
sub_cmd_name="fetch",
sub_cmd_description="Fetch a reminder that failed to send",
)
@slash_option(
name="id", description="ID of the reminder", opt_type=OptionTypes.STRING, required=True
)
async def _fetch(self, ctx: InteractionContext, id: str) -> None:
reminder = await Reminder.find_one(q(id=id))
if not reminder:
await ctx.send(f"Reminder {id} does not exist")
return
embed = build_embed(title="You have a reminder!", description=reminder.message, fields=[])
embed.set_author(
name=ctx.author.display_name + "#" + ctx.author.discriminator,
icon_url=ctx.author.display_avatar,
)
embed.set_thumbnail(url=ctx.author.display_avatar)
await ctx.send(embed=embed, ephemeral=reminder.private)
def setup(bot: Snake) -> None: def setup(bot: Snake) -> None:
"""Add RemindmeCog to J.A.R.V.I.S.""" """Add RemindmeCog to J.A.R.V.I.S."""

View file

@ -81,6 +81,7 @@ class VerifyCog(Scale):
components=components, components=components,
) )
await response.context.message.delete(delay=5) await response.context.message.delete(delay=5)
self.logger.debug(f"User {ctx.author.id} verified successfully")
else: else:
await response.context.edit_origin( await response.context.edit_origin(
content=( content=(
@ -90,6 +91,7 @@ class VerifyCog(Scale):
) )
except asyncio.TimeoutError: except asyncio.TimeoutError:
await message.delete(delay=30) await message.delete(delay=30)
self.logger.debug(f"User {ctx.author.id} failed to verify before timeout")
def setup(bot: Snake) -> None: def setup(bot: Snake) -> None: