Add pmxbot command
This commit is contained in:
parent
f7ccbc5a35
commit
acdfbd6593
|
@ -1,3 +1,8 @@
|
||||||
|
1.4
|
||||||
|
===
|
||||||
|
|
||||||
|
Add pmxbot module and plugin, superseding pmxbot-wolframalpha package.
|
||||||
|
|
||||||
1.3
|
1.3
|
||||||
===
|
===
|
||||||
|
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -46,6 +46,9 @@ setup_params = dict(
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
|
'pmxbot_handlers': [
|
||||||
|
'Wolfram|Alpha = wolframalpha.pmxbot',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
10
wolframalpha/pmxbot.py
Normal file
10
wolframalpha/pmxbot.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from pmxbot.core import command
|
||||||
|
|
||||||
|
import wolframalpha
|
||||||
|
|
||||||
|
@command("wolframalpha", aliases=('wa',), doc="Wolfram Alpha rules")
|
||||||
|
def wa(client, event, channel, nick, rest):
|
||||||
|
client = wolframalpha.Client('Q59EW4-UEL27J79UK')
|
||||||
|
res = client.query(rest)
|
||||||
|
return next(res.results).text
|
Loading…
Reference in New Issue
Block a user