Commit Graph

368 Commits

Author SHA1 Message Date
Amish Shah
0bde9ca2c5 voice: set seek parameter before input (#2993) 2018-12-27 18:05:54 +00:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Amish Shah
2d68e837e5 voice: fix receiver null on immediate voiceStateUpdate 2018-11-15 21:38:02 +00:00
Isabella
f3cad81f53 feat: Internal sharding (#2902)
* internal sharding

* ready event

* the square deal

* the new deal

* the second new deal

* add actual documentation

* the new freedom

* the great society

* federal intervention

* some of requested changes

* i ran out of things to call these

* destroy this

* fix: Client#uptime went missing

* fix(Client): destroy the client on login failure

This may happen duo invalid sharding config / invalid token / user requested destroy

* fix(Client): reject login promise when the client is destroyed before ready

* fix(WebSocketManager): remove redundancy in destroy method (#2491)

* typo(ErrorMessages): duo -> duo to

* typo(ErrorMessages): duo -> due

* fix: docs and options

* docs(WebSocketManager): WebSockethard -> WebSocketShard (#2502)

* fix(ClientUser): lazily load to account for extended user structure (#2501)

* docs(WebSocketShard): document class to make it visible in documentation (#2504)

* fix: WebSocketShard#reconnect

* fix: presenceUpdate & userUpdate
* presenceUpdate wasn't really being handled at all
* userUpdate handled incorrectly because as of v7 in the Discord API, it comes inside presenceUpdate

* re-add raw event

* member is now part of message create payload

* feat: Add functionality to support multiple servers with different shards (#2395)

* Added functionallity to spawn multiple sharding managers due to adding start and end shards

* Small fixes and limiting shard amount to max recommended

* Forgot a check in spawn()

* Fixed indentation

* Removed optiosn object documentation for totalShards

* More fixes and a check that the startShard + amount doesnt go over the recommended shard amount

* fix getting max recommended

* Removed async from constructor (my fault)

* Changed start and end shard to a shardList or "auto" + fixed some brainfarts with isNaN

* Changed the loop and totalShard count calculation

* shards are actually 0 based

* Fixed a problem with the gateway and handled some range errors and type errors

* Changed Number.isNan to isNaN and changed a few Integer checks to use Number.isInteger

* Added check if shardList contains smth greater than totalShards; made spawn use totalShards again; shardList will be ignored and rebuild if totalShards is 'auto'; fixed docs

* ShardingManager#spawn now uses a for..of loop; fixed the if statement inside the new for..of loop to still work as intended; made the totalShards be set to a new amount if smth manual is put into ShardingManager#spawn just like before; Fixed some spelling

* internal sharding

* ready event

* the square deal

* the new deal

* the second new deal

* add actual documentation

* the new freedom

* the great society

* federal intervention

* some of requested changes

* i ran out of things to call these

* destroy this

* fix: Client#uptime went missing

* fix(Client): destroy the client on login failure

This may happen duo invalid sharding config / invalid token / user requested destroy

* fix(Client): reject login promise when the client is destroyed before ready

* fix(WebSocketManager): remove redundancy in destroy method (#2491)

* typo(ErrorMessages): duo -> duo to

* typo(ErrorMessages): duo -> due

* fix: docs and options

* docs(WebSocketManager): WebSockethard -> WebSocketShard (#2502)

* fix(ClientUser): lazily load to account for extended user structure (#2501)

* docs(WebSocketShard): document class to make it visible in documentation (#2504)

* fix: WebSocketShard#reconnect

* fix: presenceUpdate & userUpdate
* presenceUpdate wasn't really being handled at all
* userUpdate handled incorrectly because as of v7 in the Discord API, it comes inside presenceUpdate

* Internal Sharding adaptation

Adapted to internal sharding
Fixed a bug where non ready invalidated sessions wouldnt respawn

* Fixed shardCount not retrieving

* Fixing style

removed unnecessary parenthesis

* Fixing and rebasing

lets hope i didnt dun hecklered it

* Fixing my own retardation

* Thanks git rebase

* fix: assigning member in message create payload

* fix: resumes

* fix: IS wont give up reconnecting now

* docs: add missing docs mostly

* fix: found lost methods

* fix: WebSocketManager#broadcast check if shard exists

* fix: ShardClientUtil#id returning undefined

* feat: handle new session rate limits (#2796)

* feat: handle new session rate limits

* i have no idea what i was doing last night

* fix if statement weirdness

* fix: re-add presence parsing from ClientOptions (#2893)

* resolve conflicts

* typings: missing typings

* re-add missing linter rule

* fix: replacing ClientUser wrongly

* address unecessary performance waste

* docs: missing disconnect event

* fix(typings): Fix 2 issues with typings (#2909)

* (Typings) Update typings to reflect current ClientOptions

* fix(Typings) fixes a bug with Websockets and DOM Types

* fix travis

* feat: allow setting presence per shard

* add WebSocketManager#shardX events

* adjust typings, docs and performance issues

* readjust shard events, now provide shardId parameter instead

* fix: ready event should check shardCount, not actualShardCount

* fix: re-add replayed parameter of Client#resume

* fix(Sharding): fixes several things in Internal Sharding (#2914)

* fix(Sharding) fixes several things in Internal Sharding

* add default value for shards property

* better implement checking for shards array

* fix travis & some casing

* split shard count into 2 words

* update to latest Internal Sharding, fix requested changes

* make sure totalShardCount is a number

* fix comment

* fix small typo

* dynamically set totalShardCount if either shards or shardCount is provided

* consistency: rename shardID to shardId

* remove Client#shardIds

* fix: typo in GuildIntegrationsUpdate handler

* fix: incorrect packet data being passed in some events (#2919)

* fix: edgecase of ShardingManager and totalShardCount (#2918)

* fix: Client#userUpdate being passed wrong parameter
and fix a potential edgecase of returning null in ClientUser#edit from this event

* fix consistency and typings issues

* consistency: shardId instances renamed to shardID

* typings: fix typings regarding WebSocket

* style(.eslintrc): remove additional whitespace

* fix(Client): remove ondisconnect handler on timeout

* docs(BaseClient): fix typo of Immediate

* nitpick: typings, private fields and methods

* typo: improve grammar a bit

* fix: error assigning client in WebSocketManager

* typo: actually spell milliseconds properly
2018-11-03 13:21:23 -05:00
SpaceEEC
01476de582 fix(VoiceConnection): compare new speaking to old to avoid TypeError 2018-10-20 12:12:21 +02:00
sillyfrog
2ba00038d1 fix(VoiceConnection): use Speaking#has to fire _stoppedSpeaking (#2896)
* Use match on speaking bitmask to fire _stoppedSpeaking

* Use constants and correct matching

* Correctly do a not check
2018-10-19 18:15:01 +02:00
Amish Shah
2e7094f9ea voice: fix disconnect without receiver edge case 2018-10-11 23:02:59 +01:00
Amish Shah
00a62a93e4 voice: catch errors before connection is ready 2018-10-04 20:57:52 +01:00
bdistin
d8c97be142 docs: fix typos (#2868) 2018-10-01 12:38:36 +02:00
Amish Shah
6f62d7d816 fix: voice not throwing errors on bad stream input (#2786) 2018-08-25 19:41:07 +01:00
Isabella
928fb30040 fix: actually fix Readonly typos 2018-08-21 14:25:30 -05:00
bdistin
c62f01f0e4 refactor(BitField): base class for Permissions, ActivityFlags, Speaking (#2765)
* abstract BitField from Permissions

* reduce useless code, improve docs

* add a ReadOnly identifier to the return type of Bitfield#freeze()

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#partial-readonly-record-and-pick

* fix the RangeError

* update docs, convert Speaking and ActivityFlags to bitfields

* fix some docs

* Fix Speaking BitField oops

* docs for oops

* more incorrect docs

* Fix incorrectly named property

* add new classes to index

* fix missing @extends docs

* default bitfield resolve to 0, and cleanup defaulting everywhere

Also removes GuildMember#missiongPermissions() alias that had incorrect behavior

* Breaking: Rename Overwrite allowed and denied to allow and deny

To be consistent with the api's naming

* fix setSpeaking usage to bitfields instead of booleans

* fix speaking bug in playChunk

* docs: Updated typings

* fix: BitFieldResolvable should use RecursiveArray

* bugfix/requested change

* typings: Cleanup (#2)

* typings: Fix BitField#{toArray,@@iterator} output type

* typings: correct PermissionOverwrites property names and nitpicks
2018-08-21 11:56:41 +02:00
Amish Shah
e2726f5a9a voice: remove createReceiver, just use VoiceConnection.receiver 2018-08-16 18:30:54 +01:00
Amish Shah
97c34b5b6f voice: clean up packet handling 2018-08-16 11:28:28 +01:00
Amish Shah
64832abfdb voice: clear connect timeout after connected (fixes #2752) 2018-08-15 14:25:47 +01:00
Amish Shah
e0f52162ea voice: allow for streaming silence to avoid audio glitches with repeated pausing/resuming (#2354) 2018-08-14 12:12:59 +01:00
Amish Shah
6852a15cee voice: fix StreamDispatcher#pause trying to call null function 2018-08-13 17:54:11 +01:00
Amish Shah
bfde1dd8f2 fix: StreamDispatcher doesn't emit finish if ended while paused (#2648) 2018-08-13 17:35:21 +01:00
Amish Shah
ee6c19ca7e voice: rewrite GuildMember#speaking tracking (#2540) 2018-08-09 13:59:52 +01:00
Amish Shah
55863efa15 voice: don't clear reject timeout until connection fully resolved (#2421, #2578) 2018-08-09 13:00:46 +01:00
Amish Shah
46fa9603c2 voice: delete receive stream immediately to prevent it being written to after end (#2678) 2018-08-07 17:34:01 +01:00
FireController1847
ac0c15f7f1 Change ytdl example (#2619) 2018-06-24 15:47:54 +02:00
Mikhail
bf738b34de fix(BasePlayer): incorrectly mutating FFMPEG_ARGUMENTS when using seek (#2622)
Because args was not a copy of FFMPEG_ARGIMENTS, but a reference to it, pushing 'ss' argument pushed it to FFMPEG_ARGUMENTS, making it persistent.
2018-06-23 15:20:59 +02:00
Amish Shah
18646b72f9 voice: use getters where possible 2018-06-22 18:46:51 +01:00
Amish Shah
08bbbe9301 voice: handle new client_connect and client_disconnect packets 2018-06-22 18:38:33 +01:00
Amish Shah
9296a30148 voice: account for speaking now being a bitmask 2018-06-22 17:47:00 +01:00
Amish Shah
1f7c1ddaa2 voice: start update to v4, fix heartbeats 2018-06-22 17:42:04 +01:00
Amish Shah
3d41748a38 voice: fix not passing volume to transform constructor 2018-06-21 21:50:54 +01:00
Amish Shah
1cdee7b48a voice: reimplement seek option (#2572) 2018-06-13 21:16:14 +01:00
Amish Shah
04618f554f voice: fix _writeCallback being called multiple times (#2567) 2018-06-13 21:06:50 +01:00
Amish Shah
3bfc1ff61c voice: fix write after end (#2567) 2018-06-13 21:02:19 +01:00
Amish Shah
d69e906027 voice: fix voice receive after enabling suffix and lite encryption modes 2018-06-13 20:43:18 +01:00
Amish Shah
43c92c13e2 voice: support xsalsa20_poly1305_lite and xsalsa20_poly1305_suffix 2018-05-10 12:11:22 +01:00
Amish Shah
685814aa61 voice: make sure speaking is false when paused 2018-05-09 18:44:46 +01:00
Amish Shah
841b9de918 voice: mark speaking as false when paused, prevent repeated pausing 2018-05-09 14:33:23 +01:00
Kyra
42ce4f8bc0 Removed usage of (deprecated) new Buffer (#2531) 2018-05-03 19:07:16 +02:00
Amish Shah
299fc001d5 voice: start using provided IP rather than manually resolving 2018-04-27 15:11:37 +01:00
Amish Shah
cb69102e5e voice: allow for changing volume with webm/ogg streams 2018-04-10 21:19:29 +01:00
Jérémie N'gadi
e845758037 fix(StreamDispatcher): only update speaking for non broadcasts (#2437)
If the player is a BroadcastAudioPlayer it has no VoiceConnection directly associated with it.
2018-04-09 21:17:16 +02:00
Amish Shah
fa886eaae9 voice: fix bug where no audio could be heard if voice region changed 2018-04-07 15:19:18 +01:00
Amish Shah
384fdf8f17 voice: properly cleanup after disconnect (#2443, #2435, #2421, #2406 #2359) 2018-04-07 14:40:05 +01:00
Amish Shah
41d0f25d0f voice: fix heartbeat issue (#2443) 2018-04-05 16:38:35 +01:00
Amish Shah
a5e8f05d01 voice: add end param to describe how a voice receive stream should end 2018-03-31 11:52:48 +01:00
Amish Shah
ef8366d189 voice: properly null-check udp socket first (#2317) 2018-03-13 09:48:18 +00:00
Amish Shah
79b02dd35f voice: resolve "cb is not a function" error (#2317) 2018-03-06 10:36:05 +00:00
Amish Shah
8289b70e2c voice: resolve issue where dispatcher tried to send packets to null socket (#2317) 2018-03-06 10:21:44 +00:00
Amish Shah
835bff74cd lint: remove unused import 2018-03-05 20:17:38 +00:00
Amish Shah
ff825cd8b8 voice: fix #2331 (speaking not set back to false on stream ending) 2018-03-05 19:41:35 +00:00
Amish Shah
e263063ba6 voice: update prism and fix framesize to work for opusscript 2018-03-05 19:30:18 +00:00
nekobako
c25ea45866 fix(StreamDispatcher): emit volumeChange event when the volume changes (#2349) 2018-02-21 22:21:13 +01:00