소스 검색

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



불러오는 중...
취소
저장