跳转到内容

用户:WhitePhosphorus/磷原子1号/IRC指令列表

本页使用了标题或全文手工转换
维基百科,自由的百科全书

This is a list of all IRC commands from RFC 1459, RFC 2812, and extensions added to major IRC daemons. Most IRC clients require commands to be preceded by a slash ("/"). Angle brackets ("<" and ">") denote what's placed in the encapsulated field, not a literal part of the command. Arguments encapsulated in square brackets ("[" and "]") are optional and override the command's defaults. Some commands are actually sent to IRC机器人s; these are treated by the IRC protocol as ordinary messages, not as / commands.

User commands

[编辑]

ADMIN

[编辑]

Syntax:

ADMIN [<target>]

Instructs the server to return information about the administrators of the server specified by <target>, where <target> is either a server or a user. If <target> is omitted, the server should return information about the administrators of the current server.[1]

AWAY

[编辑]

Syntax:

AWAY [<离开消息>]

给服务器提供一个离开消息,这样有人和你私聊时会自动发送这个消息,而群聊中不会这样。[2]如果没有指定<离开消息>,服务器会解除你的离开状态。

Defined in RFC 1459

CNOTICE

[编辑]

Syntax:

CNOTICE <nickname> <channel> :<message>

Sends a channel NOTICE message to <nickname> on <channel> that bypasses flood protection limits. The target nickname must be in the same channel as the client issuing the command, and the client must be a channel operator.

Normally an IRC server will limit the number of different targets a client can send messages to within a certain time frame to prevent spammers or bots from mass-messaging users on the network, however this command can be used by channel operators to bypass that limit in their channel. For example, it is often used by help operators that may be communicating with a large number of users in a help channel at one time.

This command is not formally defined in an RFC, but is in use by some IRC networks. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the CNOTICE keyword

CPRIVMSG

[编辑]

Syntax:

CPRIVMSG <nickname> <channel> :<message>

Sends a private message to <nickname> on <channel> that bypasses flood protection limits. The target nickname must be in the same channel as the client issuing the command, and the client must be a channel operator.

Normally an IRC server will limit the number of different targets a client can send messages to within a certain time frame to prevent spammers or bots from mass-messaging users on the network, however this command can be used by channel operators to bypass that limit in their channel. For example, it is often used by help operators that may be communicating with a large number of users in a help channel at one time.

This command is not formally defined in an RFC, but is in use by some IRC networks. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the CPRIVMSG keyword

CONNECT

[编辑]

Syntax:

CONNECT <target server> [<port> [<remote server>]] (RFC 1459)
CONNECT <target server> <port> [<remote server>] (RFC 2812)

Instructs the server <remote server> (or the current server, if <remote server> is omitted) to connect to <target server> on port <port>.[3][4] This command should only be available to IRC Operator英语IRC Operators.

Defined in RFC 1459; the <port> parameter became mandatory in RFC 2812

DIE

[编辑]

Syntax:

DIE

This command may only be issued by IRC server operators.

Instructs the server to shut down.[5]

Defined in RFC 2812

ENCAP

[编辑]

Syntax:

:<source> ENCAP <destination> <subcommand> <parameters>

This command is for use by servers to encapsulate commands so that they will propagate across hub servers not yet updated to support them, and indicates the subcommand and its parameters should be passed unaltered to the destination, where it will be unencapsulated and parsed. This facilitates implementation of new features without a need to restart all servers before they are usable across the network.[6]

ERROR

[编辑]

Syntax:

ERROR <error message>

This command is for use by servers to report errors to other servers. It is also used before terminating client connections.[7]

Defined in RFC 1459

HELP

[编辑]

Syntax:

HELP

向服务器请求帮助文档。

This command is not formally defined in an RFC, but is in use by most major IRC daemons.

INFO

[编辑]

Syntax:

INFO [<目标>]

返回<目标>服务器的信息,如果没有指定<目标>的话就返回当前服务器的。[8]返回的信息包括当前服务器版本、其编译时间、补丁级别、何时开始运行等等。

Defined in RFC 1459

INVITE

[编辑]

Syntax:

INVITE <nickname> <channel>

Invites <nickname> to the channel <channel>.[9] <channel> does not have to exist, but if it does, only members of the channel are allowed to invite other clients. If the channel mode i is set, only channel operators may invite other clients.

Defined in RFC 1459

ISON

[编辑]

Syntax:

ISON <nicknames>

Queries the server to see if the clients in the space-separated list <nicknames> are currently on the network.[10] The server returns only the nicknames that are on the network in a space-separated list. If none of the clients are on the network the server returns an empty list.

Defined in RFC 1459

JOIN

[编辑]

Syntax:

JOIN <频道> [<密码>]

加入<频道>中的所有频道,用半角逗号“,”分隔。如果频道需要密码,可以指定<密码>参数,同样用半角逗号“,”分隔,和<频道>对应。[11]这个命令会建立不存在的频道。

Defined in RFC 1459

KICK

[编辑]

Syntax:

KICK <channel> <client> [<message>]

Forcibly removes <client> from <channel>.[12] This command may only be issued by channel operators.

Defined in RFC 1459

KILL

[编辑]

Syntax:

KILL <client> <comment>

Forcibly removes <client> from the network.[13] This command may only be issued by IRC operators.

Defined in RFC 1459

KNOCK

[编辑]

Syntax:

KNOCK <channel> [<message>]

Sends a NOTICE to an invitation-only <channel> with an optional <message>, requesting an invite.

This command is not formally defined by an RFC, but is supported by most major IRC daemons. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the KNOCK keyword.

[编辑]

Syntax:

LINKS [<remote server> [<server mask>]]

Lists all server links matching <server mask>, if given, on <remote server>, or the current server if omitted.[14]

Defined in RFC 1459

LIST

[编辑]

Syntax:

LIST [<channels> [<server>]]

Lists all channels on the server.[15] If the comma-separated list <channels> is given, it will return the channel topics. If <server> is given, the command will be forwarded to <server> for evaluation.

Defined in RFC 1459

LUSERS

[编辑]

Syntax:

LUSERS [<mask> [<server>]]

Returns statistics about the size of the network.[16] If called with no arguments, the statistics will reflect the entire network. If <mask> is given, it will return only statistics reflecting the masked subset of the network. If <target> is given, the command will be forwarded to <server> for evaluation.

Defined in RFC 2812

MODE

[编辑]

Syntax:

MODE <nickname> <flags> (user)
MODE <channel> <flags> [<args>]

The MODE command is dual-purpose. It can be used to set both user and channel modes.[17]

Defined in RFC 1459

MOTD

[编辑]

Syntax:

MOTD [<服务器>]

返回<服务器>今日的消息,如果没指定参数则返回当前服务器的。[18]

Defined in RFC 2812

NAMES

[编辑]

Syntax:

NAMES [<channels>] (RFC 1459)
NAMES [<channels> [<server>]] (RFC 2812)

Returns a list of who is on the comma-separated list of <channels>, by channel name.[19] If <channels> is omitted, all users are shown, grouped by channel name with all users who are not on a channel being shown as part of channel "*". If <server> is specified, the command is sent to <server> for evaluation.[20]

Defined in RFC 1459; the optional <server> parameter was added in RFC 2812.

The response contains all nicknames in the channel prefixed with the highest channel status prefix of that user, for example like this (with @ being the highest status prefix)

:irc.server.net 353 Phyre = #SomeChannel :@WiZ

If a client wants to receive all the channel status prefixes of a user and not only their current highest one, the IRCv3 multi-prefix extension can be enabled (@ is the channel operator prefix, and + the lower voice status prefix):[21]

:irc.server.net 353 Phyre = #SomeChannel :@+WiZ

See also NAMESX below for an alternate, older approach to achieve the same effect. However, by today most clients and servers support the new IRCv3 standard.[22]

NAMESX

[编辑]

Syntax:

PROTOCTL NAMESX

Instructs the server to send names in an RPL_NAMES reply prefixed with all their respective channel statuses instead of just the highest one (similar to IRCv3's multi-prefix).

For example:

With NAMESX

:irc.server.net 353 Phyre = #SomeChannel :@+WiZ

Without NAMESX

:irc.server.net 353 Phyre = #SomeChannel :@WiZ

This command can ONLY be used if the NAMESX keyword is returned in an RPL_ISUPPORT (numeric 005) reply. It may also be combined with the UHNAMES command.

This command is not formally defined in an RFC, but is recognized by most major IRC daemons. The newer modern approach is to use IRCv3 protocol extensions to activate the multi-prefix extension for the regular NAMES command.[21]

NICK

[编辑]

Syntax:

NICK <nickname> [<hopcount>] (RFC 1459)
NICK <nickname> (RFC 2812)

Allows a client to change their IRC nickname. Hopcount is for use between servers to specify how far away a nickname is from its home server.[23][24]

Defined in RFC 1459; the optional <hopcount> parameter was removed in RFC 2812

NOTICE

[编辑]

Syntax:

NOTICE <msgtarget> <message>

This command works similarly to PRIVMSG, except automatic replies must never be sent in reply to NOTICE messages.[25]

Defined in RFC 1459

OPER

[编辑]

Syntax:

OPER <username> <password>

Authenticates a user as an IRC operator on that server/network.[26]

Defined in RFC 1459

PART

[编辑]

Syntax:

PART <channels> [<message>]

Causes a user to leave the channels in the comma-separated list <channels>.[27]

Defined in RFC 1459

PASS

[编辑]

Syntax:

PASS <password>

Sets a connection password.[28] This command must be sent before the NICK/USER registration combination.

Defined in RFC 1459

PING

[编辑]

Syntax:

PING <server1> [<server2>]

Tests the presence of a connection.[29] A PING message results in a PONG reply. If <server2> is specified, the message gets passed on to it.

Defined in RFC 1459

PONG

[编辑]

Syntax:

PONG <server1> [<server2>]

This command is a reply to the PING command and works in much the same way.[30]

Defined in RFC 1459

PRIVMSG

[编辑]

Syntax:

PRIVMSG <msgtarget> <message>

Sends <message> to <msgtarget>, which is usually a user or channel.[31]

Defined in RFC 1459

QUIT

[编辑]

Syntax:

QUIT [<message>]

Disconnects the user from the server.[32]

Defined in RFC 1459

REHASH

[编辑]

Syntax:

REHASH

Causes the server to re-read and re-process its configuration file(s).[33] This command can only be sent by IRC Operators.

Defined in RFC 1459

RESTART

[编辑]

Syntax:

RESTART

Restarts a server.[34] It may only be sent by IRC Operators.

Defined in RFC 1459

RULES

[编辑]

Syntax:

RULES

Requests the server rules.

This command is not formally defined in an RFC, but is used by most[哪个/哪些?] major IRC daemons.

SERVER

[编辑]

Syntax:

SERVER <servername> <hopcount> <info>

The server message is used to tell a server that the other end of a new connection is a server.[35] This message is also used to pass server data over the whole network. <hopcount> details how many hops (server connections) away <servername> is. <info> contains addition human-readable information about the server.

Defined in RFC 1459

SERVICE

[编辑]

Syntax:

SERVICE <nickname> <reserved> <distribution> <type> <reserved> <info>

Registers a new service on the network.[36]

Defined in RFC 2812

SERVLIST

[编辑]

Syntax:

SERVLIST [<mask> [<type>]]

Lists the services currently on the network.[37]

Defined in RFC 2812

SQUERY

[编辑]

Syntax:

SQUERY <servicename> <text>

Identical to PRIVMSG except the recipient must be a service.[38]

Defined in RFC 2812

SQUIT

[编辑]

Syntax:

SQUIT <server> <comment>

Causes <server> to quit the network.[39]

Defined in RFC 1459

SETNAME

[编辑]

Syntax:

SETNAME <new real name>

Allows a client to change the "real name" specified when registering a connection.

This command is not formally defined by an RFC, but is in use by some IRC daemons. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the SETNAME keyword

SILENCE

[编辑]

Syntax:

SILENCE [+/-<hostmask>]

Adds or removes a host mask to a server-side ignore list that prevents matching users from sending the client messages. More than one mask may be specified in a space-separated list, each item prefixed with a "+" or "-" to designate whether it is being added or removed. Sending the command with no parameters returns the entries in the client's ignore list.

This command is not formally defined in an RFC, but is supported by most[哪个/哪些?] major IRC daemons. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the SILENCE keyword and the maximum number of entries a client may have in its ignore list. For example:

:irc.server.net 005 WiZ WALLCHOPS WATCH=128 SILENCE=15 MODES=12 CHANTYPES=#

STATS

[编辑]

Syntax:

STATS <query> [<server>]

Returns statistics about the current server, or <server> if it's specified.[40]

Defined in RFC 1459

SUMMON

[编辑]

Syntax:

SUMMON <user> [<server>] (RFC 1459)
SUMMON <user> [<server> [<channel>]] (RFC 2812)

Gives users who are on the same host as <server> a message asking them to join IRC.[41][42]

Defined in RFC 1459; the optional <channel> parameter was added in RFC 2812

TIME

[编辑]

Syntax:

TIME [<server>]

Returns the local time on the current server, or <server> if specified.[43]

Defined in RFC 1459

TOPIC

[编辑]

Syntax:

TOPIC <channel> [<topic>]

Allows the client to query or set the channel topic on <channel>.[44] If <topic> is given, it sets the channel topic to <topic>. If channel mode +t is set, only a channel operator may set the topic.

Defined in RFC 1459

TRACE

[编辑]

Syntax:

TRACE [<target>]

Trace a path across the IRC network to a specific server or client, in a similar method to Traceroute.[45]

Defined in RFC 1459

UHNAMES

[编辑]

Syntax:

PROTOCTL UHNAMES

Instructs the server to send names in an RPL_NAMES reply in the long format:

With UHNAMES

:irc.server.net 353 Phyre = #SomeChannel :WiZ!user@somehost

Without UHNAMES

:irc.server.net 353 Phyre = #SomeChannel :WiZ

This command can ONLY be used if the UHNAMES keyword is returned in an RPL_ISUPPORT (numeric 005) reply. It may also be combined with the NAMESX command.

This command is not formally defined in an RFC, but is recognized by most major IRC daemons.

USER

[编辑]

Syntax:

USER <username> <hostname> <servername> <realname> (RFC 1459)
USER <user> <mode> <unused> <realname> (RFC 2812)

This command is used at the beginning of a connection to specify the username, hostname, real name and initial user modes of the connecting client.[46][47] <realname> may contain spaces, and thus must be prefixed with a colon.

Defined in RFC 1459, modified in RFC 2812

USERHOST

[编辑]

Syntax:

USERHOST <nickname> [<nickname> <nickname> ...]

Returns a list of information about the nicknames specified.[48]

Defined in RFC 1459

USERIP

[编辑]

Syntax:

USERIP <nickname>

Requests the direct IP地址 of the user with the specified nickname.

This command is often used to obtain the IP of an abusive user to more effectively perform a ban. It is unclear what, if any, privileges are required to execute this command on a server.

This command is not formally defined by an RFC, but is in use by some IRC daemons. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the USERIP keyword.

USERS

[编辑]

Syntax:

USERS [<server>]

Returns a list of users and information about those users in a format similar to the UNIX commands who, rusers and finger英语finger (Unix).[49]

Defined in RFC 1459

VERSION

[编辑]

Syntax:

VERSION [<server>]

Returns the version of <server>, or the current server if omitted.[50]

Defined in RFC 1459

WALLOPS

[编辑]

Syntax:

WALLOPS <message>

Sends <message> to all operators connected to the server (RFC 1459), or all users with user mode 'w' set (RFC 2812).[51][52]

Defined in RFC 1459

WATCH

[编辑]

Syntax:

WATCH [+/-<nicknames>]

Adds or removes a user to a client's server-side friends list. More than one nickname may be specified in a space-separated list, each item prefixed with a "+" or "-" to designate whether it is being added or removed. Sending the command with no parameters returns the entries in the client's friends list.

This command is not formally defined in an RFC, but is supported by most[哪个/哪些?] major IRC daemons. Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the WATCH keyword and the maximum number of entries a client may have in its friends list. For example:

:irc.server.net 005 WiZ WALLCHOPS WATCH=128 SILENCE=15 MODES=12 CHANTYPES=#

WHO

[编辑]

Syntax:

WHO [<name> ["o"]]

Returns a list of users who match <name>.[53] If the flag "o" is given, the server will only return information about IRC Operators.

Defined in RFC 1459

WHOIS

[编辑]

Syntax:

WHOIS [<server>] <nicknames>

Returns information about the comma-separated list of nicknames masks <nicknames>.[54] If <server> is given, the command is forwarded to it for processing.

Defined in RFC 1459

WHOWAS

[编辑]

Syntax:

WHOWAS <nickname> [<count> [<server>]]

Used to return information about a nickname that is no longer in use (due to client disconnection, or nickname changes).[55] If given, the server will return information from the last <count> times the nickname has been used. If <server> is given, the command is forwarded to it for processing. In RFC 2812, <nickname> can be a comma-separated list of nicknames.[56]

Defined in RFC 1459

See also

[编辑]

References

[编辑]
  1. ^ Admin command: p. 31. sec. 4.3.7. RFC 1459. 
  2. ^ Away: pp. 38 – 39. sec. 5.1. RFC 1459. 
  3. ^ Connect message: pp. 29 – 30. sec. 4.3.5. RFC 1459. 
  4. ^ Connect message: pp. 28 – 29. sec. 3.4.7. RFC 2812. 
  5. ^ Die message: p. 39. sec. 4.3. RFC 2812. 
  6. ^ [1]
  7. ^ Error: p. 38. sec. 4.6.4. RFC 1459. 
  8. ^ Info command: pp. 31 – 32. sec. 4.3.8. RFC 1459. 
  9. ^ Invite message: p. 25. sec. 4.2.7. RFC 1459. 
  10. ^ Ison message: p. 42. sec. 5.8. RFC 1459. 
  11. ^ Join message: pp. 19 – 20. sec. 4.2.1. RFC 1459. 
  12. ^ Kick command: pp. 25 – 26. sec. 4.2.8. RFC 1459. 
  13. ^ Kill message: p. 36. sec. 4.6.1. RFC 1459. 
  14. ^ Links message: pp. 28 – 29. sec. 4.3.3. RFC 1459. 
  15. ^ List message: pp. 24 – 25. sec. 4.2.6. RFC 1459. 
  16. ^ Lusers message: pp. 25 – 26. sec. 3.4.2. RFC 2812. 
  17. ^ Mode message: pp. 21 – 23. sec. 4.2.3. RFC 1459. 
  18. ^ Motd message: p. 25. sec. 3.4.1. RFC 2812. 
  19. ^ Names message: p. 24. sec. 4.2.5. RFC 1459. 
  20. ^ Names message: pp. 20 – 21. sec. 3.2.5. RFC 2812. 
  21. ^ 21.0 21.1 Andrew Northall. IRCv3 – Welcome. atheme.org. [21 February 2016]. 
  22. ^ Andrew Northall. IRCv3 – Welcome. atheme.org. [21 February 2016]. 
  23. ^ Nick message: pp. 14 – 15. sec. 4.1.2. RFC 1459. 
  24. ^ Nick message: pp. 10 – 11. sec. 3.1.2. RFC 2812. 
  25. ^ Notice: p. 33. sec. 4.4.2. RFC 1459. 
  26. ^ Oper: p. 17. sec. 4.1.5. RFC 1459. 
  27. ^ Part message: pp. 20 – 21. sec. 4.2.2. RFC 1459. 
  28. ^ Password message: p. 14. sec. 4.1.1. RFC 1459. 
  29. ^ Ping message: p. 37. sec. 4.6.2. RFC 1459. 
  30. ^ Pong message: pp. 37 – 38. sec. 4.6.3. RFC 1459. 
  31. ^ Private messages: pp. 32 – 33. sec. 4.4.1. RFC 1459. 
  32. ^ Quit: pp. 17 – 18. sec. 4.1.6. RFC 1459. 
  33. ^ Rehash message: p. 39. sec. 5.2. RFC 1459. 
  34. ^ Restart message: pp. 39 – 40. sec. 5.3. RFC 1459. 
  35. ^ Server message: pp. 16 – 17. sec. 4.1.4. RFC 1459. 
  36. ^ Service message: pp. 13 – 14. sec. 3.1.6. RFC 2812. 
  37. ^ Servlist message: p. 31. sec. 3.5.1. RFC 2812. 
  38. ^ Squery: p. 32. sec. 3.5.2. RFC 2812. 
  39. ^ Server quit message: pp. 18 – 19. sec. 4.1.7. RFC 1459. 
  40. ^ Stats message: pp. 27 – 28. sec. 4.3.2. RFC 1459. 
  41. ^ Summon message: p. 40. sec. 5.4. RFC 1459. 
  42. ^ Summon message: p. 40. sec. 4.5. RFC 2812. 
  43. ^ Time message: p. 29. sec. 4.3.4. RFC 1459. 
  44. ^ Topic message: pp. 23 – 24. sec. 4.2.4. RFC 1459. 
  45. ^ Trace message: pp. 30 – 31. sec. 4.3.6. RFC 1459. 
  46. ^ User message: pp. 15 – 16. sec. 4.1.3. RFC 1459. 
  47. ^ User message: p. 11. sec. 3.1.3. RFC 2812. 
  48. ^ Userhost message: p. 42. sec. 5.7. RFC 1459. 
  49. ^ Users: pp. 40 – 41. sec. 5.5. RFC 1459. 
  50. ^ Version message: pp. 26 – 27. sec. 4.3.1. RFC 1459. 
  51. ^ Operwall message: p. 41. sec. 5.6. RFC 1459. 
  52. ^ Operwall message: pp. 41 – 42. sec. 4.7. RFC 2812. 
  53. ^ Who query: pp. 33 – 34. sec. 4.5.1. RFC 1459. 
  54. ^ Whois query: pp. 34 – 35. sec. 4.5.2. RFC 1459. 
  55. ^ Whowas: p. 35. sec. 4.5.3. RFC 1459. 
  56. ^ Whowas: p. 34. sec. 3.6.3. RFC 2812. 

Bibliography

[编辑]

Further reading

[编辑]
[编辑]