示例#1
0
 async def logs_listen(self, ctx):
     """Listen and parse new logs"""
     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.start(self.bot, ctx.message.channel)
     await self.bot.say("Listening started")
     return
示例#2
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
示例#3
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
示例#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
示例#5
0
 def start(self, bot: commands.Bot, channel: discord.Channel, vc: discord.VoiceClient):
     self.stop()
     loop = asyncio.get_event_loop()
     self.async_tasks = []
     ## create async tasks for mechanics
     for task in self.tasks:
         task.reset()
         self.async_tasks.append(
             loop.create_task(task.alert(bot, channel, vc)))
     ## create file create listener
     if config.arc_enabled():
         self.listener = loop.create_task(self._listen(bot, channel, vc))
     return
示例#6
0
def setup(bot):
    if not (config.arc_enabled() and config.gw2el_enabled()):          
        print("You must give a valid gw2 arc dps path and gw2el path")
        return   
    bot.add_cog(LogsCog(bot))
示例#7
0
 def stop(self):
     for async_task in self.async_tasks:
         async_task.cancel()
     if config.arc_enabled() and not self.listener is None:
         self.listener.cancel()
     return