Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Created July 13, 2019 08:54
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 Akkiesoft/985c983a6546233335a4ba73a58aeb1b to your computer and use it in GitHub Desktop.
Save Akkiesoft/985c983a6546233335a4ba73a58aeb1b to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_kumabokujo) do
command(
:mikutter_kumabokujo,
name: 'のぼりべつクマ牧場',
condition: lambda{ |opt| true },
visible: true,
role: :timeline
) do |opt|
opt.messages.each do |message|
Plugin.call(:kumabokujo, message, message.user.idname)
end
end
on_kumabokujo do | message, to_name |
greets = ["の!ぼ!り!べ!つ!","と言えば!?", "く!ま!ぼ!く!じょう!", "\クマボクジョ!!/",
"ユカイな仲間が〜?!", "たのしい仲間が〜!?", "Yeah!", "みんな待ってるぜぇ〜!", "ここは登別", "クマ牧場!!"]
n_msg = ""
msg = "@"+to_name + " "
while TRUE do
n_msg = greets.sample
break if msg.split(//).size + n_msg.split(//).size >= 140
msg += n_msg
end
world, = Plugin.filtering(:world_current, nil)
compose(world, message, body: msg)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment