Comments (7)
Hi,
You chain methods in a conversation so when a method is invoked then all the methods in the line to which it was chained would have been invoked already one after the other.
So, why you want to keep track of whats being said earlier. Can you please give a use case?
from jbot.
There are a lot of usecases... considering your example (scheduling a meeting), in a real project, I would probably create a Schedule object to handle the schedule and at each step of the conversation, I will update it so I need a way to retrieve it. So store it in the conversation as a cache would be simple.
Then, when fully populated, I may store it in a DB or whatever.
from jbot.
You can update your Schedule object inside each controller method. Why do you need to retrieve your conversation?
from jbot.
How do you retrieve the Schedule object ? They can be plenty.... so yes I implemented my own conversation class to store all stuff saved from a conversation between a bot and a user. But so now I have duplicate code...
@Controller(events = {EventType.DIRECT_MENTION, EventType.DIRECT_MESSAGE}, pattern = "create meeting", next = "setMeetingName")
public void createMeeting(WebSocketSession session, Event event)
{
startConversation(event, "setMeetingName"); // start conversation
Conversation conv = new Conversation(session.getId());
conversations.put(conv.getId(), conv);
reply(session, event, new Message("With pleasure, what's the meeting name ?"));
}
from jbot.
Nope. We can discuss further on gitter. That would be better I suppose.
from jbot.
What was the resolution for this issue? I'm having the same question here, but I couldn't find anything in the documentation and I can't join the gitter channel to search the discussion.
from jbot.
@sigrist You can follow a similar approach as @mboujonnier did. You can have an object to store session and pass it around the conversation methods.
from jbot.
Related Issues (20)
- Is there any guidance on how to use this for AWS Lambda? HOT 1
- Unescape text sent from JBot
- failed with the error "http_client_error" HOT 1
- /webhook is not exposed HOT 3
- jbot-example - SlackBot class Conversion bug HOT 1
- Websocket session closing HOT 4
- not working with if bot is created using slack application
- Slackbot does not function and I see that No web socket url returned by Slack HOT 3
- Slackbot is down with java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed HOT 11
- Error while extracting response for type [class me.ramswaroop.jbot.core.slack.models.Event]
- Not able to post replies HOT 1
- Persistent Menu
- Simple menu with slackBot
- How to get the email id of an user who is interacting with the bot in reply to slack?
- Recently slack bots using RTM api are not working and stops responding. An issue is raised to slack but no resolution yet since two weeks. Can you help with an example of slack socket mode app with spring boot? HOT 1
- Schedule Meeting time accepts any string. Needs time validation
- Chatbot is not working in your page HOT 1
- How to use jbot in a standalone application without spring boot
- Any interest in a PR that will bump to SpringBoot v2.7.6? HOT 3
- Reply in thread feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbot.