Commit Graph

97 Commits

Author SHA1 Message Date
Gus Caplan
2440a4a2c8 Add webpack building (#907)
* friggin webpack tho

* probably important

* add all the stuff to the package.json

* add minify builds and a nice package.json script to run it all

* clean up

* use uglify harmony branch so we can actually run minify builds that work

* update build system

* make test better

* clean up

* fix issues with compression

* ‮

* c++ requirements in a node lib? whaaaaat?

* fix travis yml?

* put railings on voice connections

* 🖕🏻

* aaaaaa

* handle arraybuffers in the unlikely event one is sent

* support arraybuffers in resolvebuffer

* this needs to be fixed at some point

* this was fixed

* disable filename versioning if env VERSIONED is set to false

* Update ClientDataResolver.js

* Update ClientVoiceManager.js

* Update WebSocketManager.js

* Update ConvertArrayBuffer.js

* Update webpack.html

* enable compression for browser and fix ws error handler

* Update WebSocketManager.js

* everything will be okay gawdl3y

* compression is slower in browser, so rip the last three hours of my life

* Update Constants.js

* Update .gitignore
2016-11-20 19:38:16 -05:00
Schuyler Cebulskie
b07a31d44e Change case of "function" 2016-11-12 21:07:22 -05:00
Schuyler Cebulskie
90304aa7d6 Fix loads of JSDoc type issues 2016-11-12 20:52:37 -05:00
Schuyler Cebulskie
ce132d5f54 Make bot/user account warnings MOAR CONSISTENT!!one! 2016-11-12 17:15:17 -05:00
Programmix
fe3914658a Grammar cleanup (#875)
This commit:
* fixes inconsistencies (primarily regarding capitalization)
* fixes non-proper nouns that were improperly capitalized
* fixes reminents from not-so-meticulous copy+paste jobs
2016-11-05 23:57:34 +00:00
Schuyler Cebulskie
d7e1e1c0c9 Add warnings for Collection.find/exists 2016-10-30 22:22:16 -04:00
Schuyler Cebulskie
f2496070d3 Document client timeout/interval stuff 2016-10-30 17:02:06 -04:00
Schuyler Cebulskie
85330769a7 Refactor OAuth application stuff 2016-10-30 16:55:08 -04:00
Schuyler Cebulskie
589c44327a Make bot/user account notices consistent 2016-10-30 16:41:39 -04:00
Schuyler Cebulskie
60e0d507f0 Clean up nearly all promises to utilise chaining, other small fixes 2016-10-30 16:27:28 -04:00
isonmad
4bd19c94ba fix Client.destroy (#853)
_timeouts and _intervals were changed to Set objects in
commit 6ede7a32fd a month ago.

Like #844, this fix was reverted in 7d04863b66 (#839)
without explanation and was never included in the followup rewrite in
commit 5e2ee2398e.
2016-10-27 17:38:34 -04:00
Hackzzila
c9dbf1f7f0 OAuth info stuff (#849)
* OAuth info stuff

* fix docs

* oops
2016-10-27 21:50:04 +01:00
Amish Shah
00fe45f6b3 simplify client destruction 2016-10-26 19:52:41 +01:00
Amish Shah
5e2ee2398e Fix some destroy stuff (#828) 2016-10-26 19:42:21 +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
fc307fab8a Remove unnecessary array conversions 2016-10-16 21:14:59 -04:00
Gus Caplan
853a3dfa04 Add getRecommendedShards and automatic shard count in ShardingManager (#796)
* draft stuff

fix docstring for Client#token

Reorganise resolver

make env better for shards, clean up docs

Fix Gus' log messages

7

meh just gateway/bot not v7 :(

final changes, ready for mergin!

build docs

make default totalShards 'auto', fix docs for totalShards type

clean up docs more

run docs

* make consistancy real

* Update and rename getRecommendedShards.js to GetRecommendedShards.js

* Update GetRecommendedShards.js

* Update index.js

* Update RESTMethods.js

* Update Shard.js

* Update GetRecommendedShards.js

* Update ShardingManager.js

* run docs
2016-10-13 23:26:10 -04:00
Gus Caplan
32eeb8ad5e Fix feature/login (#790)
* eeeeeeee

* too tired

* ok gawdl3y

Signed-off-by: Gus Caplan <fluffyrobotcheese@gmail.com>
2016-10-10 02:55:09 -04:00
Schuyler Cebulskie
29b33bffaa Rearrange and clean up more webhook stuff 2016-10-09 15:50:50 -04:00
Schuyler Cebulskie
7a53f70978 Rename maxMessageCache -> messageCacheMaxSize 2016-10-09 15:16:54 -04:00
Schuyler Cebulskie
a717b60417 Add validation for all non-ws client options 2016-10-09 15:11:15 -04:00
Schuyler Cebulskie
dabe51fc8d Reorganise disabledEvents stuff 2016-10-09 14:41:57 -04:00
Programmix
3e2d6ccc48 Convert disabledEvents Array to Object (#786)
* Convert disabledEvents Array to Object

Increased performance

* Commit to please Lord Gawdl3y

* Nitpick with chopsticks
2016-10-09 14:22:52 -04:00
Schuyler Cebulskie
f9b7f9c27e Add readonly 2016-10-06 21:49:08 -04:00
Schuyler Cebulskie
79b0d3f2a5 Client.readyTime -> readyAt (consistency) 2016-10-06 21:48:25 -04:00
Programmix
c4e1e4f50f Add InviteResolvable (#766)
* Add InviteResolvable

Add InviteResolvable

* Return data as fallback instead

* Rename resolver method
2016-10-02 19:21:08 -04:00
Schuyler Cebulskie
682e33cad9 Whoopsies 2016-09-27 20:21:52 -04:00
Schuyler Cebulskie
b8e659d544 Make Client.emojis suck less 2016-09-27 20:11:22 -04:00
Schuyler Cebulskie
973dbe8266 Add more @readonly and clean up some stuff 2016-09-27 20:07:33 -04:00
Schuyler Cebulskie
1e57c968dd Made date/timestamps consistent and less shitty 2016-09-27 19:46:53 -04:00
Schuyler Cebulskie
ba8dd3467a Switch config back to camelCase 2016-09-27 18:42:32 -04:00
Schuyler Cebulskie
49d905a7b1 Reorganise some shard logic 2016-09-27 17:23:03 -04:00
Schuyler Cebulskie
e5a987e0ef Add client shard eval/client property fetching, and improve existing shard stuff 2016-09-27 02:19:53 -04:00
Schuyler Cebulskie
4fe30aa4d3 Rip out client sharding logic into its own class 2016-09-26 23:23:56 -04:00
Gus Caplan
b4f3575335 i am facepalming so hard right now (#740) 2016-09-26 03:55:54 -07:00
Amish Shah
f1cb39a319 Expose Presence and Game structures 2016-09-25 20:17:35 +01:00
Amish Shah
03651fd6e3 Change how presences are handled 2016-09-25 14:16:03 +01:00
Schuyler Cebulskie
d9bc5cea1e Small cleanups 2016-09-24 02:43:27 -04:00
Schuyler Cebulskie
d62551bea2 Remove old code 2016-09-24 02:20:48 -04:00
Schuyler Cebulskie
1008f601f4 Add shard client prop fetching, remove guild count fetching, improve eval 2016-09-24 02:12:45 -04:00
Schuyler Cebulskie
e4f416ae6c Add shard eval, broadcastEval, and fix fetchGuildCount response 2016-09-24 01:21:41 -04:00
Gus Caplan
063be5cee2 smarter sharding™ (#732) 2016-09-23 21:43:16 +01:00
Schuyler Cebulskie
4bf6ad30f3 Remove a line 2016-09-22 23:10:00 -04:00
Schuyler Cebulskie
3fa4ff13e3 Add ShardingManager.fetchGuildCount 2016-09-22 22:48:21 -04:00
Schuyler Cebulskie
e5bac1339d Improve Client.sweepMessages 2016-09-20 10:57:39 -04:00
Schuyler Cebulskie
6075ec0e19 Add more detail to debug message 2016-09-20 01:25:19 -04:00
Schuyler Cebulskie
8f1bc5edab Add swept messages counter and debug message 2016-09-20 01:14:15 -04:00
Schuyler Cebulskie
9503990a86 Rename max_message_lifetime to message_cache_lifetime 2016-09-19 17:52:11 -04:00
Schuyler Cebulskie
afc8e5bee0 Add message sweeping 2016-09-19 16:52:46 -04:00