Skip to content

Instantly share code, notes, and snippets.

@toshia
Created December 25, 2012 03:09
Show Gist options
  • Select an option

  • Save toshia/4371496 to your computer and use it in GitHub Desktop.

Select an option

Save toshia/4371496 to your computer and use it in GitHub Desktop.
ごぼう♡
Plugin.create :gobou do
UserConfig[:gobou_sign] ||= "♡"
UserConfig[:gobou_quantity] ||= 1
command(:gobou,
name: 'ごぼう',
condition: lambda{ |opt| !opt.messages.empty? and opt.messages.all? &:repliable? },
visible: true,
role: :timeline) do |opt|
opt.messages.each do |message|
UserConfig[:gobou_quantity].times do |c|
message.post message: "@#{message.user[:idname]} ごぼう#{UserConfig[:gobou_sign] * (c+1)}" end end end
settings "ごぼう" do
input "ごぼうの後の記号", :gobou_sign
adjustment "ごぼうの量", :gobou_quantity, 1, 3
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment