0
현재 Cloud9에서 XMPP4R을 사용 중입니다. on_message 및 on_private_message
conference.on_message {|time, nick, text|
case text
when /regex/i
#Same Command as on_private_message
end
end
}
conference.on_private_message {|time,nick, text|
case text
when /regex/i
#Same Command as on_message
end
end
}
conference.on_message
conference.on_private_message
회의의 비공개 메시지 채팅입니다.
on_message와 on_private_message를 위에 표시된 2 대신 1로 기능하도록 만들고 싶습니다.
나는 (아래)와 같은 것을 시도했지만, 그것은 단지 conference.on_private_message
일했습니다. 어떻게하면 가능합니까?
(conference.on_message || conference.on_private_message) { |time, nick, text|
case text
when /regex/i
#Same Command on both on_message and on_private_message
end
end
}