有没有办法实现可以从 XMPP 服务器接收所有消息的 XMPP 客户端或消息接收器?

发布于 2024-08-20 10:15:37 字数 302 浏览 1 评论 0原文

基本上,我正在尝试构建一个机器人,它可以使用多个帐户之一向用户发送消息,并且能够将消息接收到最初使用的帐户,并执行我需要它执行的任何操作。到目前为止,我找到了 JAXL 库 (http://code.google.com/p/jaxl/< /a>),但根据示例,它一次只能处理一个用户。有什么建议或想法吗?

提前谢谢您。

顺便说一句,如果有办法让服务器自动将这些消息转发到另一个程序或任何同样有效的程序。

Basically im trying to build a bot that can send a message using one of many accounts out to a user and be able to receive messages to that account it originally used process and do whatever I need it to do. So far I found the JAXL library (http://code.google.com/p/jaxl/) but based on examples it is only able to handle one user at a time. Any suggestions or ideas?

thank you in advanced.

btw if there is anyway to make the server automatically forward those messages to another program or whatever that works just as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

握住我的手 2024-08-27 10:15:37

我认为您正在寻找外部组件... Jaxl v 2.0 确实允许您使用 PHP 编写的组件机器人 http ://github.com/abhinavsingh/JAXL

I think you are looking for a external component.... Jaxl v 2.0 does allow you having component bots written in PHP http://github.com/abhinavsingh/JAXL

GRAY°灰色天空 2024-08-27 10:15:37

我认为您要问的是:“我可以将服务器上所有‘传出’消息的副本发送到 XMPP 客户端吗?”这个问题的答案是“有点”。

您正在查看两部分:服务器配置和客户端/组件配置。您可能不想要客户。因为它需要以特定用户身份登录。您正在描述一个组件,它是在 XMPP 服务器或附近运行的受信任应用程序,并充当服务器的一部分。

服务器配置部分取决于您使用的服务器。我知道 XCP 可以做这种事情,例如使用消息存档组件。使用 ma,您可以创建一个组件来将消息写入日志或数据库。您将制作一个类似的组件,用于查找街道地址字符串并发送鲜花或其他东西 - 无论您需要采取什么行动。

我所做的一个重要假设是您完全控制这里的服务器。如果你不这样做,那么答案就是“不”。

I think what you're asking is: "Can I send a copy of all the 'outgoing' messages on a server to an XMPP client?" The answer to that question is "sort of."

You're looking at two pieces, server configuration and client/component configuration. You probably don't want a client. because it needs to log in as a particular user. You're describing a component, which is a trusted application running on the XMPP server or nearby, and acts as part of the server.

The server configuration part depends on which server you're using. I know XCP can do this kind of thing, such as with a message archive component. With ma you'd make a component to write the messages to a log or database. You'd be making a similar component that grepped strings for street addresses and sent out flowers, or something -- whatever action you needed to happen.

The big assumption I'm making is that you are in complete control of the server here. If you don't then the answer is "no."

緦唸λ蓇 2024-08-27 10:15:37

我最近使用 smack 库 托管了数十个“Xmpp 机器人”。不存在您只能作为单个用户连接的限制。只是为每个机器人生成一个线程,让他作为服务器上(甚至不同服务器上)上的单个 xmpp 用户进行连接并完成其工作。就我而言,机器人只是将测试消息发送到测试聊天室,但代理服务(正如我从您的问题中理解的那样)也是可能的。

这些线程甚至被设计为创建用户并在停止后删除它。

I recently used the smack library to host dozens of 'Xmpp bots'. There was no such limitation that you could only connect as a single user. Just spawned a thread for each bot, made him connect as an individual xmpp user on a server (and even on different servers) and do its job. In my case the bots simply sent test messages to test chat rooms, but a proxy service (as I understood it from your question) is possible as well.

The threads were even designed to create the user and delete it after stopping.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文