Jump to content

PHP IRC bot join channels with keys


Daktyl198

Recommended Posts

I'm stuck here...

 

I can make the bot do pretty much everything BUT join channels with keys. From what I've read, joining a channel with a key is just the usual join command with the key following the channel name, e.g:

fwrite($socket, "JOIN :#channel channelkey\r\n");

But that fails and tells me that there are invalid characters in the channel name; I'm assuming that means the space and everything that comes after it...

 

So how do I get it to join a channel with a key and not bug out?

Link to comment
https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/
Share on other sites

Looking at 4.2.1 here, it looks like it should be:

 

fwrite($socket, "JOIN #channel; channelkey\r\n");

No, that's to join the channel "#channel;" including the ; in the channel name.

Looking at that, it seems like my code:

fwrite($socket, "JOIN :#channel channelkey\r\n");

would be the right answer...

Yet I get an error :(

fwrite($socket, "JOIN :#channel channelkey\r\n");

The above code works perfectly for any channel without a key...

 

I'll try without the colon.

 

It works!! To think it was something so simple O__O

 

Thanks guys :D

 

Edit: I just noticed AbraCadaver's first post said "don't". This could have been solved in the first reply haha

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.