Malo
Malo
CC#
Created by Malo on 3/30/2025 in #help
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);
}
}
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.
11 replies
CC#
Created by Malo on 2/20/2024 in #help
Word getting cut off because string is longer than the console
No description
17 replies