Module: MadChatter::Actions
- Included in:
- Extension, MessageListeners::ChannelCommands, MessageListeners::Code, MessageListeners::Image, MessageListeners::Nick, MessageListeners::Video
- Defined in:
- lib/mad_chatter/actions.rb
Instance Method Summary collapse
- #send_action(action, *args) ⇒ Object
- #send_message(text, from = nil) ⇒ Object
- #send_status_message(text) ⇒ Object
- #stop_message_handling ⇒ Object
Instance Method Details
#send_action(action, *args) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/mad_chatter/actions.rb', line 19 def send_action(action, *args) m = MadChatter::Message.new('action') m.json = {function: action, args: args} m.channel = @message.channel MadChatter.(m) end |
#send_message(text, from = nil) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/mad_chatter/actions.rb', line 8 def (text, from = nil) m = MadChatter::Message.new('message', text) m.username = from || @message.username m.channel = @message.channel MadChatter.(m) end |
#send_status_message(text) ⇒ Object
15 16 17 |
# File 'lib/mad_chatter/actions.rb', line 15 def (text) MadChatter. MadChatter::Message.new('status', text, nil, @message.channel) end |
#stop_message_handling ⇒ Object
4 5 6 |
# File 'lib/mad_chatter/actions.rb', line 4 def raise "Don't call any more message listeners" end |