Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ふぁぼれなかったら非公式ふぁぼ飛ばすmikutterプラグイン
# -*- coding: utf-8 -*-
Plugin.create(:altfav) do
def self.altfav(m)
if Post.primary_service.twitter.favorite(m.message.id).code != '200' then
Post.primary_service.update(:message => "@#{m.message.user.to_s}#{" " * rand(40)}", :replyto => m.message)
end
end
add_event_filter(:command){ |menu|
menu[:altfav] = {
:slug => :altfav,
:name => 'ふぁぼ/非公式ふぁぼ',
:condition => lambda{ |m| m.message.favoritable? },
:exec => lambda{ |m| Gtk::TimeLine.get_active_mumbles.map(&:message).each{ |m| altfav(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