如何运行节点IRC机器人? [英] How do I run a node IRC bot?

查看:59
本文介绍了如何运行节点IRC机器人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行这个IRC Eliza机器人,但是我对如何做到这一点缺乏基本的了解.

I'd like to run this IRC Eliza bot but I lack some fundamental understanding of how to do it.

https://github.com/isaacs/node-eliza

我对IRC或如何连接它们一无所知.有人可以解释我如何连接到该机器人吗?我需要远程托管吗?有没有一种方法可以在本地运行IRC客户端并在本地连接到它?目前,该程序可以正常运行,但不会执行任何操作.

I don't know anything about IRC or how to connect to them. Could someone explain how I connect to this bot? Do I need to host it remotely? Is there a way to run an IRC client locally and connect to it locally? Currently the program just runs without error but does nothing.

我了解node.js,但是在了解IRC方面如何运行IRC机器人方面似乎缺少一些基础知识.

I understand node.js, but I seem to missing some fundamentals in understanding IRC on how to get an IRC bot running.

自述文件为我提供了可以执行但不执行任何操作的代码,如下所示:

The readme gives me code that executes but doesn't do anything, quoted below:

用法

var Eliza = require('eliza/irc.js')

new Eliza({ server: 'irc.freenode.net'
          , nick: 'Eliza'
          , channels: ['##turtles']
          , userName: 'eliza'
          , realName: 'eliza' })

推荐答案

IRC是一个全球聊天系统,由许多单独的主机组成,所有主机(最终)都链接在一起.通常,您自己不运行IRC的一部分,而是使用客户端连接到其中一台主机,从而可以访问网络及其上的每个人.

IRC is the a global chat system, comprised of many individual hosts, all (eventually) linked. You usually don't run a part of IRC yourself, rather you use a client to connect to one of the hosts and thus gain access to the network and everyone on it.

IRC机器人是一段机器代码,具有自己的逻辑(在您的情况下为Eliza的逻辑),并且还与IRC连接并发出IRC命令,使其可以加入渠道,与其他人/机器人对话,收到邮件等

An IRC bot is a piece of machine code that has its own logic (Eliza's logic, in your case), and is also connected to IRC and issues IRC commands that let it join channels, talk to other people/bots, received messages, etc.

在您的情况下,您只需要运行该漫游器,并让它知道要加入的IRC服务器(new Eliza({...中的server参数),为其自己选择的昵称,等等.

In your case, you would simply need to run the bot, and let it know which IRC server to join (that the server parameter in new Eliza({...), what nick name to choose for itself, etc.

要运行该机器人,只需在带有示例文件内容的任何环境(您的家用PC?托管?)中运行node.

To run the bot just run node, in any environment (your home PC? hosting?) with the contents of the sample file.

这篇关于如何运行节点IRC机器人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆