grinch 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +1 -0
  3. data/LICENSE +22 -0
  4. data/README.md +180 -0
  5. data/docs/bot_options.md +454 -0
  6. data/docs/changes.md +541 -0
  7. data/docs/common_mistakes.md +60 -0
  8. data/docs/common_tasks.md +57 -0
  9. data/docs/encodings.md +69 -0
  10. data/docs/events.md +273 -0
  11. data/docs/getting_started.md +184 -0
  12. data/docs/logging.md +90 -0
  13. data/docs/migrating.md +267 -0
  14. data/docs/plugins.md +4 -0
  15. data/docs/readme.md +20 -0
  16. data/examples/basic/autovoice.rb +32 -0
  17. data/examples/basic/google.rb +35 -0
  18. data/examples/basic/hello.rb +15 -0
  19. data/examples/basic/join_part.rb +34 -0
  20. data/examples/basic/memo.rb +39 -0
  21. data/examples/basic/msg.rb +16 -0
  22. data/examples/basic/seen.rb +36 -0
  23. data/examples/basic/urban_dict.rb +35 -0
  24. data/examples/basic/url_shorten.rb +35 -0
  25. data/examples/plugins/autovoice.rb +37 -0
  26. data/examples/plugins/custom_prefix.rb +23 -0
  27. data/examples/plugins/dice_roll.rb +38 -0
  28. data/examples/plugins/google.rb +36 -0
  29. data/examples/plugins/hello.rb +22 -0
  30. data/examples/plugins/hooks.rb +36 -0
  31. data/examples/plugins/join_part.rb +42 -0
  32. data/examples/plugins/lambdas.rb +35 -0
  33. data/examples/plugins/last_nick.rb +24 -0
  34. data/examples/plugins/msg.rb +22 -0
  35. data/examples/plugins/multiple_matches.rb +32 -0
  36. data/examples/plugins/own_events.rb +37 -0
  37. data/examples/plugins/seen.rb +45 -0
  38. data/examples/plugins/timer.rb +22 -0
  39. data/examples/plugins/url_shorten.rb +33 -0
  40. data/lib/cinch.rb +5 -0
  41. data/lib/cinch/ban.rb +50 -0
  42. data/lib/cinch/bot.rb +479 -0
  43. data/lib/cinch/cached_list.rb +19 -0
  44. data/lib/cinch/callback.rb +20 -0
  45. data/lib/cinch/channel.rb +463 -0
  46. data/lib/cinch/channel_list.rb +29 -0
  47. data/lib/cinch/configuration.rb +73 -0
  48. data/lib/cinch/configuration/bot.rb +48 -0
  49. data/lib/cinch/configuration/dcc.rb +16 -0
  50. data/lib/cinch/configuration/plugins.rb +41 -0
  51. data/lib/cinch/configuration/sasl.rb +19 -0
  52. data/lib/cinch/configuration/ssl.rb +19 -0
  53. data/lib/cinch/configuration/timeouts.rb +14 -0
  54. data/lib/cinch/constants.rb +533 -0
  55. data/lib/cinch/dcc.rb +12 -0
  56. data/lib/cinch/dcc/dccable_object.rb +37 -0
  57. data/lib/cinch/dcc/incoming.rb +1 -0
  58. data/lib/cinch/dcc/incoming/send.rb +147 -0
  59. data/lib/cinch/dcc/outgoing.rb +1 -0
  60. data/lib/cinch/dcc/outgoing/send.rb +122 -0
  61. data/lib/cinch/exceptions.rb +46 -0
  62. data/lib/cinch/formatting.rb +125 -0
  63. data/lib/cinch/handler.rb +118 -0
  64. data/lib/cinch/handler_list.rb +90 -0
  65. data/lib/cinch/helpers.rb +231 -0
  66. data/lib/cinch/irc.rb +924 -0
  67. data/lib/cinch/isupport.rb +98 -0
  68. data/lib/cinch/log_filter.rb +21 -0
  69. data/lib/cinch/logger.rb +168 -0
  70. data/lib/cinch/logger/formatted_logger.rb +97 -0
  71. data/lib/cinch/logger/zcbot_logger.rb +22 -0
  72. data/lib/cinch/logger_list.rb +85 -0
  73. data/lib/cinch/mask.rb +69 -0
  74. data/lib/cinch/message.rb +392 -0
  75. data/lib/cinch/message_queue.rb +107 -0
  76. data/lib/cinch/mode_parser.rb +76 -0
  77. data/lib/cinch/network.rb +104 -0
  78. data/lib/cinch/open_ended_queue.rb +26 -0
  79. data/lib/cinch/pattern.rb +65 -0
  80. data/lib/cinch/plugin.rb +515 -0
  81. data/lib/cinch/plugin_list.rb +38 -0
  82. data/lib/cinch/rubyext/float.rb +3 -0
  83. data/lib/cinch/rubyext/module.rb +26 -0
  84. data/lib/cinch/rubyext/string.rb +33 -0
  85. data/lib/cinch/sasl.rb +34 -0
  86. data/lib/cinch/sasl/dh_blowfish.rb +71 -0
  87. data/lib/cinch/sasl/diffie_hellman.rb +47 -0
  88. data/lib/cinch/sasl/mechanism.rb +6 -0
  89. data/lib/cinch/sasl/plain.rb +26 -0
  90. data/lib/cinch/syncable.rb +83 -0
  91. data/lib/cinch/target.rb +199 -0
  92. data/lib/cinch/timer.rb +145 -0
  93. data/lib/cinch/user.rb +488 -0
  94. data/lib/cinch/user_list.rb +87 -0
  95. data/lib/cinch/utilities/deprecation.rb +16 -0
  96. data/lib/cinch/utilities/encoding.rb +37 -0
  97. data/lib/cinch/utilities/kernel.rb +13 -0
  98. data/lib/cinch/version.rb +4 -0
  99. metadata +140 -0
data/docs/changes.md ADDED
@@ -0,0 +1,541 @@
1
+ # @title What has changed?
2
+ # @markup kramdown
3
+
4
+ # What has changed in 2.2?
5
+
6
+ ## Getting rid of CP1252 in favour of UTF-8
7
+
8
+ In versions before 2.2, when using the `irc` encoding (the default),
9
+ Cinch would use CP1252 for outgoing messages, only falling back to
10
+ UTF-8 if a message wouldn't fit into CP1252. This is a so called
11
+ hybrid encoding, which is used by X-Chat and the like.
12
+
13
+ This encoding, however, is based on the state of 10 years ago, where
14
+ the most popular IRC clients, such as mIRC, weren't capable of
15
+ handling UTF-8. Nowadays, there are more clients that support UTF-8
16
+ than there are clients that can deal with this hybrid encoding, or
17
+ CP1252 itself. That's why, from now on, we will always use UTF-8.
18
+
19
+ If you depend on outgoing messages being encoded in CP1252, please see
20
+ {file:docs/encodings.md} on how to change the encoding.
21
+
22
+ ## API improvements
23
+
24
+ ### New methods
25
+
26
+ - {Cinch::Channel#remove} has been added to support the non-standard
27
+ REMOVE command, a friendlier alternative to kicking people.
28
+
29
+ - {Cinch::Helpers.sanitize} and {Cinch::Formatting.unformat} have been
30
+ added to help with removing unprintable characters and mIRC
31
+ formatting codes from strings.
32
+
33
+ ### Deprecated methods
34
+
35
+ In order to reduce the amount of aliases, the following ones have been
36
+ deprecated and will be removed in a future release:
37
+
38
+ - {Cinch::Channel#msg}
39
+ - {Cinch::Channel#privmsg}
40
+ - {Cinch::Target#msg}
41
+ - {Cinch::Target#privmsg}
42
+ - {Cinch::Target#safe_msg}
43
+ - {Cinch::Target#safe_privmsg}
44
+ - {Cinch::User#whois}
45
+ - {Cinch::Helpers#Color}
46
+
47
+ Additionally, the following method is deprecated and will be removed
48
+ in the future:
49
+
50
+ - {Cinch::Channel#to_str}
51
+
52
+ # What has changed in 2.1?
53
+ 1. Color stripping
54
+ 1. Per group hooks
55
+ 1. API improvements
56
+ 1. New methods
57
+ 1. Changed methods
58
+ 1. New aliases
59
+
60
+ ## Color stripping
61
+
62
+ The new method <del>`Cinch::Utilities::String.strip_colors`</del>
63
+ {Cinch::Formatting.unformat} allows removal of mIRC color codes from
64
+ messages.
65
+
66
+ Additionally, a new match option called `strip_colors` makes it
67
+ possible to automatically and temporarily strip color codes before
68
+ attempting to match a message.
69
+
70
+ ## Per group hooks
71
+
72
+ A new option `group` for hooks allows registering hooks for specific
73
+ groups.
74
+
75
+ ## API improvements
76
+
77
+ ### New methods
78
+
79
+ #### {Cinch::Bot}
80
+
81
+ - {Cinch::Bot#oper}
82
+
83
+ #### {Cinch::User}
84
+
85
+ - {Cinch::User#oper?}
86
+
87
+ #### {Cinch::Message}
88
+
89
+ - {Cinch::Message#action_reply}
90
+ - {Cinch::Message#safe_action_reply}
91
+
92
+ ### Changed methods
93
+
94
+ #### {Cinch::Handler}
95
+
96
+ - {Cinch::Handler#call} now returns the started thread.
97
+
98
+ #### {Cinch::HandlerList}
99
+
100
+ - {Cinch::HandlerList#dispatch} now returns the started threads.
101
+
102
+ ### New aliases
103
+
104
+ Due to some unfortunate naming mistakes in Cinch 2.0, Cinch 2.1 adds
105
+ several aliases. All of the new aliases deprecate the original method
106
+ names, which will be removed in Cinch 3.0.
107
+
108
+ #### {Cinch::User}
109
+ - {Cinch::User#monitored?} for {Cinch::User#monitored}
110
+ - {Cinch::User#synced?} for {Cinch::User#synced}
111
+
112
+
113
+
114
+ # What has changed in 2.0?
115
+ 1. Added support for SASL
116
+ 1. Added support for DCC SEND
117
+ 1. Added a fair scheduler for outgoing messages
118
+ 1. Added required plugin options
119
+ 1. Added support for colors/formatting
120
+ 1. Added network discovery
121
+ 1. Added match groups
122
+ 1. Added match options overwriting plugin options
123
+ 1. Added support for actions (/me)
124
+ 1. Added support for broken IRC networks
125
+ 1. Dynamic timers
126
+ 1. Reworked logging facilities
127
+ 1. API improvements
128
+ 1. Helper changes
129
+ 1. Added a Cinch::Target Target class
130
+ 1. Cinch::Constants
131
+ 1. New methods
132
+ 1. Removed/Renamed methods
133
+ 1. Handlers
134
+ 1. The Plugin class
135
+ 1. Channel/Target/User implement Comparable
136
+ 1. Renamed `*Manager` to `*List`
137
+ 1. New events
138
+
139
+ ## Added support for SASL
140
+
141
+ Cinch now supports authenticating to services via SASL. For more
142
+ information check {Cinch::SASL}.
143
+
144
+ ## Added support for DCC SEND
145
+
146
+ Support for sending and receiving files via DCC has been added to
147
+ Cinch. Check {Cinch::DCC} for more information.
148
+
149
+ ## Added a fair scheduler for outgoing messages
150
+ Cinch always provided sophisticated throttling to avoid getting kicked
151
+ due to _excess flood_. One major flaw, however, was that it used a
152
+ single FIFO for all messages, thus preferring early message targets
153
+ and penalizing later ones.
154
+
155
+ Now Cinch uses a round-robin approach, having one queue per message
156
+ target (channels and users) and one for generic commands.
157
+
158
+ ## Added required plugin options
159
+
160
+ Plugins can now require specific options to be set. If any of those
161
+ options are not set, the plugin will automatically refuse being
162
+ loaded.
163
+
164
+ This is useful for example for plugins that require API keys to
165
+ interact with web services.
166
+
167
+ The new attribute is called
168
+ {Cinch::Plugin::ClassMethods#required_options required_options}.
169
+
170
+ Example:
171
+
172
+ class MyPlugin
173
+ include Cinch::Plugin
174
+
175
+ set :required_options, [:foo, :bar]
176
+ # ...
177
+ end
178
+
179
+ # ...
180
+
181
+ bot.configure do |c|
182
+ c.plugins.plugins = [MyPlugin]
183
+ c.plugins.options[MyPlugin] = {:foo => 1}
184
+ end
185
+
186
+ # The plugin won't load because the option :bar is not set.
187
+ # Instead it will print a warning.
188
+
189
+ ## Added support for colors/formatting
190
+
191
+ A new {Cinch::Formatting module} and {Cinch::Helpers#Format helper}
192
+ for adding colors and formatting to messages has been added. See the
193
+ {Cinch::Formatting module's documentation} for more information on
194
+ usage.
195
+
196
+ ## Added support for network discovery
197
+
198
+ Cinch now tries to detect the network it connects to, including the
199
+ running IRCd. For most parts this is only interesting internally, but
200
+ if you're writing advanced plugins that hook directly into IRC and
201
+ needs to be aware of available features/quirks, check out
202
+ {Cinch::IRC#network} and {Cinch::Network}.
203
+
204
+ ## Reworked logging facilities
205
+
206
+ The logging API has been drastically improved. Check the
207
+ {file:docs/logging.md logging documentation} for more information.
208
+
209
+
210
+ ## Added match groups
211
+
212
+ A new option for matchers, `:group`, allows grouping multiple matchers
213
+ to a group. What's special is that in any group, only the first
214
+ matching handler will be executed.
215
+
216
+ Example:
217
+
218
+ class Foo
219
+ include Cinch::Plugin
220
+
221
+ match /foo (\d+)/, group: :blegh, method: :foo1
222
+ match /foo (.+)/, group: :blegh, method: :foo2
223
+ match /foo .+/, method: :foo3
224
+ def foo1(m, arg)
225
+ m.reply "foo1"
226
+ end
227
+
228
+ def foo2(m, arg)
229
+ m.reply "foo2"
230
+ end
231
+
232
+ def foo3(m)
233
+ m.reply "foo3"
234
+ end
235
+ end
236
+ # 02:05:39 dominikh │ !foo 123
237
+ # 02:05:40 cinch │ foo1
238
+ # 02:05:40 cinch │ foo3
239
+
240
+ # 02:05:43 dominikh │ !foo bar
241
+ # 02:05:44 cinch │ foo2
242
+ # 02:05:44 cinch │ foo3
243
+
244
+
245
+ ## Added match options overwriting plugin options
246
+
247
+ Matchers now have their own `:prefix`, `:suffix` and `:react_on`
248
+ options which overwrite plugin options for single matchers.
249
+
250
+
251
+ ## Added support for actions (/me)
252
+
253
+ A new event, {`:action`} has been added and can be used for matching
254
+ actions as follows:
255
+
256
+ match "kicks the bot", react_on: :action
257
+ def execute(m)
258
+ m.reply "Ouch!"
259
+ end
260
+
261
+ ## API improvements
262
+
263
+ ### Helper changes
264
+
265
+ The helper methods {Cinch::Helpers#User User()} and
266
+ {Cinch::Helpers#Channel Channel()} have been extracted from
267
+ {Cinch::Bot} and moved to {Cinch::Helpers their own module} which can
268
+ be reused in various places.
269
+
270
+ ### Added a {Cinch::Target Target} class
271
+
272
+ Since {Cinch::Channel} and {Cinch::User} share one common interface
273
+ for sending messages, it only makes sense to have a common base class.
274
+ {Cinch::Target This new class} takes care of sending messages and
275
+ removes this responsibility from {Cinch::Channel}, {Cinch::User} and
276
+ {Cinch::Bot}
277
+
278
+ ### {Cinch::Constants}
279
+
280
+ All constants for IRC numeric replies (`RPL_*` and `ERR_*`) have been
281
+ moved from {Cinch} to {Cinch::Constants}
282
+
283
+ ### New methods
284
+
285
+ #### {Cinch::Bot}
286
+
287
+ - {Cinch::Bot#channel_list}
288
+ - {Cinch::Bot#handlers}
289
+ - {Cinch::Bot#loggers}
290
+ - {Cinch::Bot#loggers=}
291
+ - {Cinch::Bot#modes}
292
+ - {Cinch::Bot#modes=}
293
+ - {Cinch::Bot#set_mode}
294
+ - {Cinch::Bot#unset_mode}
295
+ - {Cinch::Bot#user_list}
296
+
297
+ #### {Cinch::Channel}
298
+
299
+ - {Cinch::Channel#admins}
300
+ - {Cinch::Channel#half_ops}
301
+ - {Cinch::Channel#ops}
302
+ - {Cinch::Channel#owners}
303
+ - {Cinch::Channel#voiced}
304
+
305
+ #### {Cinch::Helpers}
306
+
307
+ - {Cinch::Helpers#Target} -- For creating a {Cinch::Target Target} which can receive messages
308
+ - {Cinch::Helpers#Timer} -- For creating new timers anywhere
309
+ - {Cinch::Helpers#rescue_exception} -- For rescueing and automatically logging an exception
310
+ - {Cinch::Helpers#Format} -- For adding colors and formatting to messages
311
+
312
+ ##### Logging shortcuts
313
+ - {Cinch::Helpers#debug}
314
+ - {Cinch::Helpers#error}
315
+ - {Cinch::Helpers#exception}
316
+ - {Cinch::Helpers#fatal}
317
+ - {Cinch::Helpers#incoming}
318
+ - {Cinch::Helpers#info}
319
+ - {Cinch::Helpers#log}
320
+ - {Cinch::Helpers#outgoing}
321
+ - {Cinch::Helpers#warn}
322
+
323
+ #### {Cinch::IRC}
324
+
325
+ - {Cinch::IRC#network}
326
+
327
+ #### {Cinch::Message}
328
+
329
+ - {Cinch::Message#action?}
330
+ - {Cinch::Message#action_message}
331
+ - {Cinch::Message#target}
332
+ - {Cinch::Message#time}
333
+
334
+ #### {Cinch::Plugin}
335
+
336
+ - {Cinch::Plugin#handlers}
337
+ - {Cinch::Plugin#timers}
338
+ - {Cinch::Plugin#unregister}
339
+
340
+ #### {Cinch::User}
341
+
342
+ - {Cinch::User#away}
343
+ - {Cinch::User#dcc_send} - See {Cinch::DCC::Outgoing::Send}
344
+ - {Cinch::User#match}
345
+ - {Cinch::User#monitor} - See {file:docs/common_tasks.md#checking-if-a-user-is-online Checking if a user is online}
346
+ - {Cinch::User#monitored}
347
+ - {Cinch::User#online?}
348
+ - {Cinch::User#unmonitor}
349
+
350
+ ### Handlers
351
+
352
+ Internally, Cinch uses {Cinch::Handler Handlers} for listening to and
353
+ matching events. In previous versions, this was hidden from the user,
354
+ but now they're part of the public API, providing valuable information
355
+ and the chance to {Cinch::Handler#unregister unregister handlers}
356
+ alltogether.
357
+
358
+ {Cinch::Bot#on} now returns the created handler and
359
+ {Cinch::Plugin#handlers} allows getting a plugin's registered
360
+ handlers.
361
+
362
+ ### Removed/Renamed methods
363
+ The following methods have been removed:
364
+
365
+ | Removed method | Replacement |
366
+ |----------------------------------------+---------------------------------------------------------------------------------|
367
+ | Cinch::Bot#halt | `next` or `break` (Ruby keywords) |
368
+ | Cinch::Bot#raw | {Cinch::IRC#send} |
369
+ | Cinch::Bot#msg | {Cinch::Target#msg} |
370
+ | Cinch::Bot#notice | {Cinch::Target#notice} |
371
+ | Cinch::Bot#safe_msg | {Cinch::Target#safe_msg} |
372
+ | Cinch::Bot#safe_notice | {Cinch::Target#safe_notice} |
373
+ | Cinch::Bot#action | {Cinch::Target#action} |
374
+ | Cinch::Bot#safe_action | {Cinch::Target#safe_action} |
375
+ | Cinch::Bot#dispatch | {Cinch::HandlerList#dispatch} |
376
+ | Cinch::Bot#register_plugins | {Cinch::PluginList#register_plugins} |
377
+ | Cinch::Bot#register_plugin | {Cinch::PluginList#register_plugin} |
378
+ | Cinch::Bot#logger | {Cinch::Bot#loggers} |
379
+ | Cinch::Bot#logger= | |
380
+ | Cinch::Bot#debug | {Cinch::LoggerList#debug} |
381
+ | Cinch::IRC#message | {Cinch::IRC#send} |
382
+ | Cinch::Logger::Logger#log_exception | {Cinch::Logger#exception} |
383
+ | Class methods in Plugin to set options | A new {Cinch::Plugin::ClassMethods#set set} method as well as attribute setters |
384
+
385
+
386
+ ### The Plugin class
387
+
388
+ The {Cinch::Plugin Plugin} class has been drastically improved to look
389
+ and behave more like a proper Ruby class instead of being some
390
+ abstract black box.
391
+
392
+ All attributes of a plugin (name, help message, matchers, …) are being
393
+ made available via attribute getters and setters. Furthermore, it is
394
+ possible to access a Plugin instance's registered handlers and timers,
395
+ as well as unregister plugins.
396
+
397
+ For a complete overview of available attributes and methods, see
398
+ {Cinch::Plugin} and {Cinch::Plugin::ClassMethods}.
399
+
400
+ ### Plugin options
401
+
402
+ The aforementioned changes also affect the way plugin options are
403
+ being set: Plugin options aren't set with DSL-like methods anymore but
404
+ instead are made available via {Cinch::Plugin::ClassMethods#set a
405
+ `set` method} or alternatively plain attribute setters.
406
+
407
+ See
408
+ {file:docs/migrating.md#plugin-options the migration guide} for more
409
+ information.
410
+
411
+ ### Channel/Target/User implement Comparable
412
+
413
+ {Cinch::Target} and thus {Cinch::Channel} and {Cinch::User} now
414
+ implement the Comparable interface, which makes them sortable by all
415
+ usual Ruby means.
416
+
417
+ ### Renamed `*Manager` to `*List`
418
+
419
+ `Cinch::ChannelManager` and `Cinch::UserManager` have been renamed to
420
+ {Cinch::ChannelList} and {Cinch::UserList} respectively.
421
+
422
+ ## Added support for broken IRC networks
423
+ Special support for the following flawed IRC networks has been added:
424
+
425
+ - JustinTV
426
+ - NGameTV
427
+ - IRCnet
428
+
429
+ ## Dynamic timers
430
+
431
+ It is now possible to create new timers from any method/handler. It is
432
+ also possible to {Cinch::Timer#stop stop existing timers} or
433
+ {Cinch::Timer#start restart them}.
434
+
435
+ The easiest way of creating new timers is by using the
436
+ {Cinch::Helpers#Timer Timer helper method}, even though it is also
437
+ possible, albeit more complex, to create instances of {Cinch::Timer}
438
+ directly.
439
+
440
+ Example:
441
+
442
+ match /remind me in (\d+) seconds/
443
+ def execute(m, seconds)
444
+ Timer(seconds.to_i, shots: 1) do
445
+ m.reply "This is your reminder.", true
446
+ end
447
+ end
448
+
449
+ For more information on timers, see the {Cinch::Timer Timer documentation}.
450
+
451
+ ## New options
452
+
453
+ - :{file:docs/bot_options.md#dccownip dcc.own_ip}
454
+ - :{file:docs/bot_options.md#modes modes}
455
+ - :{file:docs/bot_options.md#maxreconnectdelay max_reconnect_delay}
456
+ - :{file:docs/bot_options.md#localhost local_host}
457
+ - :{file:docs/bot_options.md#delayjoins delay_joins}
458
+ - :{file:docs/bot_options.md#saslusername sasl.username}
459
+ - :{file:docs/bot_options.md#saslpassword sasl.password}
460
+
461
+ ## New events
462
+ - :{file:docs/events.md#action action}
463
+ - :{file:docs/events.md#away away}
464
+ - :{file:docs/events.md#unaway unaway}
465
+ - :{file:docs/events.md#dccsend dcc_send}
466
+ - :{file:docs/events.md#owner owner}
467
+ - :{file:docs/events.md#dehalfop-deop-deowner-devoice deowner}
468
+ - :{file:docs/events.md#leaving leaving}
469
+ - :{file:docs/events.md#online online}
470
+ - :{file:docs/events.md#offline offline}
471
+
472
+
473
+ # What has changed in 1.1?
474
+ 1. **New events**
475
+ 2. **New methods**
476
+ 3. **New options**
477
+ 4. **Improved logger**
478
+ x. **Deprecated methods**
479
+
480
+ ## New events
481
+
482
+ - :{file:docs/events.md#op op}
483
+ - :{file:docs/events.md#dehalfop-deop-deowner-devoice deop}
484
+ - :{file:docs/events.md#voice voice}
485
+ - :{file:docs/events.md#dehalfop-deop-deowner-devoice devoice}
486
+ - :{file:docs/events.md#halfop halfop}
487
+ - :{file:docs/events.md#dehalfop-deop-deowner-devoice dehalfop}
488
+ - :{file:docs/events.md#ban ban}
489
+ - :{file:docs/events.md#unban unban}
490
+ - :{file:docs/events.md#modechange mode_change}
491
+ - :{file:docs/events.md#catchall catchall}
492
+
493
+ Additionally, plugins are now able to send their own events by using
494
+ Cinch::Bot#dispatch.
495
+
496
+ ## New methods
497
+
498
+ ### {Cinch::User#last_nick}
499
+ Stores the last nick of a user. This can for example be used in `on
500
+ :nick` to compare a user's old nick against the new one.
501
+
502
+ ### Cinch::User#notice, Cinch::Channel#notice and Cinch::Bot#notice
503
+ For sending notices.
504
+
505
+ ### {Cinch::Message#to_s}
506
+ Provides a nicer representation of {Cinch::Message} objects.
507
+
508
+ ### {Cinch::Channel#has_user?}
509
+ Provides an easier way of checking if a given user is in a channel
510
+
511
+ ## New options
512
+ - {file:docs/bot_options.md#pluginssuffix plugins.suffix}
513
+ - {file:docs/bot_options.md#ssluse ssl.use}
514
+ - {file:docs/bot_options.md#sslverify ssl.verify}
515
+ - {file:docs/bot_options.md#sslcapath ssl.ca_path}
516
+ - {file:docs/bot_options.md#sslclientcert ssl.client_cert}
517
+ - {file:docs/bot_options.md#nicks nicks}
518
+ - {file:docs/bot_options.md#timeoutsread timeouts.read}
519
+ - {file:docs/bot_options.md#timeoutsconnect timeouts.connect}
520
+ - {file:docs/bot_options.md#pinginterval ping_interval}
521
+ - {file:docs/bot_options.md#reconnect reconnect}
522
+
523
+
524
+
525
+ ## Improved logger
526
+ The {Cinch::Logger::FormattedLogger formatted logger} (which is the
527
+ default one) now contains timestamps. Furthermore, it won't emit color
528
+ codes if not writing to a TTY.
529
+
530
+ Additionally, it can now log any kind of object, not only strings.
531
+
532
+ ## Deprecated methods
533
+
534
+ | Deprecated method | Replacement |
535
+ |-----------------------------+------------------------------------|
536
+ | Cinch::User.find_ensured | Cinch::UserManager#find_ensured |
537
+ | Cinch::User.find | Cinch::UserManager#find |
538
+ | Cinch::User.all | Cinch::UserManager#each |
539
+ | Cinch::Channel.find_ensured | Cinch::ChannelManager#find_ensured |
540
+ | Cinch::Channel.find | Cinch::ChannelManager#find |
541
+ | Cinch::Channel.all | Cinch::ChannelManager#each |