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
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 :(

Link to comment
Share on other sites

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

Edited by Daktyl198
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.