コード例 #1
0
def test_type_user_valid_uppercase(discord, client):
    @discord.command(name="TEST USER", type=ApplicationCommandType.USER)
    def fn(ctx, user):
        return "hi user"

    assert client.run("TEST USER").content == "hi user"
コード例 #2
0
def test_type_message_valid_uppercase(discord, client):
    @discord.command(name="TEST MSG", type=ApplicationCommandType.MESSAGE)
    def fn(ctx, message):
        return "message"

    assert client.run("TEST MSG").content == "message"
コード例 #3
0
def test_provided_name(discord, client):
    @discord.command(name="other")
    def fn(ctx):
        return "hi"

    assert client.run("other").content == "hi"