Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cogs/Configuration/Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def callback(self, interaction: discord.Interaction):
name=f"{interaction.guild.name}", icon_url=interaction.guild.icon
)
embed.set_thumbnail(url=interaction.guild.icon)
embed.description = "> This is where you can toggle your server's modules! If you wanna know more about what these modules do head to the [documentation](https:/docs.astrobirb.dev)"
embed.description = "> This is where you can toggle your server's modules! If you wanna know more about what these modules do head to the [documentation](https://docs.astrobirb.dev)"

view.add_item(
ModuleToggle(
Expand Down Expand Up @@ -214,10 +214,10 @@ async def callback(self, interaction: discord.Interaction):
interaction.user,
)
)
except Exception as e:
except Exception:
import traceback
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports should be at top of file


print(traceback.format_exc(e))
print(traceback.format_exc()) # should take no arguments? same in modmail
elif selection == "Forums":
from Cogs.Configuration.Components.Forums import ForumsOptions, ForumsEmbed

Expand Down
10 changes: 5 additions & 5 deletions Cogs/Events/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def Reply(
try:
Channel = await Guild.fetch_channel(int(ModmailData.get("channel_id", 0)))
except (discord.NotFound, discord.HTTPException):
traceback.format_exc(e)
traceback.format_exc() # same here
return await self.db["modmail"].delete_one({"user_id": message.author.id})
if not Channel:
return await message.add_reaction("⚠️")
Expand All @@ -44,12 +44,12 @@ async def Reply(
f"<:messagereceived:1201999712593383444> {message.author.name}: {message.content}",
files=files,
)
except Exception as e:
except Exception:
return await message.add_reaction("⚠️")
return await message.add_reaction("📨")
try:
await Channel.send(embed=embed, files=files)
except Exception as e:
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to actually reference the exception

except Exception as e:

otherwise the code in the block will not work

print(e)
return await message.add_reaction("⚠️")
return await message.add_reaction("📨")
Expand Down Expand Up @@ -646,8 +646,8 @@ async def on_message(self, message: discord.Message):
)

await Message.edit(view=view, embed=embed, content=None)
except Exception as e:
traceback.format_exc(e)
except Exception:
traceback.format_exc() # same here again
else:
Config = await self.client.config.find_one(
{"_id": Modmail.get("guild_id")}
Expand Down
4 changes: 2 additions & 2 deletions Cogs/Modules/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ async def Reply(
ephemeral=True,
)
return
except Exception as e:
traceback.print_exc(e)
except Exception:
traceback.print_exc() # same here as config and modmail

@modmail.command(description="Close a modmail channel.")
@app_commands.describe(reason="The reason for closing the modmail channel.")
Expand Down