Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ておくれなユーザを抽出するタブを作成するmikutterプラグイン
# -*- 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
---
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
You can’t perform that action at this time.