]> git.lizzy.rs Git - luairc.git/blob - src/irc/constants.lua
Port to Lua 5.3
[luairc.git] / src / irc / constants.lua
1 ---
2 -- This module holds various constants used by the IRC protocol.
3 local constants = {}
4
5 -- protocol constants {{{
6 constants.IRC_MAX_MSG = 512
7 -- }}}
8
9 -- server replies {{{
10 constants.replies = {
11 -- Command responses {{{
12  [001] = "RPL_WELCOME",
13  [002] = "RPL_YOURHOST",
14  [003] = "RPL_CREATED",
15  [004] = "RPL_MYINFO",
16  [005] = "RPL_BOUNCE",
17  [302] = "RPL_USERHOST",
18  [303] = "RPL_ISON",
19  [301] = "RPL_AWAY",
20  [305] = "RPL_UNAWAY",
21  [306] = "RPL_NOWAWAY",
22  [311] = "RPL_WHOISUSER",
23  [312] = "RPL_WHOISSERVER",
24  [313] = "RPL_WHOISOPERATOR",
25  [317] = "RPL_WHOISIDLE",
26  [318] = "RPL_ENDOFWHOIS",
27  [319] = "RPL_WHOISCHANNELS",
28  [314] = "RPL_WHOWASUSER",
29  [369] = "RPL_ENDOFWHOWAS",
30  [321] = "RPL_LISTSTART",
31  [322] = "RPL_LIST",
32  [323] = "RPL_LISTEND",
33  [325] = "RPL_UNIQOPIS",
34  [324] = "RPL_CHANNELMODEIS",
35  [331] = "RPL_NOTOPIC",
36  [332] = "RPL_TOPIC",
37  [341] = "RPL_INVITING",
38  [342] = "RPL_SUMMONING",
39  [346] = "RPL_INVITELIST",
40  [347] = "RPL_ENDOFINVITELIST",
41  [348] = "RPL_EXCEPTLIST",
42  [349] = "RPL_ENDOFEXCEPTLIST",
43  [351] = "RPL_VERSION",
44  [352] = "RPL_WHOREPLY",
45  [315] = "RPL_ENDOFWHO",
46  [353] = "RPL_NAMREPLY",
47  [366] = "RPL_ENDOFNAMES",
48  [364] = "RPL_LINKS",
49  [365] = "RPL_ENDOFLINKS",
50  [367] = "RPL_BANLIST",
51  [368] = "RPL_ENDOFBANLIST",
52  [371] = "RPL_INFO",
53  [374] = "RPL_ENDOFINFO",
54  [375] = "RPL_MOTDSTART",
55  [372] = "RPL_MOTD",
56  [376] = "RPL_ENDOFMOTD",
57  [381] = "RPL_YOUREOPER",
58  [382] = "RPL_REHASHING",
59  [383] = "RPL_YOURESERVICE",
60  [391] = "RPL_TIME",
61  [392] = "RPL_USERSSTART",
62  [393] = "RPL_USERS",
63  [394] = "RPL_ENDOFUSERS",
64  [395] = "RPL_NOUSERS",
65  [200] = "RPL_TRACELINK",
66  [201] = "RPL_TRACECONNECTING",
67  [202] = "RPL_TRACEHANDSHAKE",
68  [203] = "RPL_TRACEUNKNOWN",
69  [204] = "RPL_TRACEOPERATOR",
70  [205] = "RPL_TRACEUSER",
71  [206] = "RPL_TRACESERVER",
72  [207] = "RPL_TRACESERVICE",
73  [208] = "RPL_TRACENEWTYPE",
74  [209] = "RPL_TRACECLASS",
75  [210] = "RPL_TRACERECONNECT",
76  [261] = "RPL_TRACELOG",
77  [262] = "RPL_TRACEEND",
78  [211] = "RPL_STATSLINKINFO",
79  [212] = "RPL_STATSCOMMANDS",
80  [219] = "RPL_ENDOFSTATS",
81  [242] = "RPL_STATSUPTIME",
82  [243] = "RPL_STATSOLINE",
83  [221] = "RPL_UMODEIS",
84  [234] = "RPL_SERVLIST",
85  [235] = "RPL_SERVLISTEND",
86  [221] = "RPL_UMODEIS",
87  [251] = "RPL_LUSERCLIENT",
88  [252] = "RPL_LUSEROP",
89  [253] = "RPL_LUSERUNKNOWN",
90  [254] = "RPL_LUSERCHANNELS",
91  [255] = "RPL_LUSERME",
92  [256] = "RPL_ADMINME",
93  [257] = "RPL_ADMINLOC1",
94  [258] = "RPL_ADMINLOC2",
95  [259] = "RPL_ADMINEMAIL",
96  [263] = "RPL_TRYAGAIN",
97 -- }}}
98 -- Error codes {{{
99  [401] = "ERR_NOSUCHNICK", -- No such nick/channel
100  [402] = "ERR_NOSUCHSERVER", -- No such server
101  [403] = "ERR_NOSUCHCHANNEL", -- No such channel
102  [404] = "ERR_CANNOTSENDTOCHAN", -- Cannot send to channel
103  [405] = "ERR_TOOMANYCHANNELS", -- You have joined too many channels
104  [406] = "ERR_WASNOSUCHNICK", -- There was no such nickname
105  [407] = "ERR_TOOMANYTARGETS", -- Duplicate recipients. No message delivered
106  [408] = "ERR_NOSUCHSERVICE", -- No such service
107  [409] = "ERR_NOORIGIN", -- No origin specified
108  [411] = "ERR_NORECIPIENT", -- No recipient given
109  [412] = "ERR_NOTEXTTOSEND", -- No text to send
110  [413] = "ERR_NOTOPLEVEL", -- No toplevel domain specified
111  [414] = "ERR_WILDTOPLEVEL", -- Wildcard in toplevel domain
112  [415] = "ERR_BADMASK", -- Bad server/host mask
113  [421] = "ERR_UNKNOWNCOMMAND", -- Unknown command
114  [422] = "ERR_NOMOTD", -- MOTD file is missing
115  [423] = "ERR_NOADMININFO", -- No administrative info available
116  [424] = "ERR_FILEERROR", -- File error
117  [431] = "ERR_NONICKNAMEGIVEN", -- No nickname given
118  [432] = "ERR_ERRONEUSNICKNAME", -- Erroneus nickname
119  [433] = "ERR_NICKNAMEINUSE", -- Nickname is already in use
120  [436] = "ERR_NICKCOLLISION", -- Nickname collision KILL
121  [437] = "ERR_UNAVAILRESOURCE", -- Nick/channel is temporarily unavailable
122  [441] = "ERR_USERNOTINCHANNEL", -- They aren't on that channel
123  [442] = "ERR_NOTONCHANNEL", -- You're not on that channel
124  [443] = "ERR_USERONCHANNEL", -- User is already on channel
125  [444] = "ERR_NOLOGIN", -- User not logged in
126  [445] = "ERR_SUMMONDISABLED", -- SUMMON has been disabled
127  [446] = "ERR_USERSDISABLED", -- USERS has been disabled
128  [451] = "ERR_NOTREGISTERED", -- You have not registered
129  [461] = "ERR_NEEDMOREPARAMS", -- Not enough parameters
130  [462] = "ERR_ALREADYREGISTERED", -- You may not reregister
131  [463] = "ERR_NOPERMFORHOST", -- Your host isn't among the privileged
132  [464] = "ERR_PASSWDMISMATCH", -- Password incorrect
133  [465] = "ERR_YOUREBANNEDCREEP", -- You are banned from this server
134  [466] = "ERR_YOUWILLBEBANNED",
135  [467] = "ERR_KEYSET", -- Channel key already set
136  [471] = "ERR_CHANNELISFULL", -- Cannot join channel (+l)
137  [472] = "ERR_UNKNOWNMODE", -- Unknown mode char
138  [473] = "ERR_INVITEONLYCHAN", -- Cannot join channel (+i)
139  [474] = "ERR_BANNEDFROMCHAN", -- Cannot join channel (+b)
140  [475] = "ERR_BADCHANNELKEY", -- Cannot join channel (+k)
141  [476] = "ERR_BADCHANMASK", -- Bad channel mask
142  [477] = "ERR_NOCHANMODES", -- Channel doesn't support modes
143  [478] = "ERR_BANLISTFULL", -- Channel list is full
144  [481] = "ERR_NOPRIVILEGES", -- Permission denied- You're not an IRC operator
145  [482] = "ERR_CHANOPRIVSNEEDED", -- You're not channel operator
146  [483] = "ERR_CANTKILLSERVER", -- You can't kill a server!
147  [484] = "ERR_RESTRICTED", -- Your connection is restricted!
148  [485] = "ERR_UNIQOPPRIVSNEEDED", -- You're not the original channel operator
149  [491] = "ERR_NOOPERHOST", -- No O-lines for your host
150  [501] = "ERR_UMODEUNKNOWNFLAG", -- Unknown MODE flag
151  [502] = "ERR_USERSDONTMATCH", -- Can't change mode for other users
152 -- }}}
153 -- unused {{{
154  [231] = "RPL_SERVICEINFO",
155  [232] = "RPL_ENDOFSERVICES",
156  [233] = "RPL_SERVICE",
157  [300] = "RPL_NONE",
158  [316] = "RPL_WHOISCHANOP",
159  [361] = "RPL_KILLDONE",
160  [362] = "RPL_CLOSING",
161  [363] = "RPL_CLOSEEND",
162  [373] = "RPL_INFOSTART",
163  [384] = "RPL_MYPORTIS",
164  [213] = "RPL_STATSCLINE",
165  [214] = "RPL_STATSNLINE",
166  [215] = "RPL_STATSILINE",
167  [216] = "RPL_STATSKLINE",
168  [217] = "RPL_STATSQLINE",
169  [218] = "RPL_STATSYLINE",
170  [240] = "RPL_STATSVLINE",
171  [241] = "RPL_STATSLLINE",
172  [244] = "RPL_STATSHLINE",
173  [246] = "RPL_STATSPING",
174  [247] = "RPL_STATSBLINE",
175  [250] = "RPL_STATSDLINE",
176  [492] = "ERR_NOSERVICEHOST",
177 -- }}}
178 -- guesses {{{
179  [333] = "RPL_TOPICDATE", -- date the topic was set, in seconds since the epoch
180  [505] = "ERR_NOTREGISTERED" -- freenode blocking privmsg from unreged users
181 -- }}}
182 }
183 -- }}}
184
185 -- chanmodes {{{
186 constants.chanmodes = {
187  ["@"] = "secret",
188  ["*"] = "private",
189  ["="] = "public"
190 }
191 -- }}}
192
193 return constants