Last active
December 21, 2015 21:28
-
-
Save oboenikui/6368115 to your computer and use it in GitHub Desktop.
mikutterで(っ'ハ'c)はわーりじゅ
This file contains hidden or 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 :khawarij do | |
@khawarij_text = "(っ'ハ'c)はわーりじゅ" | |
command(:khawarij, | |
name: 'はわーりじゅ', | |
condition: lambda{ |opt| true }, | |
visible: false, | |
role: :window) do |opt| | |
post_khawarij | |
end | |
#はわーりじゅをふぁぼ | |
#正規表現に一致すれば自動はわーりじゅ | |
on_appear do |ms| | |
ms.each do |m| | |
if m.message.to_s =~ /はわーりじゅ/ and m.user != Service.primary.user then | |
m.favorite | |
if m.message.to_s =~ /\s*[((]+\s*っ['’]ハ['’]c[))]+\s*はわーりじゅ\s*/ then | |
post_khawarij | |
end | |
end | |
end | |
end | |
def post_khawarij | |
Service.primary.post(:message => "#{@khawarij_text} #{" " * rand(10)}" ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment