Copy to ClipboardCopied!Toggle word wrapToggle overflow
ChatBotLogic 은 일반적인 String-to-String 메서드를 구현하는 간단한 빈입니다.
public class ChatBotLogic {
public String chatBotProcess(String message) {
if( "do-not-reply".equals(message) ) {
return null; // no response in the chat
}
return "echo from the bot: " + message; // echoes the message
}
}
public class ChatBotLogic {
public String chatBotProcess(String message) {
if( "do-not-reply".equals(message) ) {
return null; // no response in the chat
}
return "echo from the bot: " + message; // echoes the message
}
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow
chatBotProcess 메서드에서 반환된 모든 null 문자열은 요청을 시작한 채팅으로 자동 라우팅됩니다 ( CamelTelegramChatId 헤더는 메시지를 라우팅하는 데 사용됨).