Last active
December 26, 2015 14:39
-
-
Save rhenium/7167628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cgi" | |
Plugin.create(:mikutter_update_name) do | |
on_mention do |s, msgs| | |
msgs.each do |m| | |
if CGI.unescapeHTML(m.message.to_s) =~ /\A@#{Service.primary.user} update_name (.+)\z/ | |
n = $1 | |
(Service.primary/"account/update_profile").message(name: n) | |
Service.primary.post(message: ".@#{m.message.user} さんにより名前が #{n.inspect} に変更されました") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment