After a while Bot can not read the message.
jaeyeon93 opened this issue · 0 comments
jaeyeon93 commented
Hi,
I'm making my custom slack-bot using jbot.
I have a two issue on jbot.
First,
When I start the server for the first time, the bot performs well. but After a while, Bot can not read the message, server running very well. bot can't.
I'm testfied my local server. same problem occur.
Second,
I'm used jbot as read my message,
when I send the message, jbot read twice, for example when I send "hello world" bot read "hello world" and " " one space.
How can I solve the this problem??... :(
This is my project source code : https://github.com/jaeyeon93/stock-crawler
@Controller(events = EventType.MESSAGE, pattern = "[^a-zA-Z\\d\\s:]")
public ResponseEntity<String> onReceiveMessage(WebSocketSession session, Event event, Matcher matcher) throws Exception {
String message = event.getText().toUpperCase();
logger.info("메세지 : {}", message);
if (message.contains("검색"))
return slackBotRepository.search(message.substring(message.indexOf(":")+1).trim(), event);
if (command.containsKey(message))
return slackBotRepository.requestCommand(message, event);
return slackBotRepository.reqeustCustomStock(message, event);
}
this is my controller code
Thank you for reading my article