मैं इस उद्देश्य के लिए गिथब के hubot का उपयोग कर रहा हूं। मेरा बॉट, जब एक मजाक बताने के लिए कहा, एक मजाक बताता है। (बेशक मैं भी एक है कि मैं पूछ सकता है कि मैं क्या पर काम करना चाहिए है, और यह मेरी 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.
बॉट NodeJS पर चलता है। एपीआई एक regex और तरह
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()
एक कॉलबैक यह बहुत जानने के लिए के बाद से मैं NodeJS और कॉफी स्क्रिप्ट के साथ पहले से ही परिचित हूँ आसान था लेता है। मैंने आज दो घंटों में उल्लेख किए गए दो बॉट लिखे हैं।
स्रोत
2013-03-02 23:23:02
आप सर्वर साइड प्रोग्रामिंग भाषा क्या हैं –
मैं अभी भी आवश्यकता एकत्रण और व्यवहार्यता अध्ययन चरण में हूं। लेकिन, शायद यह रूबी हो जाएगा। उस पर कोई मुकदमा? – Mayur
मैंने जावा का उपयोग इनसॉफ्ट ibot एसडीके मंच के साथ किया (मेरा जवाब देखें)। यदि आप चाहें तो आप .NET का भी उपयोग कर सकते हैं, वास्तव में कोई फर्क नहीं पड़ता कि आप क्या कर रहे हैं। – JohnIdol