Пример #1
0
    def log_tail(self, mess, args):
        """ Display a tail of the log of n lines or 40 by default
        use : !log tail 10
        """
        # admin_only(mess)  # uncomment if paranoid.
        n = 40
        if args.isdigit():
            n = int(args)

        if self.bot_config.BOT_LOG_FILE:
            with open(self.bot_config.BOT_LOG_FILE) as f:
                return '```\n' + tail(f, n) + '\n```'
        return 'No log is configured, please define BOT_LOG_FILE in config.py'
Пример #2
0
    def log_tail(self, mess, args):
        """ Display a tail of the log of n lines or 40 by default
        use : !log tail 10
        """
        # admin_only(mess) # uncomment if paranoid.
        n = 40
        if args.isdigit():
            n = int(args)

        if BOT_LOG_FILE:
            with open(BOT_LOG_FILE, "r") as f:
                return tail(f, n)
        return "No log is configured, please define BOT_LOG_FILE in config.py"
Пример #3
0
    def log_tail(self, mess, args):
        """ Display a tail of the log of n lines or 40 by default
        use : !log tail 10
        """
        # admin_only(mess)  # uncomment if paranoid.
        n = 40
        if args.isdigit():
            n = int(args)

        if self.bot_config.BOT_LOG_FILE:
            with open(self.bot_config.BOT_LOG_FILE) as f:
                return '```\n' + tail(f, n) + '\n```'
        return 'No log is configured, please define BOT_LOG_FILE in config.py'
Пример #4
0
    def log_tail(self, mess, args):
        """ Display a tail of the log of n lines or 40 by default
        use : !log tail 10
        """
        # admin_only(mess)  # uncomment if paranoid.
        n = 40
        if args.isdigit():
            n = int(args)
        from config import BOT_LOG_FILE

        if BOT_LOG_FILE:
            with open(BOT_LOG_FILE, 'r') as f:
                return tail(f, n)
        return 'No log is configured, please define BOT_LOG_FILE in config.py'