瀏覽代碼

Capitalise replies in !crypt: !hash, !encrypt, !decrypt

tags/v0.1^2
Justin Yulli Kim 12 年之前
父節點
當前提交
3a2f423285
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. +5
    -5
      earwigbot/commands/crypt.py

+ 5
- 5
earwigbot/commands/crypt.py 查看文件

@@ -34,12 +34,12 @@ class Crypt(Command):

def process(self, data):
if data.command == "crypt":
msg = "available commands are !hash, !encrypt, and !decrypt."
msg = "Available commands are !hash, !encrypt, and !decrypt."
self.reply(data, msg)
return

if not data.args:
msg = "what do you want me to {0}?".format(data.command)
msg = "What do you want me to {0}?".format(data.command)
self.reply(data, msg)
return

@@ -47,14 +47,14 @@ class Crypt(Command):
algo = data.args[0]
if algo == "list":
algos = ', '.join(hashlib.algorithms)
msg = algos.join(("supported algorithms: ", "."))
msg = algos.join(("Supported algorithms: ", "."))
self.reply(data, msg)
elif algo in hashlib.algorithms:
string = ' '.join(data.args[1:])
result = getattr(hashlib, algo)(string).hexdigest()
self.reply(data, result)
else:
msg = "unknown algorithm: '{0}'.".format(algo)
msg = "Unknown algorithm: '{0}'.".format(algo)
self.reply(data, msg)

else:
@@ -62,7 +62,7 @@ class Crypt(Command):
text = " ".join(data.args[1:])

if not text:
msg = "a key was provided, but text to {0} was not."
msg = "A key was provided, but text to {0} was not."
self.reply(data, msg.format(data.command))
return



Loading…
取消
儲存