lib/matrix_qq/qq/send.rb in matrix_qq-0.3.1 vs lib/matrix_qq/qq/send.rb in matrix_qq-0.3.2

- old
+ new

@@ -3,12 +3,20 @@ module SendGroup def self.raw(dbus, room_id, body) dbus.send_group_msg group_id: room_id, message: body end + def self.array(dbus, room_id, message) + return if message.nil? + return unless message.is_a? Array + return if message.empty? + raw dbus, room_id, message + end + def self.text(dbus, room_id, message) return if message.nil? - raw dbus, room_id, [message] + return unless message.is_a? String + raw dbus, room_id, message end end # Send end # Matrix end