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
}