Python如何加入受密码保护的IRC频道

时间:2013-06-30 14:55:37

标签: python irc channel

在python中加入受密码保护的IRC频道的正确语法是什么?

通常会是:

socket.send("JOIN " +channel+ "\r\n")

1 个答案:

答案 0 :(得分:2)

来自RFC 1459:

Command: JOIN
Parameters: <channel>{,<channel>} [<key>{,<key>}]

此外,您必须使用CR-LF终止您的行:

IRC messages are always lines of characters terminated with a CR-LF
(Carriage Return - Line Feed) pair, and these messages shall not
exceed 512 characters in length, counting all characters including
the trailing CR-LF.

所以它是"JOIN " + channel + " " + key + "\r\n"

<强>参考文献: