Add pmxbot command

This commit is contained in:
Jason R. Coombs 2015-12-10 18:34:25 -05:00
parent f7ccbc5a35
commit acdfbd6593
3 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,8 @@
1.4
===
Add pmxbot module and plugin, superseding pmxbot-wolframalpha package.
1.3
===

View File

@ -46,6 +46,9 @@ setup_params = dict(
"Programming Language :: Python :: 3",
],
entry_points={
'pmxbot_handlers': [
'Wolfram|Alpha = wolframalpha.pmxbot',
],
},
)
if __name__ == '__main__':

10
wolframalpha/pmxbot.py Normal file
View 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