Ejemplo n.º 1
0
def command_for_self_exclude_error(client):
    input = {
        **default_command,
        "pick_list": ["<@1234|name>"],
        "weight_list": [1],
        "self_exclude": True,
    }
    command = create_and_return_command(**input)
    yield command
    Command.delete_command(command)
Ejemplo n.º 2
0
def command_with_no_active_users(client):
    input = {
        **default_command,
        "pick_list": ["<@4321|name>"],
        "weight_list": [1],
        "only_active_users": True,
    }
    command = create_and_return_command(**input)
    yield command
    Command.delete_command(command)
Ejemplo n.º 3
0
def delete_command_processor(
    *,
    channel_id: str,
    command_to_delete: str,
) -> dict[str, any]:
    command = Command.find_one_by_name_and_chanel(command_to_delete,
                                                  channel_id)
    Command.delete_command(command)

    message_content = f"Command {command_to_delete} successfully deleted."

    return {
        "message":
        Message(
            content=message_content,
            status=MessageStatus.INFO,
            visibility=MessageVisibility.NORMAL,
        )
    }
Ejemplo n.º 4
0
def basic_command(client):
    command = create_and_return_command(**default_command)
    yield command
    Command.delete_command(command)