-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatch_failled, can't manage to use commands #179
Comments
Edit:
But same error |
Thanks for the question, @Dabendorf. The best bet here is to let SlackNet handle the slash command request for you, rather than setting up your own route. SlackNet sets up its own endpoints, so you can tell Slack to send all slash command requests to If you go down the socket mode route, then make sure you enable socket mode on your Slack app, which will remove the need to specify any URLs for handling slash commands etc. Hope that helps. |
Hi, My class looks like this:
Its not the final code, its just for testing purpose. I tried to do anything, sending /echo, /echo with text, any other command. It just doesn't happen anything. Also the printing does not happen and in debugging, I never get into the Handle method. So I think something is wrong there I guess. My Program.cs looks like that:
I tested like literally every configuration (except the one who will work, haha). |
I think the problem here is that you've configured SlackNet with a I'd suggest resolving the socket mode client from the var serviceProvider = serviceCollection.BuildServiceProvider();
var client = serviceProvider.SlackServices().GetSocketModeClient(); That way the socket mode client will get the configuration from the |
Hey, |
Hmm odd. var client = serviceProvider.GetRequiredService<ISlackSocketModeClient>(); As for the "additional copy of singleton services" warning, it looks like that warning shows up when you use |
Oops finger slipped. If you're not going to use ASP.NET, then change the top of your project file from: <Project Sdk="Microsoft.NET.Sdk.Web"> to <Project Sdk="Microsoft.NET.Sdk"> and the warning on |
Thank you very much for you answering here, that helps a lot!
When I use it locally, I do not have any output whatsover. The bot just don't react to anything. If I push it into production and run it there, then I get the old dispatch failed messages for literally every command I defined. I personally always wondered how the SlashCommands class actually knows which command I use? Is the handler for all commands? Maybe that is my problem.
But I don't know. Its just weird that I cannot debug it properly |
Interesting fact: your PingHandler demo works perfectly in my programme, its just the slash commands failing |
Running your code, I got an error constructing serviceCollection.AddSingleton<IConfiguration>(settings); (make sure to include the generic argument, because Only other things I can think of would be to double-check that the slash command you've set up in your Slack app exactly matches what's being registered with SlackNet, and that it's the only app you have with that slash command. Hope that helps. |
Hey |
I might not be the first asking this, but I am just entirely failing to use slack commands, while the rest of this amazing framework works.
I set up a slack command /echo routing to https://mywebsite.net/Slack/echo/slack/command
The code is the following:
I literally tried everything. Changing the route, changing the body, having other arguments, literally everything I do gets me to "/echo failed with the error dispatch_failed".
I used this as manual: https://github.com/soxtoby/SlackNet/tree/master/Examples/SlackNetDemo
Anything obvious I did wrong here? I tested the URL, it is in fact existing
The text was updated successfully, but these errors were encountered: