script/remember.rb in boty-0.0.14 vs script/remember.rb in boty-0.0.15
- old
+ new
@@ -1,18 +1,17 @@
desc I18n.t("scripts.remember.command"),
I18n.t("scripts.remember.desc", name: name)
-respond(/remember(:?) (.+)/i) do |message|
+command(/remember(:?) (.+)/i) do |_, stuff|
brain[:user] ||= {}
- brain[:user][message.user.name] ||= []
- brain[:user][message.user.name] << message.match[2]
+ brain[:user][user.name] ||= []
+ brain[:user][user.name] << stuff
im I18n.t("scripts.remember.response")
end
desc I18n.t("scripts.about.command"), I18n.t("scripts.about.desc")
-respond(/about (\w+\b)(:?) (.+)/i) do |message|
- user = message.match[3]
+command(/about (\w+\b)(:?) (.+)/i) do |brain_area, _, user_about|
im I18n.t "scripts.about.response",
- brain_area: message.match[1],
- user_asking: message.user.name,
- user_about: user
- brain[message.match[1].to_sym][user].each do |info| im info end
+ brain_area: brain_area,
+ user_asking: user.name,
+ user_about: user_about
+ brain[message.match[1].to_sym][user_about].each do |info| im info end
end