Skip to content

Commit

Permalink
try except log
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikk155 committed Nov 23, 2024
1 parent c2231c7 commit 06789c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions plugins/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,17 @@ async def setup_hook(self):

async def log_channel( self, message: str, arguments: list = [] ):
'''Log to #bots-testing channel'''
for __arg__ in arguments:
message = message.replace( "{}", str( __arg__ ), 1 );
try:
for __arg__ in arguments:
message = message.replace( "{}", str( __arg__ ), 1 );

if gpGlobals.workflow():
print( message );
await self.get_channel( gpGlobals.LimitlessPotential.github_id() ).send( message );
else:
await self.get_channel( gpGlobals.LimitlessPotential.log_id() ).send( message );
if gpGlobals.workflow():
print( message );
await self.get_channel( gpGlobals.LimitlessPotential.github_id() ).send( message );
else:
await self.get_channel( gpGlobals.LimitlessPotential.log_id() ).send( message );
except Exception as e:
print(e);

async def log_server_set( self, guildid: int, channelid: int ):
cache = gpGlobals.cache.get();
Expand Down

0 comments on commit 06789c7

Please sign in to comment.