Fixed szt's incompetence

This commit is contained in:
mrhanky 2017-08-22 15:08:33 +02:00
parent c5e223a03f
commit f8d80c3177
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -329,11 +329,11 @@ class Useless(DatabasePlugin):
def halfwidth(self, mask: IrcString, target: IrcString, args: DocOptDict):
"""Turns UPPERCASE words into halfwidth characters
%%halfwidth <text>
%%halfwidth <text>...
"""
def halfwidth_replace(match):
return "".join(chr(0xFF20+(ord(c)-64)) for c in match.group(0))
return "[HALFWIDTH] {}".format(re.sub(r'(?:\b)[A-Z]+(?:\b)', halfwidth_replace, args.get('<word>')))
return ''.join(chr(0xFF20 + (ord(c) - 64)) for c in match.group(0))
return '[HALFWIDTH] {}'.format(re.sub(r'(?:\b)[A-Z]+(?:\b)', halfwidth_replace, ' '.join(args['<text>'])))
@command
def asshole(self, mask: IrcString, target: IrcString, args: DocOptDict):