Commit Graph

3731 Commits

Author SHA1 Message Date
Charalampos Fanoulis
81ff5075e4 chore: remove user account checkbox from bug report template 2018-11-17 15:41:12 +01:00
Yukine
e793338d74 fix: ShardClientUtil#count and ShardClientUtil#id typedef (#2956) 2018-11-16 22:46:02 -06:00
Kyra
54aff3191e feat(Constants): add error code 50020 (#2953)
* feat(Constants): Add error code 50020

Which is throw when using the vanity-url endpoint: https://github.com/discordapp/discord-api-docs/pull/748/

* docs: Document the new code
2018-11-16 16:55:15 +01:00
Amish Shah
2d68e837e5 voice: fix receiver null on immediate voiceStateUpdate 2018-11-15 21:38:02 +00:00
Lewdcario
3418b5a1a2 docs: restore Client#error docs that went missing 2018-11-06 14:59:02 -06:00
Lewdcario
6b886b0aba typings: add Guild#shard and Guild#shardID 2018-11-06 11:23:17 -06:00
Lewdcario
08002d0576 fix: Client#userUpdate receiving wrong packet 2018-11-05 18:24:50 -06:00
Lewdcario
b59c75e402 docs: add missing docstring for Client#guildDelete 2018-11-05 13:29:07 -06:00
Souji
905f1c3262 docs: add missing docstring for Client#userUpdate (#2930)
* docs: add missing docstring for Client#userUpdate

* docs: indentn't

* docs: indentn't 2
2018-11-05 17:46:47 +01:00
Lewdcario
7796cb5d05 fix: Client#raw emitting twice 2018-11-04 23:26:40 -06:00
Lewdcario
be0d1cd663 fix: Client#shards not being set properly 2018-11-04 23:25:54 -06: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
Schuyler Cebulskie
18f065867c Fix #2924 with a bandage (Node typings not updated) 2018-11-03 13:09:56 -04:00
Schuyler Cebulskie
ab3a439198 Add worker-based sharding to the ShardingManager (#2908)
* Add worker-based sharding mode to ShardingManager

* Fix ClientShardUtil mode

* Fix worker not being cleared on shard death

* Update docs and typings

* Clean up Client sharding logic a bit

* Add info about requirements for worker mode
2018-10-29 15:02:36 -04:00
Schuyler Cebulskie
b759fc415e Slightly simplify logic in APIMessage.transformOptions 2018-10-27 15:28:05 -04: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
Lewdcario
e189c1b728 fix: revert #2744
see #2848, fixes issues with stack not displaying correctly
2018-10-15 02:08:49 -05:00
Lewdcario
16076124b2 fix(Client#voiceStateUpdate): newState is guaranteed 2018-10-14 13:58:34 -05:00
Isabella
183ba25faf fix: emit voiceStateUpdate on guildMemberRemove (#2892)
* fix: emit voiceStateUpdate on guildMemberRemove

* apparently i am blind

* typings
2018-10-14 12:44:14 -05:00
Lewdcario
9cf50d05f2 fix(typings): ReactionUserStore#fetch returns a Collection
fixes #2895
2018-10-13 20:09:19 -05:00
SpaceEEC
73b9b0e62b fix(Shard): use DISCORD_TOKEN instead of CLIENT_TOKEN, see #2843 2018-10-13 15:20:56 +02:00
Amish Shah
2e7094f9ea voice: fix disconnect without receiver edge case 2018-10-11 23:02:59 +01:00
SpaceEEC
4491b7b42a typings(MessageEmbed): add spliceField and static checkField methods 2018-10-10 11:30:26 +02:00
Souji
fd25d19c9c docs(ClientUser): fix example for setActivity method (#2880) 2018-10-10 10:30:23 +02:00
Souji
78c4be52c6 docs(Collection): clarify example for tap method (#2881)
* docs: clarify example for Collection#tap

* docs: wording improvement
2018-10-10 10:29:53 +02:00
SpaceEEC
6e5f088e44 refactor: consistently use permissionOverwrites over overwrites (#2886) 2018-10-10 10:25:00 +02:00
SpaceEEC
71c04a303a feat(Emoji): move createdAt and createdTimestamp getters from GuildEmoji (#2872) 2018-10-10 10:01:23 +02:00
Will Nelson
1ee417cd65 featt(ClientUser): allow options as first parameter to setActivity (#2890) 2018-10-10 09:59:16 +02:00
Dim
8ec3b5134d feat(GuildChannelStore): support for create with rateLimitPerUser (#2878)
* change GuildChannelStore#create

* document rateLimitPerUser

* update typings
2018-10-10 09:58:31 +02:00
bdistin
8feb874586 feat(MessageEmbed): add spliceField method (#2857)
* Add spliceField and refactor to prevent code dupe

* String() was for a falsy check, fixed

* requested: remove embed field count checks
2018-10-10 09:57:56 +02:00
Isabella
1fe36087d4 feat(MessageEmbed): allow setTimestamp to take a timestamp (#2875)
* feat: allow MessageEmbed#setTimestamp to take a timestamp

* fix the dumb i did
2018-10-10 09:57:13 +02:00
SpaceEEC
27d2ce7baf typings(Collection): each return Collection<K, V>, not void 2018-10-05 11:37:49 +02:00
Amish Shah
00a62a93e4 voice: catch errors before connection is ready 2018-10-04 20:57:52 +01:00
SpaceEEC
6b810b2331 fix(ClientPresence): use possibly extended constructor from structures 2018-10-04 12:36:25 +02:00
SpaceEEC
1428967238 docs(Integration): document Integration class 2018-10-04 11:01:21 +02:00
Daniel
62e7e26310 Add white to colours (#2853)
* add white to colorresolvable typedef

* add colour white
2018-10-01 14:02:50 +02:00
bdistin
96a0655609 refactor(WebhookClient): make token property non-enumerable (#2861)
* make WebhookClient#token non-enumerable

parity with Client to add the barest protection against accidental exposure

* requested change
2018-10-01 12:43:08 +02:00
bdistin
d8c97be142 docs: fix typos (#2868) 2018-10-01 12:38:36 +02:00
SpaceEEC
21999fa4a0 fix(typings): fix compilation with 'strict' enabled (#2845) 2018-09-30 11:30:07 +02:00
Kyra
d4c0bb2a0d feat(TextChannel): RateLimitPerUser (#2811)
* feat: Add TextChannel#rateLimitPerUser
Rename parameter in TextChannel#setRateLimitPerUser
feat: Add `rateLimitPerUser` param to ChannelData
fix: eslint

* docs: Updated typings

* fix: Requested changes

* fix: rateLimitPerUser being undefined when 0

When `rate_limit_per_user` is 0, the gateway does not send it (but REST does). When this is set to a non-zero number, this property starts to exist. Otherwise this will be `0`. Adding `|| 0` should do the trick changing `undefined` to `0`.

* fix: eslint
2018-09-29 16:02:49 +02:00
Kyra
60ad9053a3 typings: add HTTPError class definition (#2852)
Class was introduced with #2694 

* typings: Add HTTPError class definition

* typings: Sort HTTPError's members by name
2018-09-23 22:07:19 +02:00
Shayne Hartford
32b405a5be Change default token (#2843)
* Change default token

Default `token` to `process.env.CLIENT_TOKEN` like client does.

* 2/2

* 1/2
2018-09-23 21:36:28 +02:00
Andrew Lehman
3298ea1869 docs: correct default value for SplitOptions.maxLength in Util#splitMessage (#2847) 2018-09-23 21:35:56 +02:00
SpaceEEC
0ab69c5ad4 fix(Webhook): APIMessage require should be a const 2018-09-23 17:04:22 +02:00
SpaceEEC
c0a9b08e73 fix(Webhook): APIMessage is not circular, fixes WebhookClients 2018-09-23 17:02:35 +02:00
SpaceEEC
3f44320bbe docs(MessageAttachment): redocument name property 2018-09-22 11:45:03 +02:00
Lewdcario
53420fa4e7 fix: Webhook#send not resolving content 2018-09-21 23:02:31 -05:00
bdistin
3d8207a3db refactor: comprehensive permissionOverwrites refactor (#2818)
* wip: comprehensive permissionOverwrites refactor

* PermissionOverwrites.resolve should Promise.reject()

where a promise is the expected return value

* On second thought, async rewrite to automatically reject on throw

* Fix some docs

* Fix a bug

* fix 2 more bugs

* typings: Updated for latest commit

* typings: Add missing method in GuildChannel

* typings: Add missing `| null` in PermissionOverwriteOption type

* Suggested changes
2018-09-21 12:21:51 +02:00
bdistin
6d184257b3 refactor: remove duplicate send checks (#2790)
* re-direct pr code to master

* fix Webhook send docs

* requested changes

* typings: Updated to latest commit

* requested change

* requested change
2018-09-21 10:59:58 +02:00