コード例 #1
0
ファイル: rosetta.py プロジェクト: nbrochu/RosettaBot
def generate_help_content(bot_info):
    supported_commands = []

    for command, params in commands.items():
        supported_commands.append("*%s*: %s" % (params.get("usage").replace("$BOTNAME$", bot_info.get("user")), params.get("description")))

    sorted_supported_commands = sorted(supported_commands)

    return "\n".join(sorted_supported_commands)
コード例 #2
0
ファイル: rosetta.py プロジェクト: nbrochu/RosettaBot
def generate_help_content(bot_info):
    supported_commands = []

    for command, params in commands.items():
        supported_commands.append("*%s*: %s" % (params.get("usage").replace(
            "$BOTNAME$", bot_info.get("user")), params.get("description")))

    sorted_supported_commands = sorted(supported_commands)

    return "\n".join(sorted_supported_commands)
コード例 #3
0
ファイル: rosetta.py プロジェクト: nbrochu/RosettaBot
def fetch_command(message):
    for command, params in commands.items():
        if message.startswith("%s" % command):
            return params

    return None
コード例 #4
0
ファイル: rosetta.py プロジェクト: nbrochu/RosettaBot
def fetch_command(message):
    for command, params in commands.items():
        if message.startswith("%s" % command):
            return params

    return None