Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
えあふぁぼするmikutterプラグイン
# -*- coding: utf-8 -*-
Plugin.create(:airfav) do
def self.airfav(m)
Thread.new{
sleep(0.5 + rand(500) / 1000.0)
m.message.add_favorited_by(Post.primary_service.user_obj)
m.message.remove_favorited_by(Post.primary_service.user_obj)
}
end
add_event_filter(:command){ |menu|
menu[:airfav] = {
:slug => :airfav,
:name => 'えあふぁぼ',
:condition => lambda{ |m| m.message.favoritable? },
:exec => lambda{ |m| Gtk::TimeLine.get_active_mumbles.map(&:message).each{ |m| airfav(m)} },
:visible => true,
:role => :message }
[menu]
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment