Skip to content

Instantly share code, notes, and snippets.

@firstspring1845
Last active August 29, 2015 14:03
Show Gist options
  • Save firstspring1845/d6d72735dc52adc908ea to your computer and use it in GitHub Desktop.
Save firstspring1845/d6d72735dc52adc908ea to your computer and use it in GitHub Desktop.
ブロックを使わないといけないツイッターつらい
# -*- coding: utf-8 -*-
Plugin.create :block do
command(:block,
name: 'ブロックする',
condition: Plugin::Command::CanReplyAll,
visible: true,
icon: nil,
role: :timeline) do |opt|
user = opt.messages.first.user
if ::Gtk::Dialog.confirm("@#{user[:idname]}をブロックしますよ、本当にいいんですか?")
if ::Gtk::Dialog.confirm("取り返しが付かないですがよろしいですね?")
(Service.primary.twitter/'blocks/create').json(:screen_name => user[:idname])
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment