ircinch 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/.standard.yml +3 -0
  3. data/CHANGELOG.md +298 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +5 -0
  6. data/LICENSE.txt +23 -0
  7. data/README.md +195 -0
  8. data/Rakefile +14 -0
  9. data/docs/bot_options.md +454 -0
  10. data/docs/changes.md +541 -0
  11. data/docs/common_mistakes.md +60 -0
  12. data/docs/common_tasks.md +57 -0
  13. data/docs/encodings.md +69 -0
  14. data/docs/events.md +273 -0
  15. data/docs/getting_started.md +184 -0
  16. data/docs/logging.md +90 -0
  17. data/docs/migrating.md +267 -0
  18. data/docs/plugins.md +4 -0
  19. data/docs/readme.md +20 -0
  20. data/examples/basic/autovoice.rb +32 -0
  21. data/examples/basic/google.rb +35 -0
  22. data/examples/basic/hello.rb +14 -0
  23. data/examples/basic/join_part.rb +35 -0
  24. data/examples/basic/memo.rb +39 -0
  25. data/examples/basic/msg.rb +15 -0
  26. data/examples/basic/seen.rb +37 -0
  27. data/examples/basic/urban_dict.rb +36 -0
  28. data/examples/basic/url_shorten.rb +36 -0
  29. data/examples/plugins/autovoice.rb +37 -0
  30. data/examples/plugins/custom_prefix.rb +22 -0
  31. data/examples/plugins/dice_roll.rb +38 -0
  32. data/examples/plugins/google.rb +36 -0
  33. data/examples/plugins/hello.rb +21 -0
  34. data/examples/plugins/hooks.rb +34 -0
  35. data/examples/plugins/join_part.rb +41 -0
  36. data/examples/plugins/lambdas.rb +35 -0
  37. data/examples/plugins/last_nick.rb +24 -0
  38. data/examples/plugins/msg.rb +21 -0
  39. data/examples/plugins/multiple_matches.rb +32 -0
  40. data/examples/plugins/own_events.rb +37 -0
  41. data/examples/plugins/seen.rb +44 -0
  42. data/examples/plugins/timer.rb +22 -0
  43. data/examples/plugins/url_shorten.rb +34 -0
  44. data/ircinch.gemspec +43 -0
  45. data/lib/cinch/ban.rb +53 -0
  46. data/lib/cinch/bot.rb +476 -0
  47. data/lib/cinch/cached_list.rb +21 -0
  48. data/lib/cinch/callback.rb +22 -0
  49. data/lib/cinch/channel.rb +465 -0
  50. data/lib/cinch/channel_list.rb +31 -0
  51. data/lib/cinch/configuration/bot.rb +50 -0
  52. data/lib/cinch/configuration/dcc.rb +18 -0
  53. data/lib/cinch/configuration/plugins.rb +43 -0
  54. data/lib/cinch/configuration/sasl.rb +21 -0
  55. data/lib/cinch/configuration/ssl.rb +21 -0
  56. data/lib/cinch/configuration/timeouts.rb +16 -0
  57. data/lib/cinch/configuration.rb +75 -0
  58. data/lib/cinch/constants.rb +535 -0
  59. data/lib/cinch/dcc/dccable_object.rb +39 -0
  60. data/lib/cinch/dcc/incoming/send.rb +149 -0
  61. data/lib/cinch/dcc/incoming.rb +3 -0
  62. data/lib/cinch/dcc/outgoing/send.rb +123 -0
  63. data/lib/cinch/dcc/outgoing.rb +3 -0
  64. data/lib/cinch/dcc.rb +14 -0
  65. data/lib/cinch/exceptions.rb +48 -0
  66. data/lib/cinch/formatting.rb +127 -0
  67. data/lib/cinch/handler.rb +120 -0
  68. data/lib/cinch/handler_list.rb +92 -0
  69. data/lib/cinch/helpers.rb +230 -0
  70. data/lib/cinch/i_support.rb +100 -0
  71. data/lib/cinch/irc.rb +924 -0
  72. data/lib/cinch/log_filter.rb +23 -0
  73. data/lib/cinch/logger/formatted_logger.rb +100 -0
  74. data/lib/cinch/logger/zcbot_logger.rb +26 -0
  75. data/lib/cinch/logger.rb +171 -0
  76. data/lib/cinch/logger_list.rb +88 -0
  77. data/lib/cinch/mask.rb +69 -0
  78. data/lib/cinch/message.rb +397 -0
  79. data/lib/cinch/message_queue.rb +104 -0
  80. data/lib/cinch/mode_parser.rb +78 -0
  81. data/lib/cinch/network.rb +106 -0
  82. data/lib/cinch/open_ended_queue.rb +26 -0
  83. data/lib/cinch/pattern.rb +66 -0
  84. data/lib/cinch/plugin.rb +517 -0
  85. data/lib/cinch/plugin_list.rb +40 -0
  86. data/lib/cinch/rubyext/float.rb +5 -0
  87. data/lib/cinch/rubyext/module.rb +28 -0
  88. data/lib/cinch/rubyext/string.rb +35 -0
  89. data/lib/cinch/sasl/dh_blowfish.rb +73 -0
  90. data/lib/cinch/sasl/diffie_hellman.rb +50 -0
  91. data/lib/cinch/sasl/mechanism.rb +8 -0
  92. data/lib/cinch/sasl/plain.rb +29 -0
  93. data/lib/cinch/sasl.rb +36 -0
  94. data/lib/cinch/syncable.rb +83 -0
  95. data/lib/cinch/target.rb +199 -0
  96. data/lib/cinch/timer.rb +147 -0
  97. data/lib/cinch/user.rb +489 -0
  98. data/lib/cinch/user_list.rb +89 -0
  99. data/lib/cinch/utilities/deprecation.rb +18 -0
  100. data/lib/cinch/utilities/encoding.rb +39 -0
  101. data/lib/cinch/utilities/kernel.rb +15 -0
  102. data/lib/cinch/version.rb +6 -0
  103. data/lib/cinch.rb +7 -0
  104. data/lib/ircinch.rb +7 -0
  105. metadata +205 -0
@@ -0,0 +1,454 @@
1
+ # @title Bot options
2
+ # @markup kramdown
3
+
4
+ # Options
5
+
6
+ ## channels
7
+ Type
8
+ : Array<String>
9
+
10
+ Default value
11
+ : `[]`
12
+
13
+ Description
14
+ : Channels in this list will be joined upon connecting.
15
+
16
+
17
+ ### Notes
18
+ - To automatically join password-protected channels, just append the
19
+ password to the channel's name, separated by a space, e.g.
20
+ `"#mychannel mypassword"`.
21
+
22
+ ## dcc
23
+
24
+ ### dcc.own_ip
25
+ Type
26
+ : String
27
+
28
+ Default value
29
+ : `nil`
30
+
31
+ Description
32
+ : The external IP which should be used for outgoing DCC SENDs. For
33
+ more information see {Cinch::DCC::Outgoing::Send}.
34
+
35
+ ## delay_joins
36
+ Type
37
+ : Number, Symbol
38
+
39
+ Default value
40
+ : `0`
41
+
42
+ Description
43
+ : Delay joining channels N seconds after connecting, or until the event S fires.
44
+
45
+ ### Notes
46
+ - This is especially useful in combination with the /cinch-identify/ plugin, which will trigger the `:identified` event.
47
+
48
+ ## encoding
49
+ Type
50
+ : String, Encoding
51
+
52
+ Default value
53
+ : `:irc`
54
+
55
+ Description
56
+ : This determines which encoding text received from IRC will have.
57
+
58
+
59
+ ### Notes
60
+ - {file:docs/encodings.md More information on how Cinch handles encoding issues}
61
+
62
+ ## local_host
63
+ Type
64
+ : String
65
+
66
+ Default value
67
+ : `nil`
68
+
69
+ Description
70
+ : Which IP/host to bind to when connecting. This is useful for using
71
+ so called "vhosts".
72
+
73
+ ## max_messages
74
+ Type
75
+ : Fixnum
76
+
77
+ Default value
78
+ : `nil`
79
+
80
+ Description
81
+ : When an overlong message gets split, only `max_messages` parts will
82
+ be sent to the recipient.
83
+
84
+
85
+ ### Notes
86
+ - Set this option to `nil` to disable any limit.
87
+
88
+ ## max_reconnect_delay
89
+ Type
90
+ : Fixnum
91
+
92
+ Default value
93
+ : `300`
94
+
95
+ Descriptipn
96
+ : With every unsuccessful reconnection attempt, Cinch increases the
97
+ delay between new attempts. This setting is the maximum number of
98
+ seconds to wait between two attempts.
99
+
100
+ ## messages_per_second
101
+ Type
102
+ : Float
103
+
104
+ Default value
105
+ : Network dependent
106
+
107
+ Description
108
+ : How many incoming messages the server processes per second. This is
109
+ used for throttling.
110
+
111
+
112
+ ### Notes
113
+ - If your bot gets kicked for excess flood, try lowering the value of
114
+ `messages_per_second`.
115
+ - See also: {file:docs/bot_options.md#serverqueuesize `server_queue_size`}
116
+
117
+ ## message_split_end
118
+ Type
119
+ : String
120
+
121
+ Default value
122
+ : `" ..."`
123
+
124
+ Description
125
+ : When a message is too long to be sent as a whole, it will be split
126
+ and the value of this option will be appended to all but the last
127
+ parts of the message.
128
+
129
+
130
+ ## message_split_start
131
+ Type
132
+ : String
133
+
134
+ Default value
135
+ : `"... "`
136
+
137
+ Description
138
+ : When a message is too long to be sent as a whole, it will be split
139
+ and the value of this option will be prepended to all but the first
140
+ parts of the message.
141
+
142
+ ## modes
143
+ Type
144
+ : Array<String>
145
+
146
+ Default value
147
+ : []
148
+
149
+ Description
150
+ : An array of modes the bot should set on itself after connecting.
151
+
152
+ ## nick
153
+ Type
154
+ : String
155
+
156
+ Default value
157
+ : `"cinch"`
158
+
159
+ Description
160
+ : The nickname the bot will use.
161
+
162
+
163
+ ### Notes
164
+ - If the nickname is in use, Cinch will append underscores until it
165
+ finds a free nick.
166
+ - You really should set this option instead of using the default.
167
+
168
+ ## nicks
169
+ Type
170
+ : Array<String>
171
+
172
+ Default value
173
+ : `nil`
174
+
175
+ Description
176
+ : This option overrules {file:docs/bot_options.md#nick `nick`} and allows Cinch
177
+ to try multiple nicks before adding underscores.
178
+
179
+
180
+ ## password
181
+ Type
182
+ : String
183
+
184
+ Default value
185
+ : `nil`
186
+
187
+ Description
188
+ : A server password for access to private servers.
189
+
190
+
191
+ ### Notes
192
+ - Some networks allow you to use the server password for
193
+ authenticating with services (e.g. NickServ).
194
+
195
+
196
+ ## ping_interval
197
+ Type
198
+ : Number
199
+
200
+ Default value
201
+ : `120`
202
+
203
+ Description
204
+ : The server will be pinged every X seconds, to keep the connection
205
+ alive.
206
+
207
+
208
+ ### Notes
209
+ - The ping interval should be smaller than
210
+ {file:docs/bot_options.md#timeoutsread `timeouts.read`} to prevent Cinch from
211
+ falsely declaring a connection dead.
212
+
213
+
214
+ ## plugins
215
+
216
+ ### plugins.plugins
217
+ Type
218
+ : Array<Class>
219
+
220
+ Default value
221
+ : `[]`
222
+
223
+ Description
224
+ : A list of plugins to register.
225
+
226
+
227
+ #### Notes
228
+ - An example: `[Plugin1, Plugin2, Plugin3]` -- Note that we are adding
229
+ the plugin **classes** to the list.
230
+
231
+ ### plugins.prefix
232
+ Type
233
+ : String, Regexp, Lambda
234
+
235
+ Default value
236
+ : `/^!/`
237
+
238
+ Description
239
+ : A prefix that will be prepended to all plugin commands.
240
+
241
+
242
+ ### plugins.suffix
243
+ Type
244
+ : String, Regexp, Lambda
245
+
246
+ Default value
247
+ : `nil`
248
+
249
+ Description
250
+ : A suffix that will be appended to all plugin commands.
251
+
252
+
253
+
254
+ ### plugins.options
255
+ Type
256
+ : Hash
257
+
258
+ Default value
259
+ : `Hash.new {|h,k| h[k] = {}}`
260
+
261
+ Description
262
+ : Options specific to plugins.
263
+
264
+
265
+ #### Notes
266
+ - Information on plugins and options for those will be made available
267
+ in a separate document soon.
268
+
269
+
270
+ ## port
271
+ Type
272
+ : Fixnum
273
+
274
+ Default value
275
+ : `6667`
276
+
277
+ Description
278
+ : The port the IRC server is listening on
279
+
280
+
281
+ ## realname
282
+ Type
283
+ : String
284
+
285
+ Default value
286
+ : `"cinch"`
287
+
288
+ Description
289
+ : The real name Cinch will connect with.
290
+
291
+ ## reconnect
292
+ Type
293
+ : Boolean
294
+
295
+ Default value
296
+ : `true`
297
+
298
+ Description
299
+ : Should Cinch attempt to reconnect after a connection loss?
300
+
301
+ ## sasl
302
+
303
+ ### sasl.username
304
+ Type
305
+ : String
306
+
307
+ Default value
308
+ : `nil`
309
+
310
+ Description
311
+ : The username to use for SASL authentication.
312
+
313
+ ### sasl.password
314
+ Type
315
+ : String
316
+
317
+ Default value
318
+ : `nil`
319
+
320
+ Description
321
+ : The password to use for SASL authentication.
322
+
323
+ ### sasl.mechanisms
324
+ Type
325
+ : Array<Cinch::SASL::Mechanism>
326
+
327
+ Default value
328
+ : `[Cinch::SASL::DhBlowfish, Cinch::SASL::Plain]`
329
+
330
+ Description
331
+ : The SASL mechanisms to use. All mechanisms in the array will be
332
+ attempted, until one was successful
333
+
334
+ ## server
335
+ Type
336
+ : String
337
+
338
+ Default value
339
+ : `"localhost"`
340
+
341
+ Description
342
+ : The IRC server to connect to
343
+
344
+
345
+ ## server_queue_size
346
+ Type
347
+ : Fixnum
348
+
349
+ Default value
350
+ : Network dependent
351
+
352
+ Description
353
+ : The number of incoming messages the server will queue, before
354
+ killing the bot for excess flood.
355
+
356
+
357
+ ### Notes
358
+ - If your bot gets kicked for excess flood, try lowering the value of
359
+ `server_queue_size`.
360
+ - See also: {file:docs/bot_options.md#messagespersecond `messages_per_second`}
361
+
362
+ ## ssl
363
+
364
+ ### ssl.use
365
+ Type
366
+ : Boolean
367
+
368
+ Default value
369
+ : `false`
370
+
371
+ Description
372
+ : Sets if SSL should be used
373
+
374
+ ### ssl.verify
375
+ Type
376
+ : Boolean
377
+
378
+ Default value
379
+ : `false`
380
+
381
+ Description
382
+ : Sets if the SSL certificate should be verified
383
+
384
+
385
+ ### ssl.ca_path
386
+ Type
387
+ : String
388
+
389
+ Default value
390
+ : `"/etc/ssl/certs"`
391
+
392
+ Description
393
+ : The path to a directory with certificates. This has to be set
394
+ properly for {file:docs/bot_options.md#sslverify `ssl.verify`} to work.
395
+
396
+
397
+ ### ssl.client_cert
398
+ Type
399
+ : String
400
+
401
+ Default value
402
+ : `nil`
403
+
404
+ Description
405
+ : The path to a client certificate, which some networks can use for
406
+ authentication (see {http://www.oftc.net/oftc/NickServ/CertFP})
407
+
408
+
409
+ #### Notes
410
+ - You will want to set the correct port when using SSL
411
+
412
+ ## user
413
+ Type
414
+ : String
415
+
416
+ Default value
417
+ : `"cinch"`
418
+
419
+ Description
420
+ : The user name to use when connecting to the IRC server.
421
+
422
+ ## timeouts
423
+
424
+ ### timeouts.read
425
+ Type
426
+ : Number
427
+
428
+ Default value
429
+ : `240`
430
+
431
+ Description
432
+ : If no data has been received for this amount of seconds, the
433
+ connection will be considered dead.
434
+
435
+
436
+ ### timeouts.connect
437
+ Type
438
+ : Number
439
+
440
+ Default value
441
+ : `10`
442
+
443
+ Description
444
+ : Give up connecting after this amount of seconds.
445
+
446
+ ## default_logger_level
447
+ Type
448
+ : Symbol
449
+
450
+ Default value
451
+ : `:debug`
452
+
453
+ Description
454
+ : Modify the log level of the default logger, for instance, the bot will log very little if you set this value to `:fatal`.