Ejemplo n.º 1
0
def generate_hook():
	global command_expression
	if command_expression is not None:
		bot.remove_command(command_expression)
	static_response.__doc__ = generate_docstring()
	command_expression = generate_expression()
	bot.add_command(command_expression, static_response)
Ejemplo n.º 2
0
def modify_commands(commands):
    bot.remove_command(generate_expression(storage.data["responses"]))
    storage.data["responses"] = {k.lower(): v for k, v in commands.items()}
    storage.save()
    static_response.__doc__ = generate_docstring()
    bot.add_command(generate_expression(storage.data["responses"]),
                    static_response)
Ejemplo n.º 3
0
def generate_hook():
    global command_expression
    if command_expression is not None:
        bot.remove_command(command_expression)
    static_response.__doc__ = generate_docstring()
    command_expression = generate_expression()
    bot.add_command(command_expression, static_response)
Ejemplo n.º 4
0
def modify_explanations(commands):
    bot.remove_command("explain " +
                       generate_expression(storage.data["explanations"]))
    storage.data["explanations"] = {k.lower(): v for k, v in commands.items()}
    storage.save()
    explain_response.__doc__ = generate_explain_docstring()
    bot.add_command(
        "explain " + generate_expression(storage.data["explanations"]),
        explain_response)
Ejemplo n.º 5
0
def modify_explanations(commands):
    bot.remove_command("explain " + generate_expression(storage.data["explanations"]))
    storage.data["explanations"] = {k.lower(): v for k,v in commands.items()}
    storage.save()
    explain_response.__doc__ = generate_explain_docstring()
    bot.add_command("explain " + generate_expression(storage.data["explanations"]), explain_response)
Ejemplo n.º 6
0
def modify_commands(commands):
    bot.remove_command(generate_expression(storage.data["responses"]))
    storage.data["responses"] = {k.lower(): v for k,v in commands.items()}
    storage.save()
    static_response.__doc__ = generate_docstring()
    bot.add_command(generate_expression(storage.data["responses"]), static_response)