![]() ![]() The benefit of using an event-based collector over. maxProcessed: Number of messages encountered (no matter the filter result).max: Number of messages to successfully pass the filter.time: Amount of time in milliseconds the collector should run for.You can control when a collector ends by supplying additional option keys when creating a collector: Once the collector finishes collecting based on the provided end conditions the end event emits. In the above example, you simply log the message. This message is then passed into the event listener as collected and the provided function is executed. If a message passes through the filter, it will trigger the collect event for the collector you've created. ![]() Note that the above example uses implicit return open in new window for the filter function and passes it to the options object using the object property shorthand open in new window notation. If you don't provide a filter all messages in the channel the collector was started on will be collected. To check for multiple conditions in your filter you can connect them using logical operators open in new window. The value to this key should be a function that returns a boolean value to indicate if this message should be collected or not. You can provide a filter key to the object parameter of createMessageCollector(). Image manipulation with Cache customization. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |