def strip_bot_tag(text, bot_tag):
    """Helper to strip the bot tag out of the message"""
    # split on bot tag, strip trailing whitespace, join non-empty with space
    return " ".join([t.strip() for t in text.split(bot_tag) if t])