I have been using Github's hubot for this purpose. My bot, when asked to tell a joke, tells a joke. (Of course I also have one that I can ask what I am supposed to be working on, and it looks up my worklist.)
GoGoBot> tell a joke about me
GoGoBot> a joke about Shell... Let me think about it...
GoGoBot>
I heard a funny one the other day:
Chuck Norris doesn't look both ways before he crosses the street...
he just roundhouses any cars that get too close.
The bot runs on NodeJS. The api takes a regex and a callback like
robot.hear /tell a joke/i, (msg) -> msg.send 'I heard a funny joke...'
module.exports = (robot) ->
robot.hear /tell (?:a|something) (?:joke|funny)(?: about ([a-z.]+))?/i, (msg) ->
subject = getSubject msg.match[1], msg.message.user.name
msg.send 'a joke about ' + subject + '... Let me think about it...' if subject.length
tellJoke = ->
getJoke subject, (err, text) ->
msg.send "Cannot compute. #{robot.name} is about to die.\r\n#{err}".replace(/e/ig, '3') if err?
msg.send "I heard a funny one the other day:\r\n#{text}" unless err?
setTimeout tellJoke, 5000 * Math.random()
It was pretty easy to learn since I am already familiar with NodeJS and coffee-script. I wrote the two bots I mentioned in a few hours today.