【问题标题】:IRC Bot problems on UnrealIRCdUnrealIRCd 上的 IRC Bot 问题
【发布时间】:2016-04-06 20:12:09
【问题描述】:

我一直在使用 C# 开发 bot(使用 Amrykid.Web.IRC 库 - 我知道它有问题,但这与它无关 - 我想) 我今天遇到了一个小问题。

当我尝试加入 localhost IRC (unrealircd 4) 时,它会在日志中显示此信息(用户加入服务器但未加入频道)

:cisco.1337 NOTICE * :*** Looking up your hostname...
:cisco.1337 NOTICE * :*** Found your hostname
PING :9574792D
PONG :9574792D
:cisco.1337 451 MODE :You have not registered
:cisco.1337 451 JOIN :You have not registered
:cisco.1337 001 NoNameService :Welcome to the Cisco Localhost IRC Network NoNameService!NoNameServ@localhost

当我尝试加入“irc.freenode.net”时,一切顺利,用户加入频道

:weber.freenode.net NOTICE * :*** Looking up your hostname...
:weber.freenode.net NOTICE * :*** Checking Ident
:weber.freenode.net NOTICE * :*** Found your hostname
:weber.freenode.net NOTICE * :*** Got Ident response
:weber.freenode.net 001 NoNameService :Welcome to the freenode Internet Relay Chat Network NoNameService

这是我正在使用的代码(只是更改 IRCServer 字符串)

        #region Server Variables
        static string IRCServer = "irc.freenode.net";
        static int IRCPort = 6667;
        static string IRCChan = "#ciscobot";
        static string _password = "adminPassword";
        static string trigger = ".";
        #endregion

        static string nick = "NoNameService";
        static IRC _irc;
        static List<string> users = new List<string>();
        static void Main(string[] args)
        {
            _irc = new IRC(nick);
            _irc.Nick = nick;
            _irc.Connect(IRCServer, IRCPort);
            _irc.Logon(nick, nick);
            _irc.Join(IRCChan);
            _irc.IRCUserJoin += new IRC.IRCUserJoinHandler(_irc_IRCUserJoinHandler);
            _irc.IRCUserQuit += new IRC.IRCUserQuitHandler(_irc_IRCUserQuitHandler);
            _irc.IRCUserKick += new IRC.IRCUserKickHandler(_irc_IRCUserKickHandler);
            _irc.IRCPrivateMSGRecieved += new IRC.IRCPrivateMSGRecievedHandler(_irc_IRCPrivateMSGRecieved);
            while (true)
            {
                _irc.ProcessEvents(0);
            }
        }

我已经搜索了一整天,但我似乎无法找到问题所在......

【问题讨论】:

  • 连接时的时间线是什么样的? “找到您的主机名”消息和“您尚未注册”消息之间是否有明显的延迟?

标签: c# bots irc


【解决方案1】:

您发送命令太早了。 “您尚未注册”消息意味着服务器不知道您是谁,但您正在尝试设置模式并加入频道。

【讨论】:

    【解决方案2】:

    这可能与尝试使用本地 IRC 服务器上的注册帐户有关。您可以尝试不登录服务器。 Anope 服务将允许您使用用户注册。

    【讨论】:

      【解决方案3】:

      我不知道出了什么问题,所以我使用 SmartIrc4Net 而不是 Amrykid 的图书馆,它可以工作...我只需要做一些更改...

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-03
        • 2012-06-06
        • 2012-10-15
        • 1970-01-01
        • 2012-03-19
        • 2010-12-12
        • 2013-01-28
        • 2012-10-04
        相关资源
        最近更新 更多