Esempio n. 1
0
 async def load(ctx, extension):
     """Unload the given extension."""
     if config.diff_id(ctx.message.author.id):
         await bot.say('Only the bot owner can use this command')
         return
     bot.load_extension(extension)
     await bot.say('Loaded extension: ' + extension)
     pass
Esempio n. 2
0
 async def logs_clean(self, ctx):
     """Clean new faled logs"""
     if config.diff_id(ctx.message.author.id):
         await self.bot.say('Only the bot owner can use this command')
         return       
     if not (config.arc_enabled() and config.gw2el_enabled()):          
         await self.bot.say("You must give a valid gw2 arc dps path and gw2el path")
         return
     self.autologger.clean()
     await self.bot.say("Logs cleaned")
     return
Esempio n. 3
0
 async def logs_stop(self, ctx):
     """Stop automatic logging"""
     if config.diff_id(ctx.message.author.id):
         await self.bot.say('Only the bot owner can use this command')
         return      
     if not (config.arc_enabled() and config.gw2el_enabled()):          
         await self.bot.say("You must give a valid gw2 arc dps path and gw2el path")
         return
     self.autologger.stop()
     await self.bot.say("Logs listening stopped")
     pass
Esempio n. 4
0
 async def logs_regroup(self, ctx):
     """Regroup new successful logs"""
     if config.diff_id(ctx.message.author.id):
         await self.bot.say('Only the bot owner can use this command')
         return       
     if not (config.arc_enabled() and config.gw2el_enabled()):          
         await self.bot.say("You must give a valid gw2 arc dps path and gw2el path")
         return
     self.autologger.regroup()
     await self.bot.say("Logs regrouped")
     return
Esempio n. 5
0
 async def exit(ctx):
     """Close the bot."""
     if config.diff_id(ctx.message.author.id):
         await bot.say('Only the bot owner can use this command')
         return
     if config.autoclean:
         cache_path = './cache/'
         for file_name in os.listdir(cache_path):
             path = os.path.join(cache_path, file_name)
             try:
                 if os.path.isfile(path):
                     os.unlink(path)
                 pass
             except Exception as e:
                 print(e)
                 pass
     await bot.close()
     pass