소스 검색

More case insensitive.

Douglas William Thrift 14 년 전
부모
커밋
804183a476
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      locationbot.py

+ 3 - 4
locationbot.py

@@ -97,7 +97,7 @@ class LocationBot(ircbot.SingleServerIRCBot):
 		return _or(lambda channel: channel.has_user(nick), channels)
 
 	def __help(self, connection, nick, admin, login, arguments):
-		command = arguments.split(None, 1)[0].lstrip('!') if arguments else None
+		command = irclib.irc_lower(arguments.split(None, 1)[0].lstrip('!')) if arguments else None
 		commands = {
 			'help': ('[command]', 'show this help message'),
 			'login': ('[nick] [secret]', 'log in as nick with secret or using masks'),
@@ -292,7 +292,7 @@ class LocationBot(ircbot.SingleServerIRCBot):
 
 	def __unset(self, connection, nick, login, arguments):
 		try:
-			variable = arguments.split(None, 1)[0]
+			variable = irclib.irc_lower(arguments.split(None, 1)[0])
 		except IndexError:
 			return self.__help(connection, nick, False, login, 'unset')
 
@@ -372,8 +372,7 @@ class LocationBot(ircbot.SingleServerIRCBot):
 			command = event.arguments()[0].strip()
 			arguments = ''
 
-		if command.startswith('!'):
-			command = command[1:]
+		command = irclib.irc_lower(command.lstrip('!'))
 
 		if command == 'help':
 			self.__help(connection, nick, admin, login, arguments)