Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8599451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:24:03+00:00 2026-06-12T01:24:03+00:00

I have a php script to join a channel on this IRC server: irc.worldnet.net

  • 0

I have a php script to join a channel on this IRC server: irc.worldnet.net
Thanks to the server response I can say that I joined the channel successfully, and that the bot is in the users list. However, this command:

MSG bot_nickname hello my friend !

issues an ‘msg: unknown command’ response.
An when I send this line:

PRIVMSG bot_nickname : hello my friend !

There is no response from the bot (I don’t have any error message anyway).
Is there something wrong with the commands I send ?

Here is the php code that I use:

<?php

$channel_sent = false;
$channel_joined = false;
$msg_sent = false;
set_time_limit(0);
ini_set('display_errors', 'on');

$config = array(
    'server' => 'irc.worldnet.net',
    'port' => 6667,
    'nick' => 'cesame'.rand(),
    'channel' => '#nc-irc-challs'
);

$server = array();
$server['SOCKET'] = @fsockopen($config['server'], $config['port'], $errno, $errstr, 2); 

if($server['SOCKET'])
{
    SendCommand("PASS NOPASS\n\r");
    SendCommand("NICK " . $config['nick'] . "\n\r"); 
    SendCommand("USER " . $config['nick'] . " USING PHP IRC\n\r");    
    SendCommand("JOIN " . $config['channel'] . "\n\r");

    while(!feof($server['SOCKET'])) {
            ReadServer();
            flush();
            sleep(1);
    }
}

function ReadServer(){
    global $server;
    global $config;
    global $channel_joined;
    global $channel_sent;
    global $msg_sent;
    $server['READ_BUFFER'] = fgets($server['SOCKET'], 1024);
    echo "[RECEIVE] ".$server['READ_BUFFER']."<br>\n\r";  

    if(substr($server['READ_BUFFER'], 0, 6) == "PING :") { 
        SendCommand("PONG :".substr($server['READ_BUFFER'], 6)."\n\r"); 
    }
    if(strpos($server['READ_BUFFER'], "#nc-irc-challs :End of /NAMES list")){
        $channel_joined = true;
    }
    if(trim($server['READ_BUFFER']) == "" && $channel_joined &&!$msg_sent) {
        SendCommand('PRIVMSG Daneel : .challenge_caesar start' . "\n\r");
        $msg_sent = true;
    }
}

function SendCommand ($cmd)
{
    global $server; //Extends our $server array to this function
    @fwrite($server['SOCKET'], $cmd, strlen($cmd)); //sends the command to the server
    echo "[SEND] $cmd <br>"; //displays it on the screen
} 

?>

So I followed you advices. This is the logs that I Get:

[RECEIVE] :cesame1582!~cesame158@Wnet-59540.41.55.213.rev.sfr.net JOIN :#nc-irc-challs 
[RECEIVE] :Vidar.IRC.Worldnet.Net 332 cesame1582 #nc-irc-challs :NewbieContest -- http://www.newbiecontest.org/ (channel officiel : #newbiecontest) -- Rappel : aucune épreuve ne peut se résoudre en bruteforce. 
[RECEIVE] :Vidar.IRC.Worldnet.Net 333 cesame1582 #nc-irc-challs zours 1195848644 
[RECEIVE] :Vidar.IRC.Worldnet.Net 353 cesame1582 = #nc-irc-challs :cesame1582 \o_ @Eole +Daneel 
[RECEIVE] :Vidar.IRC.Worldnet.Net 366 cesame1582 #nc-irc-challs :End of /NAMES list. 
[SEND] PRIVMSG Daneel : .challenge_caesar start 
[RECEIVE] :Global!Services@Worldnet.Net NOTICE cesame1582 :[Logon News - Apr 07 2004] Use irc.worldnet.net to join our network, thanks | Dorenavant, utilisez irc.worldnet.net pour joindre notre reseau, merci. 
[RECEIVE] :Global!Services@Worldnet.Net NOTICE cesame1582 :[Logon News - Jan 07 2007] If you see a connection on port 23, 1080, 3128 or 8080 from 194.117.194.78 this is NOT an attack! It's our insecure proxy detector. 
[RECEIVE] :Global!Services@Worldnet.Net NOTICE cesame1582 :[Logon News - Feb 07 2007] Vous pouvez utiliser le port 7000 pour une connexion en SSL. You can use port 7000 with a secure SSL connection. 
[RECEIVE] :Global!Services@Worldnet.Net NOTICE cesame1582 :[Logon News - Oct 14 2009] Salons officiels du reseau Worldnet : #worldnet - #help pour de l'aide sur IRC et l'informatique en general. - ##opers pour les problemes réseau spécifiques à Worldnet. 
[RECEIVE] :Global!Services@Worldnet.Net NOTICE cesame1582 :[Random News - Apr 24 2004] Pour avoir de l'aide sur les commandes des services, visitez http://help.irc.worldnet.net 
[RECEIVE] :NickServ!Services@Worldnet.Net NOTICE cesame1582 :Your nick isn't registered. 
[RECEIVE] 
[RECEIVE] PING :Vidar.IRC.Worldnet.Net 
[SEND] PONG :Vidar.IRC.Worldnet.Net 
[RECEIVE] 
[RECEIVE] PING :Vidar.IRC.Worldnet.Net 
[SEND] PONG :Vidar.IRC.Worldnet.Net 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:24:04+00:00Added an answer on June 12, 2026 at 1:24 am

    The IRC server generally does not send empty strings.

    If you want a command to be issued once the BOT is in the channel, you should be sending it as soon as you know it’s in the channel, which is at the end of the /NAMES list, or once you receive the TOPIC.


    Also, the syntax for PRIVMSG is as follows:

    PRIVMSG <NICKNAME> :<MESSAGE>
    

    Without the space after the :. If the recieving end is set to respond to .command but gets  .command, that may be the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script running on my LAMP server that requires certain files
I have this test page http://thechozenfew.net/projects/write_font.php that generates the text in the input box
I have this PHP script that returns pictures from the database. I am using
I have PHP script works without problems, like this : while($row4 = mysql_fetch_array($result4)) {
I have php script that creates a temporary watermark image for users that are
I have a php script that inserts data from an Android app into a
I have a php script validation that looks for some special chars and deletes
I have a php script that watches for the newest json file in a
I have a php script that grabs links from another website. I am storing
I have a PHP script that very much like a commenting system, but requires

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.