remove old code
parent
8598fdcf5e
commit
f444326cb0
|
@ -33,7 +33,7 @@ def c(phenny, input):
|
||||||
m = r_google_calc_exp.search(bytes)
|
m = r_google_calc_exp.search(bytes)
|
||||||
if not m:
|
if not m:
|
||||||
m = r_google_calc.search(bytes)
|
m = r_google_calc.search(bytes)
|
||||||
|
|
||||||
if not m:
|
if not m:
|
||||||
num = None
|
num = None
|
||||||
elif m.lastindex == 1:
|
elif m.lastindex == 1:
|
||||||
|
@ -42,34 +42,10 @@ def c(phenny, input):
|
||||||
num = "^".join((web.decode(m.group(1)), web.decode(m.group(2))))
|
num = "^".join((web.decode(m.group(1)), web.decode(m.group(2))))
|
||||||
|
|
||||||
if num:
|
if num:
|
||||||
|
num = num.replace('×', '*')
|
||||||
phenny.say(num)
|
phenny.say(num)
|
||||||
else:
|
else:
|
||||||
phenny.reply("Sorry, no result.")
|
phenny.reply("Sorry, no result.")
|
||||||
|
|
||||||
|
|
||||||
# def c(phenny, input):
|
|
||||||
# """DuckDuckGo calculator."""
|
|
||||||
# if not input.group(2):
|
|
||||||
# return phenny.reply("Nothing to calculate.")
|
|
||||||
# q = input.group(2)
|
|
||||||
#
|
|
||||||
# try:
|
|
||||||
# r = web.get(
|
|
||||||
# 'https://api.duckduckgo.com/?q={}&format=json&no_html=1'
|
|
||||||
# '&t=mutantmonkey/phenny'.format(web.quote(q)))
|
|
||||||
# except web.HTTPError:
|
|
||||||
# raise GrumbleError("Couldn't parse the result from DuckDuckGo.")
|
|
||||||
#
|
|
||||||
# data = web.json(r)
|
|
||||||
# if data['AnswerType'] == 'calc':
|
|
||||||
# answer = data['Answer'].split('=')[-1].strip()
|
|
||||||
# else:
|
|
||||||
# answer = None
|
|
||||||
#
|
|
||||||
# if answer:
|
|
||||||
# phenny.say(answer)
|
|
||||||
# else:
|
|
||||||
# phenny.reply('Sorry, no result.')
|
|
||||||
c.commands = ['c']
|
c.commands = ['c']
|
||||||
c.example = '.c 5 + 3'
|
c.example = '.c 5 + 3'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue