hubotio / hubot

A customizable life embetterment robot.
https://hubotio.github.io/hubot/
MIT License
16.66k stars 3.75k forks source link

Doubled options and responses #358

Closed gabebw closed 12 years ago

gabebw commented 12 years ago

I see doubled options in hubot help (pasted below) as well as doubled responses: hubot bees pastes the Oprah bees gif twice, for example.

alot - Shows a picture of an alot
alot - Shows a picture of an alot
hubot <user> is a badass guitarist - assign a role to a user
hubot <user> is not a badass guitarist - remove a role from a user
hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
hubot bees - Oprah at her finest, or a good way to turn the fans on coworkers machines
hubot bees - Oprah at her finest, or a good way to turn the fans on coworkers machines
hubot buscemi me <query> - Searches Google Images for the specified query and buscemi's it
hubot buscemi me <query> - Searches Google Images for the specified query and buscemi's it
hubot buscemi me <url> - Adds Steve Buscemi eyes to the specified URL
hubot buscemi me <url> - Adds Steve Buscemi eyes to the specified URL
hubot c <input>
hubot c <input>
hubot chat - Tell hubot to make something fun to chat about
hubot chat - Tell hubot to make something fun to chat about
hubot cheer me up - A little pick me up
hubot cheer me up - A little pick me up
hubot clark <data> - build sparklines out of data
hubot clark <data> - build sparklines out of data
hubot convert me <expression> to <units> - Convert expression to given units.
hubot die - End hubot process
hubot echo <text> - Reply back with <text>
hubot help - Displays all of the help commands that Hubot knows about.
hubot help <query> - Displays all help commands that match <query>.
hubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
hubot map me <query> - Returns a map view of the area returned by `query`.
hubot math me <expression> - Calculate the given expression.
hubot mustache me <query> - Searches Google Images for the specified query and mustaches it.
hubot mustache me <url> - Adds a mustache to the specified URL.
hubot ping - Reply with pong
hubot pug bomb N - get N pugs
hubot pug me - Receive a pug
hubot show storage - Display the contents that are persisted in the brain
hubot show users - Display all users that hubot knows about
hubot the rules - Make sure hubot still knows the rules.
hubot time - Reply with current time
hubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
hubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
hubot which do you prefer: <thing> or <thing> [.. or <thing>]?
hubot which do you prefer: <thing> or <thing> [.. or <thing>]?
hubot who is <user> - see what roles a user has
hubot youtube me <query> - Searches YouTube for the query and returns the video embed link.
like an adult - Display a hyperbole and a half image
like an adult - Display a hyperbole and a half image
trap - Display an Admiral Ackbar piece of wonder
trap - Display an Admiral Ackbar piece of wonder

hubot-scripts.json:

[
  "ackbar.coffee",
  "adult.coffee",
  "alot.coffee",
  "archer.coffee",
  "bees.coffee",
  "buscemi.coffee",
  "chat.coffee",
  "cheer.coffee",
  "clark.coffee",
  "cleverbot.coffee",
  "which-do-you-prefer.coffee"
]
captn3m0 commented 12 years ago

Which adapter are you using? We are facing similar issue on the partychat adapter. See https://github.com/iangreenleaf/hubot-partychat-hooks/pull/5 for more info.

gabebw commented 12 years ago

We're using the Campfire adapter - haven't changed any code, only added to hubot-scripts.json and package.json, and of course added to the scripts/ directory.

captn3m0 commented 12 years ago

Our source is at https://github.com/sdslabs/bot. We're using v2.3.2 of hubot, for reference.

technicalpickles commented 12 years ago

I see the problem. For a given hubot-script, you need to only have it listed in hubot-scripts.json or have a copy of it in scripts. It looks like you do both, so the script gets loaded twice.

On Oct 22, 2012, at 12:59 AM, Abhay Rana notifications@github.com wrote:

Our source is at https://github.com/sdslabs/bot. We're using v2.3.2 of hubot, for reference.

— Reply to this email directly or view it on GitHub.

gabebw commented 12 years ago

I changed hubot-scripts.json to only contain an empty array and kept the scripts in scripts/, which fixed it. Thanks @technicalpickles.

technicalpickles commented 12 years ago

Cool, glad that did it. Unless you've customized the scripts, I would actually suggest the other way around. That way, you only have your custom scripts in scripts/, and you get any updates from hubot-scripts by just updating that dependency.

On Oct 22, 2012, at 10:09 AM, Gabe Berke-Williams notifications@github.com wrote:

I changed hubot-scripts.json to only contain an empty array and kept the scripts in scripts/, which fixed it. Thanks @technicalpickles.

— Reply to this email directly or view it on GitHub.

gabebw commented 12 years ago

So - can I have my scripts/ directory be totally empty, and keep just the names in hubot-scripts.json?

I tried it, but I got this error: Error: Cannot find module '/Users/gabe/thoughtbot/hideout-bot/node_modules/hubot-scripts/src/scripts/google-images'

technicalpickles commented 12 years ago

Not totally empty, but you can remove anything that is listed in hubot-scripts.json. I think google-images would be one of the ones not in scripts/

On Oct 22, 2012, at 10:22 AM, Gabe Berke-Williams notifications@github.com wrote:

So - can I have my scripts/ directory be totally empty, and keep just the names in hubot-scripts.json?

I tried it, but I got this error: Error: Cannot find module '/Users/gabe/thoughtbot/hideout-bot/node_modules/hubot-scripts/src/scripts/google-images'

— Reply to this email directly or view it on GitHub.