Fix to load commands code #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the bot works by loading commands that are in folder
src/commands. But after a certain amount of files it can be overwhelming to read.This opens the possibility of folders inside
commandsfolder (src/commands/economy,src/commands/testing).Therefore, the current code can fail upon loading commands.
A fix should be made to load commands either from
commandsfolder and its subfoldersCommands folder can fail if folders are created inside itto Fix to load commands codeFixed by updating the Dir lookup.
Dir["#{File.dirname(__FILE__)}/commands/**/*.rb"].eachThis looks for
.rbfiles insidesrc/commandsandsrc/commands/subfolder.