question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Start a new conversation with SlackBot without creating a new channel

See original GitHub issue

I’ve uploaded the AnnotatedSandwich sample to my own Azure app service and successfully added the Slack connector so I can order sandwiches through a Slack channel… so far so good!

However, after I’ve completed the dialog once on my channel, the bot doesn’t respond in the channel anymore and I can’t reset it.

I’m aware that a new conversationId is required to kick start a new dialog, however it appears conversationId is always set to the channel name which means I can only start a new dialog if I start a new channel.

https://github.com/Microsoft/BotBuilder/blob/master/Node/src/bots/SlackBot.ts#L339

     private fromSlackMessage(msg: ISlackMessage): IMessage { 
331         return { 
332             type: msg.type, 
333             id: msg.ts, 
334             text: msg.text, 
335             from: { 
336                 channelId: 'slack', 
337                 address: msg.user 
338             }, 
339             channelConversationId: msg.channel, 
340             channelData: msg 
341         }; 
342     } 
343  

Is this by design? Are there other ways to kick start a dialog without creating a new channel (which is a hassle)?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
StephenTung-CRcommented, Apr 7, 2016

Just for everyone’s info, I ended up adding a hack to reset the DialogState in the controller @willportnoy suggested:

        public async Task<Message> Post([FromBody]Message message)
        {
            if (message.Type == "Message")
            {
                // dirty hack for now
                if (message.Text.ToLowerInvariant() == "reset")
                {
                    message.BotPerUserInConversationData = null;
                }

                return await Conversation.SendAsync(message, MakeRootDialog);
            }
            else
            {
                return HandleSystemMessage(message);
            }
        }
1reaction
Steveniccommented, Apr 6, 2016

Oh I see… You’re using C# 😃 I’ll get one of the C# guys to help you out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start a new conversation with SlackBot without creating a new ...
Add a Slack connector to the bot; Invite the bot to a slack channel; Start a dialog with the bot about sandwiches .....
Read more >
conversations.create method - Slack API
Create a public or private channel using this Conversations API method. Use conversations.open to initiate or resume a direct message or multi-person direct ......
Read more >
how to build your own Slack bot - Zapier
Here's how to build your own chat bot without coding. ... Send Slack channel messages for new Google Calendar events.
Read more >
How to Create a Slack Chatbot in 2022 (No Coding Required)
In this video, I will show you how you can create a Slack Chatbot and automatically reply to messages in Slack, without writing...
Read more >
How to message several people with a slack bot without a ...
The easiest way to talk privately with a user is to send a direct message by using the user ID as channel in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found