© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
10 replies
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:
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);
    }
}
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;
using DiscordLibrary;
. However, I can't seem to access the
CreateResponse
CreateResponse
function.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ I can't reference a class library please help
C#CC# / help
4y ago
❔ Why can't I reinitialize an object inside a function?
C#CC# / help
3y ago
Foreach loop inside List<T> class
C#CC# / help
3y ago