C#C
C#9mo ago
Malo

Can't access a function inside a class library

I'm trying to make a class library but I can't seem to access the function inside of it.
Here's the library:
c#
using DSharpPlus;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;

namespace DiscordLibrary;

public static class UsefulFunctions
{
    public static async Task CreateResponse(InteractionContext ctx, string message, bool isEphemeral)
    {
        var responseBuilder = new DiscordInteractionResponseBuilder().WithContent(message);
        if (isEphemeral)
            responseBuilder.AsEphemeral();
        await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, responseBuilder);
    }
}

Then I added a project reference to that inside another project and then referenced it with using DiscordLibrary;. However, I can't seem to access the CreateResponse function.
Was this page helpful?