Merge branch 'master' of github.com:sbp/phenny
This commit is contained in:
@@ -69,6 +69,8 @@ calc.example = '.calc 5 + 3'
|
||||
|
||||
def c(phenny, input):
|
||||
"""Google calculator."""
|
||||
if not input.group(2):
|
||||
return phenny.reply("Nothing to calculate.")
|
||||
q = input.group(2).encode('utf-8')
|
||||
q = q.replace('\xcf\x95', 'phi') # utf-8 U+03D5
|
||||
q = q.replace('\xcf\x80', 'pi') # utf-8 U+03C0
|
||||
@@ -99,6 +101,8 @@ def py(phenny, input):
|
||||
py.commands = ['py']
|
||||
|
||||
def wa(phenny, input):
|
||||
if not input.group(2):
|
||||
return phenny.reply("No search term.")
|
||||
query = input.group(2).encode('utf-8')
|
||||
uri = 'http://tumbolia.appspot.com/wa/'
|
||||
answer = web.get(uri + web.urllib.quote(query))
|
||||
|
||||
Reference in New Issue
Block a user