Class: Chatrix::Components::Messaging
- Inherits:
-
Object
- Object
- Chatrix::Components::Messaging
- Defined in:
- lib/chatrix/components/messaging.rb
Overview
Class to handle messaging actions for a room.
Instance Method Summary collapse
-
#initialize(room, matrix) ⇒ Messaging
constructor
Initializes a new Messaging instance.
-
#send_emote(message) ⇒ String
Sends an emote to the room.
-
#send_html(message, clean = nil) ⇒ String
Sends an HTML message to the room.
-
#send_message(message) ⇒ String
Sends a message to the room.
-
#send_notice(message) ⇒ String
Sends a notice to the room.
Constructor Details
#initialize(room, matrix) ⇒ Messaging
Initializes a new Messaging instance.
11 12 13 14 |
# File 'lib/chatrix/components/messaging.rb', line 11 def initialize(room, matrix) @room = room @matrix = matrix end |
Instance Method Details
#send_emote(message) ⇒ String
Sends an emote to the room.
33 34 35 |
# File 'lib/chatrix/components/messaging.rb', line 33 def send_emote() @matrix.rooms.actions. @room.id, , 'm.emote' end |
#send_html(message, clean = nil) ⇒ String
Sends an HTML message to the room.
43 44 45 |
# File 'lib/chatrix/components/messaging.rb', line 43 def send_html(, clean = nil) @matrix.rooms.actions.send_html @room.id, , clean end |
#send_message(message) ⇒ String
Sends a message to the room.
19 20 21 |
# File 'lib/chatrix/components/messaging.rb', line 19 def () @matrix.rooms.actions. @room.id, end |
#send_notice(message) ⇒ String
Sends a notice to the room.
26 27 28 |
# File 'lib/chatrix/components/messaging.rb', line 26 def send_notice() @matrix.rooms.actions. @room.id, , 'm.notice' end |