from gather.organiser import NotEnoughPlayersError


def strip_help(bot):
    messages = []

    for regex, action in bot.actions.values():
        if action.__doc__:
            messages.append(action.__doc__.strip())
    return messages


async def bot_help(bot, channel, author, message):
    await bot.say_lines(channel, strip_help(bot))


async def add(bot, channel, author, message):
    """
     - !add, !s - add yourself to the pool
    """
    bot.organiser.add(channel, author)
    await bot.say(channel, 'You are now signed in, {0}.'.format(author))
    # Add cooldown in so this will not post more than every five seconds or so
    await bot.announce_players(channel)

    try:
        team_one, team_two = bot.organiser.pop_teams(channel)
        # TODO: Announce the game
    except NotEnoughPlayersError:
        pass


async def remove(bot, channel, author, message):
    """
     - !remove, !so - remove yourself from the pool
    """
    bot.organiser.remove(channel, author)
    await bot.say(channel, 'You are now signed out, {0}.'.format(author))

from gather.organiser import NotEnoughPlayersError


def strip_help(bot):
    messages = []

    for regex, action in bot.actions.values():
        if action.__doc__:
            messages.append(action.__doc__.strip())
    return messages


async def bot_help(bot, channel, author, message):
    await bot.say_lines(channel, strip_help(bot))


async def add(bot, channel, author, message):
    """
     - !add, !s - add yourself to the pool
    """
    bot.organiser.add(channel, author)
    await bot.say(channel, 'You are now signed in, {0}.'.format(author))
    # Add cooldown in so this will not post more than every five seconds or so
    await bot.announce_players(channel)

    try:
        team_one, team_two = bot.organiser.pop_teams(channel)
        # TODO: Announce the game
    except NotEnoughPlayersError:
        pass


async def remove(bot, channel, author, message):
    """
     - !remove, !so - remove yourself from the pool
    """
    bot.organiser.remove(channel, author)
    await bot.say(channel, 'You are now signed out, {0}.'.format(author))
    # Add cooldown in so this will not post more than every five seconds or so
    await bot.announce_players(channel)

Print players on remove too
Print players on remove too
