Skip to content

Commit

Permalink
fix: move sentry_trace in the order of decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonejt committed Sep 25, 2024
1 parent a57635c commit d0e7292
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions commands/dominator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Dominator(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@base_dominator.command(description="configure message dominator")
@sentry_trace
@option(
"attribute",
type=SlashCommandOptionType.string,
Expand Down Expand Up @@ -70,8 +70,8 @@ async def message(
ctx, MessageDominators, attribute, action, threshold
)

@sentry_trace
@base_dominator.command(description="configure member dominator")
@sentry_trace
@option(
"attribute",
type=SlashCommandOptionType.string,
Expand Down
2 changes: 1 addition & 1 deletion commands/psycho_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class PsychoPass(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@slash_command(description="get the psycho-pass of a user or server")
@sentry_trace
@option(
"user",
type=SlashCommandOptionType.user,
Expand Down
2 changes: 1 addition & 1 deletion commands/sibyl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class Sibyl(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@slash_command(description="admin utilities for sibyl")
@sentry_trace
@option(
"log_channel",
type=SlashCommandOptionType.channel,
Expand Down
4 changes: 2 additions & 2 deletions events/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class GuildEvents(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_guild_join(self, guild: Guild) -> None:
activity = Activity(
name=f"{len(self.bot.guilds)} Classes", type=ActivityType.watching
Expand All @@ -19,8 +19,8 @@ async def on_guild_join(self, guild: Guild) -> None:
"sibyl-discord has been added to server: {} ({})", guild.name, guild.id
)

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_guild_remove(self, guild: Guild) -> None:
activity = Activity(
name=f"{len(self.bot.guilds)} Classes", type=ActivityType.watching
Expand Down
4 changes: 2 additions & 2 deletions events/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class MemberEvents(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_member_join(self, member: Member) -> None:
log.info(
"@{} ({}) has joined server: {} ({})",
Expand All @@ -24,8 +24,8 @@ async def on_member_join(self, member: Member) -> None:
if not member.bot:
await moderate_member(member)

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_member_remove(self, member: Member) -> None:
log.info(
"@{} ({}) has left server: {} ({})",
Expand Down
4 changes: 2 additions & 2 deletions events/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class MessageEvents(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_message(self, message: Message) -> None:
if message.author.bot or message.channel.nsfw or not message:
return
Expand All @@ -27,8 +27,8 @@ async def on_message(self, message: Message) -> None:

await moderate_message(message)

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_message_edit(self, _before: Message, after: Message) -> None:
if after.author.bot or after.channel.nsfw or not after:
return
Expand Down
2 changes: 1 addition & 1 deletion events/ready.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Ready(Cog):
def __init__(self, bot: Bot) -> None:
self.bot = bot

@sentry_trace
@Cog.listener()
@sentry_trace
async def on_ready(self) -> None:
log.info("logged in as {}!", self.bot.user.name)
activity = Activity(
Expand Down

0 comments on commit d0e7292

Please sign in to comment.