Ruby 24/7 工作 XMPP 机器人
有人可以帮我解决这个问题吗? 我想创建一个机器人,它接收一种语言的单词,查找数据库,获取翻译并将其发回。我的理解是,这在共享主机上是不可能的,但在自己的服务器或 VDS 上是可能的。那么我是否需要使用 EventMachine 和 xmpp4r 等库来制作我的机器人?如果是,如何同时处理多个请求?
Could someone help me with this?
I would to create a bot which receives word in one language, looks in database, gets translation and sends it back. How i understand it's not possible on shared hostings, but possible on own servers or VDS. So do i need to make my bot using libs like EventMachine and xmpp4r? If yes how to work with many requests at one time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
接收单词、查找数据库并将响应发回非常简单。
您的机器人应该接受每个新联系人并将其添加到其名册(联系人列表)中。
看看这段代码。我写了一个像“Google Bots”这样的机器人,它使用谷歌翻译服务。
该机器人接收消息,使用谷歌服务翻译它们并将它们发送回发件人。
PS:我使用 yaml 文件进行设置。
此致,
Receing a word, looking in database and sending the response back is very simple .
Your bot should accept every new contact and add them to its roster (contact list).
Take a look a this code. I wrote a bot like "Google Bots" it uses google translation service.
This bot receives messages, translate them using google service and send them back to senders.
PS : I used a yaml file for the setting.
Best regards,