Daktyl198 Posted August 26, 2013 Share Posted August 26, 2013 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 More sharing options...
AbraCadaver Posted August 26, 2013 Share Posted August 26, 2013 Not sure, but I don't think there should be a colon : there. Link to comment https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446876 Share on other sites More sharing options...
Andy-H Posted August 26, 2013 Share Posted August 26, 2013 Looking at 4.2.1 here, it looks like it should be: fwrite($socket, "JOIN #channel; channelkey\r\n"); Link to comment https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446884 Share on other sites More sharing options...
Daktyl198 Posted August 26, 2013 Author Share Posted August 26, 2013 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 https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446886 Share on other sites More sharing options...
Andy-H Posted August 26, 2013 Share Posted August 26, 2013 Does the channel name actually contain a colon? Link to comment https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446889 Share on other sites More sharing options...
AbraCadaver Posted August 26, 2013 Share Posted August 26, 2013 fwrite($socket, "JOIN #channel channelkey\r\n"); Link to comment https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446890 Share on other sites More sharing options...
Daktyl198 Posted August 26, 2013 Author Share Posted August 26, 2013 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 Edit: I just noticed AbraCadaver's first post said "don't". This could have been solved in the first reply haha Link to comment https://forums.phpfreaks.com/topic/281577-php-irc-bot-join-channels-with-keys/#findComment-1446891 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.