If the promise returned by logout() rejects, previously
it would be completely uncaught, and just return an
eternally pending promise that never resolved.
Related to pull requests #828 and #839.
* add test for Client.destroy()
* propagate errors in ClientManager.destroy
If the promise returned by logout() rejects, previously
it would be completely uncaught, and just return an
eternally pending promise that never resolved.
* fix RESTMethods.logout
Without a data argument, the POST that superagent sends causes
the discord server to reply with a HTTP 400 error:
text: '{"Content-Type": "Expected Content-Type to be one of set([\'application/json\'])."}',
* fix Client.destroy
_timeouts and _intervals were changed to Set objects in
commit 6ede7a32fd a month ago.
Changing them to arrays causes failures if you try to reuse
the client object again.
* always close websocket in ClientManager.destroy
Invoking logout does not implicitly cause the server to close
the websocket for you, so cleanup everything.
Otherwise the websocket being open keeps node alive and hanging
mysteriously until the connection hits a timeout.
* fix indentation for eslint
* add documentation for events, and add a disconnect event, because i know people use that
* generate docs, and fix a hastily copied docstring
* fix permissions freak out