'Cannot implicitly convert type 'DSharpPlus.CommandsNext.CommandsNextExtension' to 'DSharpPlus.CommandsNext.CommandsNextConfiguration'
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;
}
Solution 1:[1]
public CommandsNextConfiguration Commands { get; private set; } //not working
public CommandsNextExtension Commands { get; private set; } // is true its working
Solution 2:[2]
Replace
Commands = Client.UseCommandsNext(commandsConfig);
with
CommandsNextExtension commandsNextExtension =
Client.UseCommandsNext(commandConfig);
Commands = commandsNextExtension;
This worked for me
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | SzB |
Solution 2 | Kuro Neko |