Copy to ClipboardCopied!Toggle word wrapToggle overflow
ovn BotLogic 은 일반 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 헤더가 메시지를 라우팅할 때).