Skip to content

Instantly share code, notes, and snippets.

@hizuru
Forked from penguin2716/ping_pong.rb
Created January 25, 2013 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hizuru/4632042 to your computer and use it in GitHub Desktop.
Save hizuru/4632042 to your computer and use it in GitHub Desktop.
#-*- coding: utf-8 -*-
Plugin.create :ping_pong do
on_appear do |ms|
ms.each do |m|
if m.message.to_s =~ /^@#{Service.primary.user.to_s} ping/
m.favorite
Service.primary.post :message => "@#{m.user.to_s} pong", :replyto => m.message
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment