def setup(bot):
    if (not hasattr(bot, 'command_stats')):
        bot.command_stats = Counter()
    if (not hasattr(bot, 'socket_stats')):
        bot.socket_stats = Counter()
    cog = Stats(bot)
    bot.add_cog(cog)
    bot._stats_cog_gateway_handler = handler = GatewayHandler(cog)
    logging.getLogger().addHandler(handler)
    commands.AutoShardedBot.on_error = on_error
def setup(bot):
    if (not hasattr(bot, 'command_stats')):
        bot.command_stats = Counter()
    if (not hasattr(bot, 'socket_stats')):
        bot.socket_stats = Counter()
    cog = Stats(bot)
    bot.add_cog(cog)
    bot._stats_cog_gateway_handler = handler = GatewayHandler(cog)
    logging.getLogger().addHandler(handler)
    commands.AutoShardedBot.on_error = on_error