summaryrefslogtreecommitdiff
path: root/bot.lua
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-09-13 17:16:59 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-09-13 17:16:59 +0200
commit008e302ea3ee1055cd624c9ad645b981b0271822 (patch)
tree25cf87431c180bfc7f24239bd7ff5fce9e31b4d5 /bot.lua
parentb846ef0a0aa0b0c27ba15026ae0eaac9664080ba (diff)
downloadfurrybot-008e302ea3ee1055cd624c9ad645b981b0271822.tar.xz
Add book command and sort help command output alphabethically
Diffstat (limited to 'bot.lua')
-rw-r--r--bot.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/bot.lua b/bot.lua
index 16b872f..447ca65 100644
--- a/bot.lua
+++ b/bot.lua
@@ -162,11 +162,15 @@ end
-- General purpose commands
function furrybot.commands.help()
- local keys = {}
- for k in pairs(furrybot.commands) do
- table.insert(keys, k)
+ local commands = {}
+
+ for cmd in pairs(furrybot.commands) do
+ table.insert(commands, cmd)
end
- furrybot.send("Available commands: " .. table.concat(keys, ", "), furrybot.colors.system)
+
+ table.sort(commands)
+
+ furrybot.send("Available commands: " .. table.concat(commands, ", "), furrybot.colors.system)
end
function furrybot.commands.accept(name)