foxbot / Discord.Addons.Interactive

add some interactivity to your commands 🙂
ISC License
73 stars 54 forks source link

Method not found: ....SendMessageAsync.... when calling any Function that sends messages in Chat #31

Closed TheKayneGame closed 3 years ago

TheKayneGame commented 3 years ago

I am struggling with the Interactive addon. If i run any of the Functions that uses the SendMessageAsync() Method it fails and the result.ErrorReason returns: Method` not found: 'System.Threading.Tasks.Task`1<Discord.Rest.RestUserMessage> Discord.WebSocket.ISocketMessageChannel.SendMessageAsync(System.String, Boolean, Discord.Embed, Discord.RequestOptions)'.

My Module class is defined as public class QuoteModule : InteractiveBase<SocketCommandContext> and i think im am setting up the Services correctly

                _services = new ServiceCollection()
                .AddSingleton(_client)
                .AddSingleton<InteractiveService>()
                .BuildServiceProvider();

            _commands = new CommandService();
            await _commands.AddModulesAsync(
                assembly: Assembly.GetEntryAssembly(),
                services: _services);

            _client.MessageReceived += HandleCommandAsync;
TheKayneGame commented 3 years ago

Fixed it. This build is not compatible withe the current discord.net i used a rebuild with the correct Dnet version. Discord.Extensions.Interactive from nuget. Thanks to the guys ate the discord API discord server