mirror of
				https://github.com/1disk/edp445.git
				synced 2024-08-14 22:47:02 +00:00 
			
		
		
		
	added a few messages that the bot would respond to
This commit is contained in:
		
							parent
							
								
									c63d9a6e13
								
							
						
					
					
						commit
						de29e2769c
					
				
					 384 changed files with 56249 additions and 43 deletions
				
			
		
							
								
								
									
										22
									
								
								node_modules/ee-first/LICENSE
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								node_modules/ee-first/LICENSE
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| 
 | ||||
| The MIT License (MIT) | ||||
| 
 | ||||
| Copyright (c) 2014 Jonathan Ong me@jongleberry.com | ||||
| 
 | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the "Software"), to deal | ||||
| in the Software without restriction, including without limitation the rights | ||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
| copies of the Software, and to permit persons to whom the Software is | ||||
| furnished to do so, subject to the following conditions: | ||||
| 
 | ||||
| The above copyright notice and this permission notice shall be included in | ||||
| all copies or substantial portions of the Software. | ||||
| 
 | ||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
| THE SOFTWARE. | ||||
							
								
								
									
										80
									
								
								node_modules/ee-first/README.md
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								node_modules/ee-first/README.md
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,80 @@ | |||
| # EE First | ||||
| 
 | ||||
| [![NPM version][npm-image]][npm-url] | ||||
| [![Build status][travis-image]][travis-url] | ||||
| [![Test coverage][coveralls-image]][coveralls-url] | ||||
| [![License][license-image]][license-url] | ||||
| [![Downloads][downloads-image]][downloads-url] | ||||
| [![Gittip][gittip-image]][gittip-url] | ||||
| 
 | ||||
| Get the first event in a set of event emitters and event pairs, | ||||
| then clean up after itself. | ||||
| 
 | ||||
| ## Install | ||||
| 
 | ||||
| ```sh | ||||
| $ npm install ee-first | ||||
| ``` | ||||
| 
 | ||||
| ## API | ||||
| 
 | ||||
| ```js | ||||
| var first = require('ee-first') | ||||
| ``` | ||||
| 
 | ||||
| ### first(arr, listener) | ||||
| 
 | ||||
| Invoke `listener` on the first event from the list specified in `arr`. `arr` is | ||||
| an array of arrays, with each array in the format `[ee, ...event]`. `listener` | ||||
| will be called only once, the first time any of the given events are emitted. If | ||||
| `error` is one of the listened events, then if that fires first, the `listener` | ||||
| will be given the `err` argument. | ||||
| 
 | ||||
| The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the | ||||
| first argument emitted from an `error` event, if applicable; `ee` is the event | ||||
| emitter that fired; `event` is the string event name that fired; and `args` is an | ||||
| array of the arguments that were emitted on the event. | ||||
| 
 | ||||
| ```js | ||||
| var ee1 = new EventEmitter() | ||||
| var ee2 = new EventEmitter() | ||||
| 
 | ||||
| first([ | ||||
|   [ee1, 'close', 'end', 'error'], | ||||
|   [ee2, 'error'] | ||||
| ], function (err, ee, event, args) { | ||||
|   // listener invoked | ||||
| }) | ||||
| ``` | ||||
| 
 | ||||
| #### .cancel() | ||||
| 
 | ||||
| The group of listeners can be cancelled before being invoked and have all the event | ||||
| listeners removed from the underlying event emitters. | ||||
| 
 | ||||
| ```js | ||||
| var thunk = first([ | ||||
|   [ee1, 'close', 'end', 'error'], | ||||
|   [ee2, 'error'] | ||||
| ], function (err, ee, event, args) { | ||||
|   // listener invoked | ||||
| }) | ||||
| 
 | ||||
| // cancel and clean up | ||||
| thunk.cancel() | ||||
| ``` | ||||
| 
 | ||||
| [npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square | ||||
| [npm-url]: https://npmjs.org/package/ee-first | ||||
| [github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square | ||||
| [github-url]: https://github.com/jonathanong/ee-first/tags | ||||
| [travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square | ||||
| [travis-url]: https://travis-ci.org/jonathanong/ee-first | ||||
| [coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square | ||||
| [coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master | ||||
| [license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square | ||||
| [license-url]: LICENSE.md | ||||
| [downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square | ||||
| [downloads-url]: https://npmjs.org/package/ee-first | ||||
| [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square | ||||
| [gittip-url]: https://www.gittip.com/jonathanong/ | ||||
							
								
								
									
										95
									
								
								node_modules/ee-first/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								node_modules/ee-first/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,95 @@ | |||
| /*! | ||||
|  * ee-first | ||||
|  * Copyright(c) 2014 Jonathan Ong | ||||
|  * MIT Licensed | ||||
|  */ | ||||
| 
 | ||||
| 'use strict' | ||||
| 
 | ||||
| /** | ||||
|  * Module exports. | ||||
|  * @public | ||||
|  */ | ||||
| 
 | ||||
| module.exports = first | ||||
| 
 | ||||
| /** | ||||
|  * Get the first event in a set of event emitters and event pairs. | ||||
|  * | ||||
|  * @param {array} stuff | ||||
|  * @param {function} done | ||||
|  * @public | ||||
|  */ | ||||
| 
 | ||||
| function first(stuff, done) { | ||||
|   if (!Array.isArray(stuff)) | ||||
|     throw new TypeError('arg must be an array of [ee, events...] arrays') | ||||
| 
 | ||||
|   var cleanups = [] | ||||
| 
 | ||||
|   for (var i = 0; i < stuff.length; i++) { | ||||
|     var arr = stuff[i] | ||||
| 
 | ||||
|     if (!Array.isArray(arr) || arr.length < 2) | ||||
|       throw new TypeError('each array member must be [ee, events...]') | ||||
| 
 | ||||
|     var ee = arr[0] | ||||
| 
 | ||||
|     for (var j = 1; j < arr.length; j++) { | ||||
|       var event = arr[j] | ||||
|       var fn = listener(event, callback) | ||||
| 
 | ||||
|       // listen to the event
 | ||||
|       ee.on(event, fn) | ||||
|       // push this listener to the list of cleanups
 | ||||
|       cleanups.push({ | ||||
|         ee: ee, | ||||
|         event: event, | ||||
|         fn: fn, | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   function callback() { | ||||
|     cleanup() | ||||
|     done.apply(null, arguments) | ||||
|   } | ||||
| 
 | ||||
|   function cleanup() { | ||||
|     var x | ||||
|     for (var i = 0; i < cleanups.length; i++) { | ||||
|       x = cleanups[i] | ||||
|       x.ee.removeListener(x.event, x.fn) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   function thunk(fn) { | ||||
|     done = fn | ||||
|   } | ||||
| 
 | ||||
|   thunk.cancel = cleanup | ||||
| 
 | ||||
|   return thunk | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * Create the event listener. | ||||
|  * @private | ||||
|  */ | ||||
| 
 | ||||
| function listener(event, done) { | ||||
|   return function onevent(arg1) { | ||||
|     var args = new Array(arguments.length) | ||||
|     var ee = this | ||||
|     var err = event === 'error' | ||||
|       ? arg1 | ||||
|       : null | ||||
| 
 | ||||
|     // copy args to prevent arguments escaping scope
 | ||||
|     for (var i = 0; i < args.length; i++) { | ||||
|       args[i] = arguments[i] | ||||
|     } | ||||
| 
 | ||||
|     done(err, ee, event, args) | ||||
|   } | ||||
| } | ||||
							
								
								
									
										29
									
								
								node_modules/ee-first/package.json
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								node_modules/ee-first/package.json
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| { | ||||
|   "name": "ee-first", | ||||
|   "description": "return the first event in a set of ee/event pairs", | ||||
|   "version": "1.1.1", | ||||
|   "author": { | ||||
|     "name": "Jonathan Ong", | ||||
|     "email": "me@jongleberry.com", | ||||
|     "url": "http://jongleberry.com", | ||||
|     "twitter": "https://twitter.com/jongleberry" | ||||
|   }, | ||||
|   "contributors": [ | ||||
|     "Douglas Christopher Wilson <doug@somethingdoug.com>" | ||||
|   ], | ||||
|   "license": "MIT", | ||||
|   "repository": "jonathanong/ee-first", | ||||
|   "devDependencies": { | ||||
|     "istanbul": "0.3.9", | ||||
|     "mocha": "2.2.5" | ||||
|   }, | ||||
|   "files": [ | ||||
|     "index.js", | ||||
|     "LICENSE" | ||||
|   ], | ||||
|   "scripts": { | ||||
|     "test": "mocha --reporter spec --bail --check-leaks test/", | ||||
|     "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", | ||||
|     "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" | ||||
|   } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue