lib/ruboty/adapters/slack_rtm.rb in ruboty-slack_rtm-1.5.0 vs lib/ruboty/adapters/slack_rtm.rb in ruboty-slack_rtm-1.5.1
- old
+ new
@@ -149,11 +149,11 @@
end
"@#{name}"
end
- data['text'].gsub!(/\<!(?<special>[^>]+)\>/) do |_|
+ data['text'].gsub!(/\<!(?<special>[^>|@]+)(\|\@[^>]+)?\>/) do |_|
"@#{Regexp.last_match[:special]}"
end
data['text'].gsub!(/\<((?<link>[^>|]+)(?:\|(?<ref>[^>]*))?)\>/) do |_|
Regexp.last_match[:ref] || Regexp.last_match[:link]
@@ -187,10 +187,10 @@
end
msg
end
- text.gsub!(/@(?<special>(?:everyone|group|channel))/) do |_|
+ text.gsub!(/@(?<special>(?:everyone|group|channel|here))/) do |_|
"<!#{Regexp.last_match[:special]}>"
end
text.gsub!(/\#(?<room_id>[a-z0-9_-]+)/) do |_|
room_id = Regexp.last_match[:room_id]