Reputation: 66
I try to make a discord bot in c# with plugin d# and I have this error that shouldn't exist I watch a tutorial and I copy the code so it should work
public class Bot
{
public DiscordClient Client { get; private set; }
public CommandsNextConfiguration Commands { get; private set; }
public async Task RunAsync()
{
var config = new DiscordConfiguration
{
};
Client = new DiscordClient(config);
Client.Ready += OnClientReady;
var commandsConfig = new CommandsNextConfiguration
{
};
Commands = Client.UseCommandsNext(commandsConfig);
}
private Task OnClientReady(object sender, ReadyEventArgs e)
{
return null;
}
Upvotes: -2
Views: 513
Reputation: 11
Replace
Commands = Client.UseCommandsNext(commandsConfig);
with
CommandsNextExtension commandsNextExtension =
Client.UseCommandsNext(commandConfig);
Commands = commandsNextExtension;
This worked for me
Upvotes: 1
Reputation: 66
public CommandsNextConfiguration Commands { get; private set; } //not working
public CommandsNextExtension Commands { get; private set; } // is true its working
Upvotes: 1