Skip to content

Instantly share code, notes, and snippets.

@rhenium
Last active December 26, 2015 14:39
Show Gist options
  • Save rhenium/7167628 to your computer and use it in GitHub Desktop.
Save rhenium/7167628 to your computer and use it in GitHub Desktop.
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