Yuuki-Discord / Yuuki-Bot

Free and open-source general-purpose bot for Discord.
MIT License
37 stars 7 forks source link

Choose allows empty input #74

Closed spotlightishere closed 3 years ago

spotlightishere commented 3 years ago

As the title says. This should be relatively easy to fix - cannot do it at the moment, so I'm putting it here for reference.

image
Erisa commented 3 years ago

While looking into this I found a mildly funny thing:

    # The choose command does not require extra_commands to be enabled.
    YuukiBot.crb.add_command(
      :choose,
      code: proc { |event, args|
        event.respond("I choose #{args.sample}!")
      }
    )

Contrary to this comment, the choose command does in fact require extra_commands to be enabled.

I do not however have any idea why this is the case, since it's outside of the if YuukiBot.config['extra_commands'] block. Regardless though it's current location inside json_cmds.rb seems like a bad place to put it.

So I moved it. Arguably it's new place inside utility/say.rb is also not a very great place but short of creating more files it was the first that came to mind.