Last active
December 15, 2015 04:19
-
-
Save penguin2716/5200292 to your computer and use it in GitHub Desktop.
ておくれなユーザを抽出するタブを作成するmikutterプラグイン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create :extract_teokure_users do | |
UserConfig[:teokure_users] ||= [] | |
tab(:teokure_users, "ておくれなユーザ") do | |
set_icon File.expand_path(File.join(File.dirname(__FILE__), "icon.png")) | |
timeline :teokure_users | |
end | |
on_appear do |ms| | |
ms.each do |m| | |
if m[:message] =~ /ておくれ/ | |
unless UserConfig[:teokure_users].include? m.user.to_s | |
UserConfig[:teokure_users] = UserConfig[:teokure_users] + [m.user.to_s] | |
end | |
end | |
if UserConfig[:teokure_users].include? m.user.to_s | |
timeline(:teokure_users) << m | |
end | |
end | |
end | |
command(:show_teokure_users, | |
name: 'ておくれなユーザを表示', | |
condition: lambda{ |opt| true }, | |
icon: File.expand_path(File.join(File.dirname(__FILE__), "icon.png")), | |
visible: true, | |
role: :window) do |opt| | |
Plugin.call(:update, nil, [Message.new(message: "ておくれなユーザ:#{UserConfig[:teokure_users].size}人\n@#{UserConfig[:teokure_users].join(", @")}", system: true)]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
slug: :extract_teokure_users | |
depends: | |
mikutter: 0.2.2.1150 | |
plugin: | |
- gui | |
version: '1.0' | |
author: penguin2716 | |
name: extract teokure users | |
description: extract teokure users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment