Browse Source

lowercase command name

tags/v0.1
Ben Kurtovic 13 years ago
parent
commit
ddc9d9bf26
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      irc/commands/help.py
  2. +1
    -0
      irc/data.py

+ 1
- 1
irc/commands/help.py View File

@@ -41,7 +41,7 @@ class Help(BaseCommand):
commands = command_handler.get_commands() commands = command_handler.get_commands()


dummy = Data() # dummy message to test which command classes pick up this command dummy = Data() # dummy message to test which command classes pick up this command
dummy.command = command
dummy.command = command.lower() # lowercase command name
dummy.is_command = True dummy.is_command = True


for cmnd in commands: for cmnd in commands:


+ 1
- 0
irc/data.py View File

@@ -29,5 +29,6 @@ class Data(object):
if self.command.startswith('!') or self.command.startswith('.'): if self.command.startswith('!') or self.command.startswith('.'):
self.is_command = True self.is_command = True
self.command = self.command[1:] # strip '!' or '.' self.command = self.command[1:] # strip '!' or '.'
self.command = self.command.lower() # lowercase command name
except AttributeError: except AttributeError:
pass pass

Loading…
Cancel
Save