Skip to content

Instantly share code, notes, and snippets.

@oboenikui
Last active December 21, 2015 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oboenikui/6368115 to your computer and use it in GitHub Desktop.
Save oboenikui/6368115 to your computer and use it in GitHub Desktop.
mikutterで(っ'ハ'c)はわーりじゅ
# -*- 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