Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Last active October 29, 2016 09:28
Show Gist options
  • Select an option

  • Save jacoyutorius/08d6c7858d0eb66ef952f7e0ba2de8b5 to your computer and use it in GitHub Desktop.

Select an option

Save jacoyutorius/08d6c7858d0eb66ef952f7e0ba2de8b5 to your computer and use it in GitHub Desktop.
module Ruboty
module Handlers
class RamenPolice < Base
on(/.*(hi|profile|名前|自己紹介|).*/, name: :profile, description: "名乗る")
on(/.*(麺|めん|面|免|綿).*/, name: :examine, description: "ラーメン食べたか聞いてくる ", all: true)
on(/.*(rand|random).*/, name: :random, description: "ランダムにラーメン店を教える")
on(/.*map*./, name: :map, description: "地図")
def profile message
message.reply("ラーメン警察です")
end
def examine message
msg = [
"ラーメン、食べましたね?",
"ラーメン? 食べよう。"
].sample
message.reply(msg)
end
def random message
shop = shop_list.sample
message.reply("「#{shop[:name]}」(#{shop[:url]})")
end
def map message
msg = "https://www.google.co.jp/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=%E6%B5%9C%E6%9D%BE+%E3%83%A9%E3%83%BC%E3%83%A1%E3%83%B3&rflfq=1&rlha=0&rllag=34730274,137740237,1735&tbm=lcl&tbs=lf:1,lf_ui:4,lf_pqs:EAE"
message.reply(msg)
end
private
def shop_list
[
{name: "一蘭 浜松店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000835080/"},
{name: "青空きっど 零", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000202697/"},
{name: "らーめん武蔵", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000003321/"},
{name: "麺屋めん虎浜松店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000759558/"},
{name: "龍の子", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000821754/"},
{name: "麺屋 なかの", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001282011/"},
{name: "らぁめん ひいらぎ", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001276206/"},
{name: "ホームラン軒", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000854003/"},
{name: "らーめん 豚鬼", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001276432/"},
{name: "丸源ラーメン浜松住吉店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000795515/"},
{name: "らーめん 奉仕丸", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000087782/"},
{name: "麺匠 独眼流", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001264514/"},
{name: "東留 本店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000718488/"},
{name: "麺屋 龍壽", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001285064/"},
{name: "中華そば 浪花", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001285428/"},
{name: "浜笑", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000875452/"},
{name: "来来亭浜松幸店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000532495/"},
{name: "麺屋はやたろう原島店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000534092/"},
{name: "みかたがはら食堂", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000834864/"},
{name: "ラーメン飛聖", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000883289/"},
{name: "麺匠家", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001204642/"},
{name: "歌志軒 浜松幸店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001234599/"},
{name: "7福神 壱", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001253148/"},
{name: "一刻魁堂浜松ささがせ店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000534066/"},
{name: "えびす", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000534067/"},
{name: "麺屋三郎", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001200464/"},
{name: "麺屋 山彦", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000914579/"},
{name: "情熱タンタン麺 あっぱれ屋 有玉", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000881680/"},
{name: "栄福", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000044083/"},
{name: "横浜飯店", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001160940/"},
{name: "川龍", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001209638/"},
{name: "浜太郎", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100000807317/"},
{name: "麺屋 海老蔵", url: "https://retty.me/area/PRE22/ARE79/SUB33304/100001281064/"},
]
end
end
end
end
Gem::Specification.new do |spec|
spec.name = "ruboty-ramen-police"
spec.version = "0.0.1"
spec.authors = ["Yuto Ogi"]
spec.email = ["[email protected]"]
spec.summary = "ramen poice"
spec.files = ["ramen-police.rb"]
spec.require_path = "."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment