Commit Graph

41 Commits

Author SHA1 Message Date
Gus Caplan
63e54982f4 Errors Standardization (#1246)
* errors and stuff

* more errors

* all the errors

* fix build
2017-06-25 18:48:05 +01:00
Gus Caplan
0baa59b679 Internal API Request Rewrite (#1490)
* start rewrite

* converted guilds

* more changes

* convert GuildMember

* convert User and remove friend methods which kill people

* convert more stuff

* even more stuff

* make things nicer

* speed and fixes and stuff

* almost finished

* fix

* Update Client.js

* uwu

* Update RESTMethods.js

* message editing

* fix router

* fix issue with references

* message delete reason

* move message sending

* fix dm

* message splitting

* NO MORE REST METHODS

* Update Client.js

* Update WebhookClient.js

* remove all those endpoints from the constants

* Update ClientUser.js

* Update ClientUser.js

* fixes

* Update ClientUser.js

* complaiancy

* all sort of fixes

* merge master (#1)

* Fix Permissions now that member is deprecated (#1491)

* removing more deprecation leftovers (#1492)

* Fix MessageCollectors

* Fix awaitMessages (#1493)

* Fix MessageCollector#cleanup

* Fix MessageCollector#postCheck

* Add max option back for safety

* Update Invite.js (#1496)

* guild setPosition missing docs (#1498)

* missing docs

* update return docs

* indent

* switched .invites for the apirouter and invite.js

* make multiple options an object

* Update ClientUser.js

* fix nicks

* Update WebhookClient.js
2017-05-21 07:04:19 +02:00
Drahcirius
d11a658f40 invalid token errors not rejected properly (#1478)
* ready event will now throw errors properly

* ws login rejection fix
2017-05-10 11:14:39 -04:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
Amish Shah
195fcfa15c Rewrite WebSocket internals (#1410)
* Start rewriting Manager and Connection

* more stuff

* stuff

* Fix ready bug

* some stuff i forgot

* fix some stuff

* add stupid heartbeat ack like seriously who cares

* woo!

* fix a bug

* rate limit the dumb websocket

* stuff

* hdocs

* Docs

* Remove ClientManager#setupKeepAlive as it is now redundant

* Change Client._pingTimestamp to a getter that fetches the timestamp from the WebSocketConnection

* are you happy now eslint smh

* make gus happy

* Add CloseEvent external doc

* Make sure to emit 'reconnecting' when actually reconnecting

* ffs

* Fix RESUME logic

* Add heartbeat ack debug messages, including latency data

* Dumb stuff for Gus

* thx eslint

* more dumb stuff

* more dumb crap smh gus i h8 u

* moar messages

* fix for using wrong status, causing certain events not to be fired (#1422)
2017-04-28 16:13:06 +01:00
Gus Caplan
0a56fa0aae websocket cleanup (#1346)
* websocket cleanup

* resume event

* Update Resumed.js

* Update WebSocketManager.js
2017-04-10 20:02:17 +02:00
Gus Caplan
801633b970 User settings (#1337)
* user settings bruh

* remove development dump

* emit stuff

* i am so done

* Update ClientUserSettings.js

* modularize

* Update ClientUserSettings.js

* Update Constants.js

* Update ClientUserSettings.js

* Update RESTMethods.js

* Update ClientUserSettings.js

* <.<
2017-04-05 22:03:33 +02:00
TimeForANinja
c4e5292516 resolve for not loggedin clients (#1301) 2017-04-01 08:05:46 +02:00
Gus Caplan
a3091f5262 Handle 4011 ws event code (#1083)
* 4011

* Update WebSocketManager.js

* smh gawdl3y
2017-01-11 22:59:09 +00:00
Gus Caplan
2410fdf8d2 fix heartbeats once and for all (#1016) 2016-12-25 16:28:36 +00:00
Gus Caplan
3eca3ba95e add handler in case heartbeat is not acked (#1013)
* add handler in case heartbeat is not acked

* ffs
2016-12-24 11:04:27 +00:00
Gus Caplan
b74c1b70b6 fix 992 (#994) 2016-12-18 16:06:42 -05:00
Schuyler Cebulskie
58c7c2e7b8 Add client ping stuff 2016-12-02 20:58:19 -05:00
Schuyler Cebulskie
b07a31d44e Change case of "function" 2016-11-12 21:07:22 -05:00
Schuyler Cebulskie
8306d50bd8 Clean up a bunch of promise stuff 2016-10-30 12:47:17 -04:00
isonmad
dd31ee0c5f propagate errors in ClientManager.destroy (#844)
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.
2016-10-27 11:33:51 +01:00
Amish Shah
00fe45f6b3 simplify client destruction 2016-10-26 19:52:41 +01:00
Amish Shah
7d04863b66 Revert "fix Client.destroy bugs" (#839) 2016-10-26 17:30:18 +01:00
isonmad
e9fa8a438c fix Client.destroy bugs (#828)
* 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
2016-10-26 14:49:45 +01:00
Schuyler Cebulskie
492f706035 Fix Gus' log messages 2016-10-13 20:05:07 -04:00
Gus Caplan
96355a4968 add constants, some debug stuff (#791)
* add constants, some debug stuff

* i can't believe i did this
2016-10-10 20:53:54 +01:00
Gus Caplan
c8636fd277 fix heartbeat (#737) 2016-09-24 23:56:18 -07:00
Gus Caplan
bd1449bc5a make login sane (#735) 2016-09-24 17:55:31 +01:00
Schuyler Cebulskie
47d873a8ca Move and improve debug/warn docs 2016-09-19 05:11:35 -04:00
Schuyler Cebulskie
6a94658dd7 Clean up some stuff 2016-09-19 04:32:24 -04:00
Schuyler Cebulskie
7d8667694d Fix massive timeout/interval memory leaks 2016-09-19 03:49:42 -04:00
Gus Caplan
7cb2e8eef7 add disconnect event, document warn and debug events (#702)
* 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
2016-09-14 00:12:10 -04:00
Schuyler Cebulskie
47d71d32f3 Make grammer gooder 2016-09-11 01:40:37 -04:00
Amish Shah
7475f734ac Add debug stuff 2016-09-04 12:31:16 +01:00
Amish Shah
9c915d1e0a Fix constants errors not giving a stacktrace 2016-09-04 11:53:48 +01:00
Schuyler Cebulskie
0b908f5bce Cleanup Part 2: Electric Boogaloo (Reloaded) (#594)
* Cleanup Part 2: Electric Boogaloo (Reloaded)

* Moar cleanup

* Tweak NOT_A_PERMISSION error
2016-09-04 10:08:09 +01:00
Schuyler Cebulskie
68acf37fd4 Add stricter/better ESLint config (#589)
* Add stricter/better ESLint config

* Remove more unnecessary @returns
2016-09-03 20:45:23 +01:00
Amish Shah
a172fffd76 Actually add GUILD_SYNC 2016-09-03 17:59:16 +01:00
Schuyler Cebulskie
27652b94af Make JSDocs follow general conventions (#582)
* Make JSDocs follow usual conventions

* Fix StringResolvable name

* Make function lowercase
2016-09-03 09:57:25 +01:00
Amish Shah
d249aa10cc Add client.destroy(); 2016-08-30 13:05:57 +01:00
Amish Shah
144638e746 Experimental ClientOptions.fetch_all_members 2016-08-29 13:54:35 +01:00
Amish Shah
8d5d90e222 Remove all data stores! Move to maps 2016-08-19 22:35:03 +01:00
Amish Shah
871c60c8dd fix client manager docs oops 2016-08-19 00:33:53 +01:00
Amish Shah
e0c987c1b2 add docs for ClientManager 2016-08-19 00:33:15 +01:00
Amish Shah
b8db4c4f4b ESLint stuff... 2016-08-13 14:44:49 +01:00
hydrabolt
9956e43c8e initial 2016-04-16 22:58:49 +01:00