Skip to content
Snippets Groups Projects
Commit 2c881945 authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Standard response to lack of arguments

parent e46d6ebb
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,17 @@ class Unicode(BotPlugin): ...@@ -7,11 +7,17 @@ class Unicode(BotPlugin):
@botcmd @botcmd
def ord(self, message, args): def ord(self, message, args):
"""Runs ord() on the characters given""" """Runs ord() on the characters given"""
if not args:
return "**Usage**: !ord <characters>"
return [ord(c) for c in args] return [ord(c) for c in args]
@botcmd @botcmd
def chr(self, message, args): def chr(self, message, args):
"""Runs chr() on the numbers given""" """Runs chr() on the numbers given"""
if not args:
return "**Usage**: !chr <numbers>"
try: try:
return ''.join([chr(int(i)) for i in args.split()]) return ''.join([chr(int(i)) for i in args.split()])
except ValueError as e: except ValueError as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment