Use simpler syntax now supported by pmxbot.
This commit is contained in:
parent
21f4044ef1
commit
cff8e08013
|
@ -6,8 +6,13 @@ from pmxbot.core import command
|
||||||
|
|
||||||
import wolframalpha
|
import wolframalpha
|
||||||
|
|
||||||
@command("wolframalpha", aliases=('wa',), doc="Wolfram Alpha rules")
|
|
||||||
|
@command(aliases='wolframalpha')
|
||||||
def wa(client, event, channel, nick, rest):
|
def wa(client, event, channel, nick, rest):
|
||||||
|
"""
|
||||||
|
A free-text query resolver by Wolfram|Alpha. Returns the first
|
||||||
|
result, if available.
|
||||||
|
"""
|
||||||
client = wolframalpha.Client(pmxbot.config['Wolfram|Alpha API key'])
|
client = wolframalpha.Client(pmxbot.config['Wolfram|Alpha API key'])
|
||||||
res = client.query(rest)
|
res = client.query(rest)
|
||||||
return next(res.results).text
|
return next(res.results).text
|
||||||
|
|
Loading…
Reference in New Issue
Block a user