Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #59314 > unrolled thread
| Started by | Matt Graves <tunacubes@gmail.com> |
|---|---|
| First post | 2013-11-13 08:12 -0800 |
| Last post | 2013-11-13 16:56 +0000 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.lang.python
Jabberbot Matt Graves <tunacubes@gmail.com> - 2013-11-13 08:12 -0800
Re: Jabberbot Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-13 16:32 +0000
Re: Jabberbot Matt Graves <tunacubes@gmail.com> - 2013-11-13 08:42 -0800
Re: Jabberbot Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-13 16:56 +0000
| From | Matt Graves <tunacubes@gmail.com> |
|---|---|
| Date | 2013-11-13 08:12 -0800 |
| Subject | Jabberbot |
| Message-ID | <dbc0ba08-2119-42fc-88e9-93601b47d72a@googlegroups.com> |
I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library?
This is basically the only example given:
-------------------------
from jabberbot import JabberBot, botcmd
import datetime
class SystemInfoJabberBot(JabberBot):
@botcmd
def serverinfo( self, mess, args):
"""Displays information about the server"""
version = open('/proc/version').read().strip()
loadavg = open('/proc/loadavg').read().strip()
return '%s\n\n%s' % ( version, loadavg, )
@botcmd
def time( self, mess, args):
"""Displays current server time"""
return str(datetime.datetime.now())
@botcmd
def rot13( self, mess, args):
"""Returns passed arguments rot13'ed"""
return args.encode('rot13')
@botcmd
def whoami(self, mess, args):
"""Tells you your username"""
return mess.getFrom().getStripped()
username = 'xxxxxx@xxxx.xxxx.com'
password = 'xxxxx'
bot = SystemInfoJabberBot(username,password)
bot.serve_forever()
-------------------------
I cannot figure out how I would have it simulate a conversation. For example, if I added
@botcmd
def Hello(self, mess, args):
return "Hi, how are you?"
how would I get it to carry on from here? To look for different answers to the response that was returned. Any bit of information would be appreciated.
[toc] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-11-13 16:32 +0000 |
| Message-ID | <mailman.2540.1384360362.18130.python-list@python.org> |
| In reply to | #59314 |
On 13/11/2013 16:12, Matt Graves wrote: > I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library? > [snip code from http://thp.io/2007/python-jabberbot/] > I cannot figure out how I would have it simulate a conversation. For example, if I added > > @botcmd > def Hello(self, mess, args): > return "Hi, how are you?" > > how would I get it to carry on from here? To look for different answers to the response that was returned. Any bit of information would be appreciated. > From the link above "More examples Starting with version 0.7, more examples can be found in the examples/ subdirectory of the source distribution." Have you looked at these? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Matt Graves <tunacubes@gmail.com> |
|---|---|
| Date | 2013-11-13 08:42 -0800 |
| Message-ID | <a4002fe5-74e8-4f63-8d8a-51a87af19ea7@googlegroups.com> |
| In reply to | #59316 |
On Wednesday, November 13, 2013 11:32:24 AM UTC-5, Mark Lawrence wrote: > On 13/11/2013 16:12, Matt Graves wrote: > > > I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library? > > > > > > > [snip code from http://thp.io/2007/python-jabberbot/] > > > > > I cannot figure out how I would have it simulate a conversation. For example, if I added > > > > > > @botcmd > > > def Hello(self, mess, args): > > > return "Hi, how are you?" > > > > > > how would I get it to carry on from here? To look for different answers to the response that was returned. Any bit of information would be appreciated. > > > > > > > From the link above "More examples > > > > Starting with version 0.7, more examples can be found in the examples/ > > subdirectory of the source distribution." > > > > Have you looked at these? > > > > -- > > Python is the second best programming language in the world. > > But the best has yet to be invented. Christian Tismer > > > > Mark Lawrence I have, but unfortunately they are about just as clear as the example I posted. The examples they posted are relevant for certain things, but not what I'm looking to do.
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-11-13 16:56 +0000 |
| Message-ID | <mailman.2541.1384361791.18130.python-list@python.org> |
| In reply to | #59318 |
On 13/11/2013 16:42, Matt Graves wrote: > On Wednesday, November 13, 2013 11:32:24 AM UTC-5, Mark Lawrence wrote: >> On 13/11/2013 16:12, Matt Graves wrote: >> >>> I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library? >> >>> >> >> >> >> [snip code from http://thp.io/2007/python-jabberbot/] >> >> >> >>> I cannot figure out how I would have it simulate a conversation. For example, if I added >> >>> >> >>> @botcmd >> >>> def Hello(self, mess, args): >> >>> return "Hi, how are you?" >> >>> >> >>> how would I get it to carry on from here? To look for different answers to the response that was returned. Any bit of information would be appreciated. >> >>> >> >> >> >> From the link above "More examples >> >> >> >> Starting with version 0.7, more examples can be found in the examples/ >> >> subdirectory of the source distribution." >> >> >> >> Have you looked at these? >> >> >> >> -- >> >> Python is the second best programming language in the world. >> >> But the best has yet to be invented. Christian Tismer >> >> >> >> Mark Lawrence > > I have, but unfortunately they are about just as clear as the example I posted. The examples they posted are relevant for certain things, but not what I'm looking to do. > Bah humbug, back to the drawing board :( Slight aside, would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython, a quick glance above will tell you why, thanks. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web