lib/matrix_qq/qq/log.rb in matrix_qq-0.2.1 vs lib/matrix_qq/qq/log.rb in matrix_qq-0.3.0

- old
+ new

@@ -15,17 +15,13 @@ log_message sender, msg end def message(messages) messages.inject('') do |obj, msg| - obj + - case msg['type'] - when 'text' then msg['data']['text'] - when 'emoji' then [msg['data']['id'].to_i].pack 'U' - when 'face' then "[QQ 表情:#{msg['data']['id']}]" - when 'record' then '[语音]' - when 'image' then msg['data']['url'] - end + obj + case msg['type'] + when 'at' then "@#{user msg['data']['qq'], @info['group_id']} " + else QQ.cq_call msg + end end end def log_message(name, message) puts "#{name}: #{message}"