jimi_hendrix has asked for the wisdom of the Perl Monks concerning the following question:

ok so i am making an ircbot in perl heres the code

#!/usr/bin/perl ################### # A basic irc bot # ################### use Bot::BasicBot; $bot = Bot::BasicBot->new( server => "irc.freenode.net", port => "6667", channels=> ["#perl"], nick => "bot", alt_nicks=> ["bot"], username => "bot", name => "bot", ignore_list => [], charset => "utf-8"); $bot->run();
but it will not connect to freenode yes i realize bot is a generic name but i will change it after i fix this

Replies are listed 'Best First'.
Re: IRC bot with Bot::BasicBot not working
by moritz (Cardinal) on Feb 07, 2009 at 16:23 UTC
    Maybe try to give the alt_nicks option an array reference with nicks that aren't taken already?

    I've written two bots based on Bot::BasicBot that can both connect to freenode, so don't blame the module ;-).

Re: IRC bot with Bot::BasicBot not working
by slacker (Friar) on Feb 07, 2009 at 17:12 UTC
    Are you able to establish a connection via an irc client to that server?
    Windows - mirc
    Linux - kvirc, xchat, BitchX

      yes

      i use irssi
Re: IRC bot with Bot::BasicBot not working
by Anonymous Monk on Feb 07, 2009 at 16:04 UTC
    but it will not connect to freenode ...

    Why (whats the error message)?

      heres the error
      Trying to connect to server irc.freenode.net Server error occurred! Closing Link: 127.0.0.1 (Connection Timed Out) Lost connection to server irc.freenode.net. Trying to connect to server irc.freenode.net
      and i am not using #perl as a testing channel, or naming the bot bot...it has a different name than that in my source...just dont want to give it away :)
        Can you guess what "Connection Timed Out" means? IRC Connection Problems
        This vague error just means you couldn't establish a connection (as if you didn't know this already). If you get it a lot, try some of the servers listed above which are tolerant of identd or reverse DNS problems, in case that is your actual problem and you're just not getting the right error message. If that still doesn't work, it's possible that your ISP is blocking the connection attempt. This is often the case with school or company firewalls designed to discourage or ban IRC activity. The only way to be sure is to ask your network administrators or information technology people. You can sometimes get around this by using port numbers outside the usual 6660-9 range, such as irc.mcs.net port 31337 or irc.lightning.net port 5555, but you are responsible for the potentially serious consequences of intentionally ignoring your school or company's policies. Those rules exist for a reason, and breaking them is usually not wise.
Re: IRC bot with Bot::BasicBot not working
by slacker (Friar) on Feb 08, 2009 at 00:59 UTC
    Is there any sort of verbose logging that could be enabled with that bot module?
    Also, you could try asking one of the IRCops or admins of the server and see if they could provide any insight to your failed connections.
Re: IRC bot with Bot::BasicBot not working
by neilwatson (Priest) on Jun 24, 2015 at 15:38 UTC

    FYI, I had the same problem recently. It seems that freenode will reject connections if a nick of the same name is already logged in. Even alt_nicks did not seems to fix this.

    Neil Watson
    watson-wilson.ca