Class: Ant::Bot::Message
- Inherits:
-
Object
- Object
- Ant::Bot::Message
- Defined in:
- lib/ant/bot/message.rb
Overview
Base implementation for messages from distinct providers
Direct Known Subclasses
Instance Method Summary collapse
-
#command? ⇒ Boolean
Returns true when the received message is a command.
-
#to_h ⇒ Object
Converts the messages into a hash.
Instance Method Details
#command? ⇒ Boolean
Returns true when the received message is a command. Convention states that messages should start with ‘/’ to be considered commands
20 21 22 |
# File 'lib/ant/bot/message.rb', line 20 def command? .start_with?('/') end |
#to_h ⇒ Object
Converts the messages into a hash
11 12 13 14 15 16 |
# File 'lib/ant/bot/message.rb', line 11 def to_h { text: , channel: channel_id } end |