Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created December 18, 2009 12:25
Show Gist options
  • Save eagletmt/259467 to your computer and use it in GitHub Desktop.
Save eagletmt/259467 to your computer and use it in GitHub Desktop.
# TypableMap: 公式RT
Misuzilla::IronRuby::TypableMap.register("rt", "ReTweet Command") do |p, msg, status, args|
System::Diagnostics::Trace.WriteLine("RT: #{status.to_string}")
Session.RunCheck(Misuzilla::Applications::TwitterIrcGateway::Procedure.new{
Session.twitter_service.POST("/statuses/retweet/#{status.id}.xml", System::Array[System::Byte].new(0))
Session.send_channel_message("RT: #{status.text}")
}, System::Action[System::Exception].new{|ex|
Session.send_channel_message(msg.receiver, Server.server_nick, "メッセージ送信に失敗しました", false, false, true)
})
true # true を返すとハンドルしたことになりステータス更新処理は行われない
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment