Skip to content

Commit

Permalink
skip fake event in cogs
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasByr committed Sep 13, 2023
1 parent 8b19159 commit 24d6bcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helper/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class UsefullCog(commands.GroupCog):

def __init__(self, client: commands.AutoShardedBot) -> None:
self.__loaded = False
self.client = client
self.dispatcher: MessageSender = client.dispatcher
self.embed_builder: Embedder = client.embed_builder
Expand All @@ -19,6 +20,9 @@ def __init__(self, client: commands.AutoShardedBot) -> None:

@commands.Cog.listener()
async def on_ready(self):
if self.__loaded:
return
self.__loaded = True
self.log.info('%s cog loaded !', self.__class__.__name__)

def log_interaction(self, interaction: discord.Interaction):
Expand Down

0 comments on commit 24d6bcc

Please sign in to comment.