Commit Graph

85 Commits

Author SHA1 Message Date
Schuyler Cebulskie
7cd0a9525d Fix ClientUser not extending custom User 2017-11-24 23:05:00 -05:00
Frangu Vlad
0cd4a92fb8 docs: Fixed some missing docstrings or incorrect return types (#2093)
* Fix some missing doc strings
Mainly just readonly tags

* Return an error when guild#allowDMs is ran from a bot account, and fix some return types

* WebhookClient implements Webhook, doesn't extend it

* Fix Client#rateLimit docs not showing what it returns

Cause I wanted to handle this event only to see no return props 🤔

* Actually make Client#rateLimit show the right info

Its an object with all the info
2017-11-17 14:20:57 +01:00
bdistin
cda408534a user.patch shouldn't try to touch the token (#2072) 2017-10-28 18:57:50 +02:00
Robin B
97823bc376 Various documentation adjustments (#2001)
* docs(various): Add "at" to createdAt description

* docs(Client): Adjust to fit with guilds property

* docs(various): Adjust phrasing & fix typos

* docs(various): Clarifications

* docs(Permissions): fix numerus

* docs(DataStore): capitalize DataStore

* docs(various): Formatting changes

* docs(Presence): Expand RichPresenceAssets docs

* Add space
2017-10-07 01:56:17 +02:00
kyraNET
b8f17aa51c [Documentation] Added a warn in fetchMentions (#1991) 2017-10-01 18:16:56 +02:00
Gus Caplan
27ccad1f1c tinify webpacks (#1975)
* tinify webpack

* meme

* fix long version

* more changes

* even smoler

* fix up logic

* fix build

* undo changes to user agent manager because its not webpack'd anymore

* the heck

* fix stupid

* clean up browser rules

* typo
2017-09-26 07:18:12 +02:00
SpaceEEC
ec4c98704f refactor: make use of destructuring for Constants (#1942) 2017-09-16 20:31:36 +02:00
bdistin
dd085ceaee Datastore cleanup (#1892)
* Start Store cleanup

* wip store cleanup

* fix iterables initiating datastores

* handle the possibility of a datastore with no holds and no its own 'create' method

* more cleanup (instances that need more than just client/data)

* missed RoleStore extras

* not sure how eslint didn't catch that tab...

* avoid re-getting the channel we already have...

* cleanup resolvers and refactor them into DataStores

* ^

* and remove

* fix some bugs

* fix lint

* fix documentation maybe?

* formatting

* fix presences

* really fix presences this time

* bad fix was bad... let;s see how bad this one is..

* forgot to save a file

* make presence resolving take userresolveables too

* fix tabs in jsdocs

* fix bad fix from last night that caused issues, with better fix...

* oops
2017-09-08 23:06:10 +02: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
c4b5736a16 refactor/fix(DataStores): move instantiating of store related classes into their date stores (#1869)
* refactor/fix(DataStores): move instantiating of store related classes into the relevant create methods and fixed FetchMemberOptions

* Renamed ChannelStore's constructor parameter for claritiy

* define client property before creating items from passed iterable to avoid the client property being undefined

* Fix fetching members with a limit

* add static Channel#create back and moved channel instantiating there

* make ChannelStore's constructor accept an iterable

* make iterable an optional parameter, allow to just pass client and options

* fixed a little typo in docs of <User>.displayAvatarURL() (#1872)

* 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

* fix: made options.type optional in ClientUser#setActivity (#1875)

* fix: made options.type optional in ClientUser#setActivity

* some changes, smol fix

due to too many types being possible, it should just be defaulted to 0. this means streamers will have to set the type manually, though.
also mistake with activity.name check

* docs(Collection): Adjust exists documentation (#1876)

Since the return value of Collection#exists is basically just a boolean of Collection#find's result, the same documentation and arguments can and should be applied.

* refactor(Emoji): remove Guild#deleteEmoji in favour of Emoji#delete (#1877)

* refactor/fix(DataStores): move instantiating of store related classes into the relevant create methods and fixed FetchMemberOptions

* Renamed ChannelStore's constructor parameter for claritiy

* define client property before creating items from passed iterable to avoid the client property being undefined

* Fix fetching members with a limit

* add static Channel#create back and moved channel instantiating there

* make ChannelStore's constructor accept an iterable

* make iterable an optional parameter, allow to just pass client and options

* rebase, this time with saving the file

* address issue with falsy activity throwing errors when setting client's presence
2017-09-03 12:57:49 +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
SpaceEEC
c4fecf6609 Simplified image resolving and used an options object when creating webhooks (#1843) 2017-08-28 00:11:19 +02: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
iCrawl
2aa2f73c74 Docs cleanup 2017-08-17 20:04:01 +02:00
SpaceEEC
e677543c30 Allow to set the new game types via ClientUser#setPresence and ClientUser#setGame (#1782)
* Allow to set the new game types via ClientUser#setPresence and setGame

* Accept string version of types, fix options parameter, remove Presence#streaming

* One line if statement, don't reuse data.game when game is already reassigned and fix error message

* Removed redundant if statement
2017-08-17 18:27:32 +02:00
Johnson Chen
9c52030c29 ClientUser Fixes (#1741)
* Fixes #1702

* Remove Comments

* Follow what Gus said... I hope

* JSDoc

* Update ClientUser.js

* TIL my knowledge about JSDocs was a lie
2017-08-12 12:01:43 +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
fa5c4efa2b Fixed a bunch of ClientUserGuildSettings stuff and its docs (#1758) 2017-08-10 01:25:24 +02:00
SpaceEEC
317a352337 Fix ClientUser#settings not showing up in the documentation (#1757) 2017-08-05 15:41:00 +02:00
SpaceEEC
abfda7c3cc Fixed ClientUser#createGroupDM on user accounts and added some more GroupDMChannel stuff (#1747)
* ClientUser#createGroupDM now works like the docs states on user accounts

* Added GroupDMChannel#setIcon and fixed null handling for the channel name

* Added an s

* Don't resolve when icon is falsy and removed useless name trimming

* Removed now unnecessary name constant

* vscode being great

* Added GroupDMChannel#iconURL
2017-08-04 09:17:46 +02:00
Gus Caplan
fd11381cc5 fix more race conditions (#1740)
* Update ClientUser.js

* Update ClientUserGuildSettings.js
2017-08-01 05:42:22 +02:00
Gus Caplan
4b77f26851 Update ClientUser.js (#1739) 2017-08-01 05:35:59 +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
Crawl
4adecf4aef 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-27 03:04:03 +02:00
Crawl
07178a0a2a Revert "rewrite ratelimiting and api route builder (#1667)"
This reverts commit a2eeafc75d.
2017-07-26 23:00:46 +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
Gus Caplan
5ecd5f7d69 REST API speed improvement (#1577) 2017-07-01 10:14:17 +01:00
Gus Caplan
63e54982f4 Errors Standardization (#1246)
* errors and stuff

* more errors

* all the errors

* fix build
2017-06-25 18:48:05 +01:00
SpaceEEC
4f23822264 Wait for the websocket event when creating a guild (#1524)
* Wait for the websocket event when creating a guild

* using TOOK_TOO_LONG error

* resolve after timeout with an unavailable guild object
2017-06-23 20:49:56 +01:00
Marko Kajzer
c84529c102 Fixes #1548 (#1551)
* Added possibility to remove avatar

* Changed as requested

* Removed extra blank line
2017-06-01 06:06:46 +02: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
SpaceEEC
e66fa145d2 fix fetchMentions' auth header, options and data mapping (#1457)
* fix fetchMentions' auth header, options and data mapping

* vscode strikes again

* switched to Util.mergeDefault

* vscode

* removed duplicated optionals and switched to instanceof
2017-05-06 01:04:12 +02:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
stupid cat
d6b7d31047 Better ClientUser#setStatus for self bots (#1428)
* better setstatus for selfbots

* make both calls

* must return

* use setpresence, set invisible
2017-04-29 14:31:32 +01:00
Crawl
c095610bb4 Change docstring 2017-04-23 06:50:43 +02:00
Amish Shah
5605dc04e1 Fix #1399 (Trying to unset games with values other than null doesn't end up displaying properly for mobile clients) 2017-04-21 11:42:19 +01: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
Motion
cee0d58fb8 Added docs warning for acceptInvite method (#1267)
Added docs warning for acceptInvite method (user account only iirc)
2017-03-13 07:04:31 +00:00
Schuyler Cebulskie
f3a7f59824 Several improvements
- Rename Guild#updateChannelPositions -> setChannelPositions
- Allow Guild#setChannelPositions to take ChannelResolvables
- Prioritise ClientDataResolver#resolveChannel's string case
- Minor cleanup
2017-02-25 15:29:32 -05:00
Gus Caplan
4c9d8d6cd7 add lots of group dm features (#1208)
* group dm stuff

* minor doc changes
2017-02-22 20:33:20 +00:00
Joschua Schneider
5c2086b351 Allow presence updating to allow null games (#1186)
* Adding resetGame functionallity

`setGame` method would allways result in an Object passed to `setPresence`.
Passing { game: null } (supported by discords WebSocket gateway to reset the current Game) to `setPresence` would still result in a Game Object sent to the endpoint.
Explicitly setting `game` to null should overwrite the `game` object provided by `localPresence` or `client.presence`.
This was neither supported by `setGame` or `setPresence`.

* Missing semicolons to resetGame and setPresence

* Fixing trailing spaces, commas and semicolons

* Moving resetGame functionality into setGame method

Minification of if statement in setPresence.
Removing resetGame method and adding a case for `game === null` to setGame method

* Adding missing space in setGame method

* Fix docs
2017-02-22 20:24:39 +00:00
Gus Caplan
48be401330 add clientuser acceptinvite (#1081)
* add clientuser acceptinvite

* Update RESTMethods.js

* Update ClientUser.js

* Update ClientUser.js

* Update RESTMethods.js
2017-01-14 21:25:12 +00:00
Gus Caplan
a66b2b7ec5 add more things to clientuser (#1066)
* add more things to clientuser

* add desc
2017-01-05 16:38:48 +00:00
Gus Caplan
495264761c Add snowflake utils (#1064)
* snowflakes

* use proper binary for snowflake example

* fix jsdoc errors

* remove dupe
2017-01-05 15:41:42 +00:00
Schuyler Cebulskie
4447e367f6 Fix other BufferResolvables with base64 2016-12-30 16:22:29 -05:00
Gus Caplan
258e4b9085 fix setting avatar to buffer (#1048) 2016-12-30 17:00:16 +00:00
Gus Caplan
22b1c425ac add ClientUser.settings (#1041)
* add user settings

* Update Ready.js
2016-12-29 18:58:39 +00:00
Schuyler Cebulskie
1b76333b8b Add missing @typedef line 2016-12-29 03:04:11 -05:00
Schuyler Cebulskie
fe7ed523b3 Improve ClientUser presence method docs 2016-12-29 03:01:34 -05:00