Commit Graph

791 Commits

Author SHA1 Message Date
Gus Caplan
675e1eccb1 Separate websocket internals for RPC (#1893)
* websocket centralization

* more centralization

* whoops

* Update WebSocket.js
2017-09-06 07:20:10 +01:00
Amish Shah
99419a3670 Fix #1310 (strip RTP header extensions) 2017-09-05 19:14:54 +01:00
Amish Shah
37d84b14f8 Re-add VoiceChannel#members and messageUpdate to the documentation 2017-09-05 11:16:56 +01:00
SpaceEEC
87fa74acd4 ClientUserGuildSettings: avoid uncaught exception and a bit of refactoring (#1885)
* refactor(ClientUserGuildSettings): make client first parameter of the constructor

* refactor(ClientUserChannelOverride): patch if possible rather then reinstantiating every update

* fix(ClientUserGuildSettings): avoid uncaught exception when patching newly joined guilds/gdms
2017-09-05 02:40:46 +02:00
SpaceEEC
bb4fe256e0 fix(Client): apply shardId and shardCount to the correct options object (#1888) 2017-09-05 02:40:22 +02:00
Gus Caplan
18e3801bb7 lots of important stuff (#1883)
* lots of important stuff

* Update Constants.js
2017-09-04 17:49:44 +02:00
Gus Caplan
c4df2502ec Rewrite presence a little bit (#1853)
* such presence many good

* Update PresenceStore.js

* Update index.js

* Update ClientPresenceStore.js

* Update Presence.js

* Update ClientPresenceStore.js

* Update ClientUser.js

* Update Presence.js

* add timestamps and party

* Update Presence.js

* Update PresenceStore.js

* Update ClientPresenceStore.js

* Update ClientPresenceStore.js
2017-09-02 23:57:02 +01:00
Frangu Vlad
7b6190da01 Fix documentations that were incorrect or missing (#1837)
* Fix docs for Guild#pruneMembers

* ClientApplication returns

* Guild#deleteEmoji

* Guild#setRolePosition takes RoleResolvable

* Client#fetchApplication returns ClientApplication not Oauth2Application

* ClientDataResolver#resolveImage can return null

* ClientApplication#toString small example

* Guild#allowDMs now has a only for user accounts warning

* ClientUserSettings#patch is private and setGuildPosition has a user account warning

* Role#setPermissions can take PermissionResolvable, not just String

* ChannelCreationOverwrites is for a role or a member, not for a "group"

* Fix ChannelData#userlimit string being wrong
"The user limit of voice the channel" :lul:

* ChannelResolvable is only for Channel or Snowflake

* EmojiIdentifierResolvable supports Snowflakes

* UserResolvable doesn't take a guild

* Make patch functions private

* Remove examples

* Webhoox#edit options.name defaults to the webhook name

* Make VoiceConnection functions private

* Am dum
The whole ClientUserSettings category is only for self bots soo

* Value for update functions is *

* Make update functions be private

* Fix GuildEditData missing Ssytemchannel property

* PermissionOverwriteOptions can accept null as an option
(Why did no-one document this?)
2017-08-31 09:16:27 +02:00
SpaceEEC
65d9d46a3c Fixed DataStore, deprecation leftovers and a bit of Event Constants (#1841)
* Fixed leftover fetchThing and removed unused methods/error messages

* Added resume event constant and used event constants wherever possible

* Replaced mentions of removed method name with their new name.

* Fixed typo: resume -> resumed
2017-08-28 00:11:28 +02:00
iCrawl
3c532f16bc Remove unused Util require 2017-08-26 16:12:18 +02:00
Amish Shah
7d750c4680 pass on error 2017-08-26 13:51:53 +01:00
Amish Shah
30dd3e0cff Fix #1684 2017-08-26 13:43:13 +01:00
Amish Shah
51fe80fd11 fix fetching all members 2017-08-26 13:08:54 +01:00
Amish Shah
170f687d81 actually fix that delete thing (#1507) 2017-08-26 00:08:12 +01:00
Amish Shah
5a3b59b4b0 Fix #1685 2017-08-25 23:57:29 +01:00
Amish Shah
5f694d1149 Make resolve types stricter
- UserResolvable no longer allows a guild
- ChannelResolvable no longer allows a message or a guild
- ChannelResolvable no longer allows a message or a guild
2017-08-25 23:10:05 +01:00
Isabella
fbb1253b3f Added resolveImage to reduce code duplication (#1820)
* add client#resolveImage

* oops

* resolveFile fix

* async is the future

* async

* update doc example

* build fix

* doc fix

* fix docs

* thx hydar
2017-08-25 22:17:38 +02:00
Amish Shah
b8315b79c7 Store and Model Refactor (#1618)
* UserStore refactor

* Create ChannelStore, remove redundant methods in ClientDataManager

* Create GuildStore

* Emoji stuff

* Use a Base class where possible to reduce code duplication

* Remove unnecessary comments from ChannelStore

* Add Base._clone();

* Remove unused ClientDataManager methods

* Refactor some more stuff

* ESLint

* Move Client#fetchUser to client.users.fetch

* Remove .has checks and just see if .get is truthy

* Fix guild member chunk error

* ESLint

* Fix typo

* Fix channel storing for user bots

* Remove ClientDataManager

* GuildChannelStore

* Reduce use of Util.cloneObject

* and this one too

* update typings

* Fix MessageUpdate handling (#1507)

* Fix role updates (probably fixes #1525)

* fix for eslint

* Address some of appell's comments

* Use debug constant

* start message store crap if it's ugly tell me later k

* fix that

* message store but works™️

* clean up guild stuff

* clean up channel store stuff

* clean up channel event handling

* does this message stuff work? find out soon in the next episode of dIsCoRd.Js

* eslint

* emojis

* emojis and reactions

* hi my name is eslint and im A LIL SHIT

* so i forgot this huh

* user stuff

* Fix @class

* Fix message stuff

* Fix user store docs

* Document all the bases

* fix the super things

* tidy up remove

* fix textbasedchannel

* fix that too

* fix emoji store

* make voice state stuff less ugly

* make voice states even less ugly

* make members less bad

* fix bug

* fix that too

* fix reactions

* how was this broken for so long

* role store

* remove super._patch from UserConnection

* Rename UserProfile#setup to _patch

* remove unnecessary super calls

* update docgen dep (pls fix travis thx)

* doc messagestore

* fix docs

* message store docs

* things

* DOCS PLS

* more things

* Document TextBasedChannel#messages as a MessageStore

* Rebase

* All the stores!
2017-08-25 21:08:58 +01:00
Gus Caplan
b055dae998 make webpack over 9000 times better (#1816)
* webpack stuff

* even better

* Update browser.js
2017-08-22 19:55:28 +02:00
Isabella
4520c801d3 update attachment & docs (#1815) 2017-08-21 23:11:58 +02:00
Gus Caplan
8b8a365e99 fix ratelimits (#1806) 2017-08-20 10:14:38 +02:00
Gus Caplan
55543754b9 proper fix for #1685 (#1805)
* Update WebSocketConnection.js

* Update WebSocketConnection.js

* Update WebSocketConnection.js

* Update RESTManager.js
2017-08-20 05:14:49 +02:00
iCrawl
2aa2f73c74 Docs cleanup 2017-08-17 20:04:01 +02:00
Gus Caplan
5ce0def9d0 fix sync (#1792)
* Update Ready.js

* Update ClientDataManager.js
2017-08-17 18:28:01 +02:00
Gus Caplan
57977b063e channel stuff (#1775)
* channel stuff

* abstract channel creation

* Update Channel.js

* Update Channel.js

* Update Channel.js

* Update Guild.js

* Update Constants.js

* e
2017-08-13 13:57:25 +02:00
Gus Caplan
3ba224900f new application stuff very hype (#1764)
* application stuff, more to come

* docstrings

* Update Message.js
2017-08-11 19:09:06 +02:00
Gus Caplan
3c7869c1b7 update retry case for 5xx (#1765) 2017-08-10 20:31:45 +02:00
SpaceEEC
d9262f2682 Added and fixed a bunch of docs stuff (#1767)
- Fixed a common copy paste fail `the the <thing>` in various places
- Apparently I can't type Resolvable correctly,
Fixed that wherever applicable
- Documented GroupDMChannel#nicks so that it will be displayed on the docs
- GroupDMChannel#icon is nullable
- Removed empty InviteOptions typdef, as its properties are now documented in GuildChannel#createInvite
- MessageMentions#channels is no longer nullable
- RoleData#permissions takes a PermissionResolvable or an array of them
- Webhook#avatar is nullable
- Added HTTPOptions typedef and added it to ClientOptions typedef
- ClientUserChannelOverride#muted is for a channel and not a guild directly
2017-08-10 20:31:10 +02:00
SpaceEEC
87cdad332c Improved Guild#createChannel, added RoleResolvable and fixed a bit of Emoji stuff (#1754)
* Made creating channels with overwrites nicer
and added ClientDataResolver#resolveRole

* Renamed ChannelPermissionOverwrites to ChannelCreationOverwrites

* Added RoleResolvables everywhere possible

* Fixed Emoji#setName resetting restricted roles and Emoji#equals

Which will lead to emojis not to update when roles are being added removed.
2017-08-10 01:22:57 +02:00
Isabella
62fc9fce6d Add Attachment structure (#1731)
* Add Attachment structure

* Fix linter issues + @private

* Fixed array sends, also added embed sends

* fixed proving path to attachment

* fixed incorrect name assumption from path

* linting fix

* ;)

* im really good at this

* changes as requested by gus

and computer from #1459

* am a dum

* update webhook#send

* readonly addition to getters

* i... uh... oops

* farming deez commits

* fix webhook split

* removed some ugly

* removed .every checks
2017-08-06 18:09:47 -04:00
FireController1847
580e066a36 Init pause variable on VoiceBroadcast (#1751)
* Init pause variable on VoiceBroadcast

* Move it back. Could have swore I did this.
2017-08-04 09:21:18 +02:00
Yoson Chiu
ba1c257bb2 Fixes #1693 (#1745)
* Update AudioPlayer.js

* Set timestamp to 0 as well.
2017-08-04 09:18:37 +02:00
Crawl
bda72c60fa CRLF to LF 2017-08-01 04:40:39 +02:00
iCrawl
d4793bae0f Fix tiny doc string 2017-08-01 04:32:29 +02:00
stupid cat
b8034525e3 Add user_guild_settings support (#1365)
* user guild settings

* Use direct collection

* I'm a goof

* double goof

* Structure properties

* Forgot to register listener

* wrong class names

* No more get in docs

* avoid waterfalls, bot checks

* trycatch

wow i thought i already did this :notlikecat:

* 👀

* Update ClientUser.js

* Update ClientUserGuildSettings.js

* Update UserGuildSettingsUpdate.js

* Update ClientUserChannelOverride.js

* Update ClientUserGuildSettings.js
2017-08-01 04:28:15 +02:00
tjpc3
4f5d1bffaf fix node.js crash due to error messages being called with invalid error keys (#1728)
* Comments

* More Comments

* Added new error message

* Fixed error message

* Removing temporary comments

* Fixed error messages

* Added more new error messages

* Removed trailing space

* Removed other trailing space

* Changed error key

* Changed error key used
2017-08-01 04:01:45 +02:00
SpaceEEC
79fed1295c Fixed DiscordAPIError#message sometimes being undefined (#1735) 2017-07-31 01:18:55 +02:00
SpaceEEC
fe8f371d82 Fixed Client#guildMembersChunk's members collection's key being undefined. (#1736) 2017-07-31 01:16:50 +02:00
Gus Caplan
0acb0ac5dc fix unpack weird issues (#1729) 2017-07-29 22:02:56 +02:00
bdistin
080996b5a9 fix sequential and burst ratelimiters from going on timeout because the queue is empty (#1722)
* create branch for me to work on

* fix sequential and burst ratelimiters from going on timeout because the queue is empty
2017-07-27 02:51:58 +02:00
aemino
e29a3ec08b Handle unexpected disconnects via packets (#1521) 2017-07-26 10:10:21 +02:00
aemino
4342ed29a8 Audio bitrate support (#1439)
* Audio bitrate support

Note: not implemented for VoiceBroadcasts

* Fix default args, auto bitrate

* Late night typos are the best

* Changes bitrate to kbps for VoiceChannel stuff

* Add methods to manipulate bitrate while encoding
2017-07-26 10:06:40 +02:00
Will Nelson
7eb9e65c41 check guild availability when aggregating client emojis (#1711) 2017-07-26 10:04:43 +02:00
Gus Caplan
57b6980313 retry on 500 (#1709) 2017-07-22 23:21:50 +02:00
Gus Caplan
a2eeafc75d rewrite ratelimiting and api route builder (#1667)
* rewrite ratelimiting and api route builder

* more stuff

* let people pass their own handlers

* Update burst.js

* Update RequestHandler.js

* Update burst.js

* Update sequential.js

* Update RequestHandler.js
2017-07-21 02:32:40 +02:00
SpaceEEC
11556c0b3b Moved all error strings to src/errors/messages and a few other things (#1695)
* Added missing error messages
As well as `Guild#setRolePosition` and `Guild#setChannelPosition`'s first arg validation
And fixed a typo in `Guild#setChannelPosition`
`roles` -> `channels`

* Reverted collection and Util constructors

* Removed leftover messages
Should have been in the second commit.

* It's a single invalid permission and removed unused flag error

* Fix INVALID_TOKEN -> TOKEN_INVALID as of #1703
2017-07-21 02:27:19 +02:00
Raphael
111fa2da93 Fix typo in client.voiceConnections docs (#1679)
Fix typo in client.voiceConnections docs
2017-07-11 05:42:14 +02:00
SpaceEEC
c0e9ce2a1d functions for setTimeout should get the context bound and not applied (#1673) 2017-07-10 03:34:54 +02:00
Crawl
0c34f3a313 Update dependencies & make webpack great again 2017-07-05 11:53:53 +02:00
Gus Caplan
e3cd000ec0 update http options to fit discord spec (#1656)
* Update Constants.js

* Update APIRequest.js

* Update Invite.js

* Update Constants.js
2017-07-05 09:10:06 +01:00