help.rb 749 B

1234567891011121314151617181920212223242526272829303132333435
  1. def all_commands(commands)
  2. fields = []
  3. commands.each do |command|
  4. fields.push({name: "pkmn-#{command.name}", value: command.description})
  5. end
  6. Embed.new(
  7. title: "Commands",
  8. description: "To learn more about any of the listed commands, use `pkmn-help [command]`",
  9. color: "#73FE49",
  10. fields: fields
  11. )
  12. end
  13. def command_usage(command)
  14. fields = []
  15. unless command.options.empty?
  16. usage = "```\n"
  17. command.options.each do |option|
  18. usage += "pkmn-#{command.name} #{option}\n"
  19. end
  20. usage += "```"
  21. end
  22. fields.push({name: "Usage", value: usage}) if command.options
  23. Embed.new(
  24. title: "pkmn-#{command.name}",
  25. description: command.description,
  26. color: "#73fe49",
  27. fields: fields
  28. )
  29. end