Commit Graph

83 Commits

Author SHA1 Message Date
Sanctuary
1a8e8c7a67 docs: Add/normalize .toString() docs on all classes (#2042)
* docs: Add/normalize .toString() examples on all classes

* docs: Remove exclamation point on ClientApplication#toString example

* docs: Normalize .toString() descriptions on all classes

* Use "returns" instead of "concatenates"
2017-10-28 19:06:26 +02:00
Frangu Vlad
37f5256a04 fix(GuildChannel|Role.edit) Editing with a position not being right (#2010)
* Fix GuildChannel.edit and Role.edit for positions

* Re-use Util.setPosition
And also make it even more compact! And it works! \o/
2017-10-19 07:10:39 +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
Isabella
b462a7b94f fix(Role): setPosition typo (#2003) 2017-10-03 21:12:38 +02:00
Frangu Vlad
743668a10d fix: setPosition taking wrong IDs and edit with position 0 breaking (#1989)
* Fix typo in setPosition

* Same typo in Role

* Fix edit with position breaking when the position was 0

* Eslint

* Revert code but fix the position issue
2017-10-02 15:54:18 +02:00
bdistin
f89ec00b30 Missed a deprecated method removal (#1950)
And another that should be removed too.
2017-09-24 17:29:45 +02:00
Gus Caplan
2ffe3048ba clean up positions (#1919)
* clean up positions

* perf i guess
2017-09-09 22:40:32 +02:00
bdistin
98582cd1b7 Permissions Cleanup (#1643)
* fix Permissions.add/remove, by completely changing what they do

* permissions cleanup

Removes overwrite._denied and overwrite._allowed in favor of overwrite.denied.bitfield and overwrite.allowed.bitfield

uses the modified Permissions.add and Permissions.remove to clean up existing code

fixes GuildMember.missingPermissions

changes Permissions add/remove to reverse loops for speed, changes resolve to allow the number 0 as a valid permission.

* Revert createChannel overwrite.allow / overwrite.deny for arrays of {allow:bitfield, deny:bitfield}

Documentation should be improved here, although I would need advice. I believe a overwrite object typedef is needed, to show the structure of the object, and also include that collections may be used for this, rather than arrays.

* api router fix for overwritePermissions

* add Permissions.freeze, and change all returned Permissions to immutable instances

* Make Permissions a permission resolveable

change role.permissions to be an instance of Permissions

* Make permissions.add/remove return a new instance if the instance is frozen

* Fix invalid error

* Update GuildChannel.js

* Update Guild.js

* fix bad merge
2017-09-09 22:07:39 +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
e34bd7c09c fix(Errors): throw DiscordjsErrors where one would expect them (#1905) 2017-09-08 00:50:01 +02: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
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
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
SpaceEEC
a49709d329 Readded permissions to Role#edit's payload (#1760) 2017-08-10 01:18:13 +02:00
Pg Biel
eef87e5d97 Reasons (#1715)
* Add reasons

* How could I forget

* Hopefully fix conflicts
2017-07-27 03:14:04 +02:00
Crawl
0c34f3a313 Update dependencies & make webpack great again 2017-07-05 11:53:53 +02:00
Gus Caplan
5ecd5f7d69 REST API speed improvement (#1577) 2017-07-01 10:14:17 +01:00
Tyler
7896081966 Fix <Role>.editable (#1547) 2017-05-30 15:36:04 +02:00
Drahcirius
4292134647 Refactored static resolvers to Util (#1517)
* ready event will now throw errors properly

* ws login rejection fix

* moved static resolves to util
2017-05-23 12:18:18 +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
Crawl
ca926ee404 Remove all deprecated methods / props 2017-05-14 20:15:55 +02:00
Isabella
a02e10926d Stop using deprecated methods within discord.js (#1441)
* fix deprecation stuff

* fixed a check
2017-05-01 10:14:26 +01:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
Amish Shah
c40252381b Deprecate all the things 2017-04-29 21:09:53 +01:00
SpaceEEC
ecb8655dac Document readonly and private properties (#1338) 2017-04-03 20:05:36 +02:00
Crawl
7ffbbc7f07 Fix _sortedRoles in Role.js 2017-04-01 16:28:19 +02:00
Gus Caplan
a4e0af2e45 make positions for channels and roles nicer (#1211)
* make role calculated position nicer

* make channels sortable in a nice way too

* stupid git web rebase editor

* Update Guild.js

* Update Guild.js

* Update Guild.js

* Update Guild.js

* Update RESTMethods.js
2017-04-01 08:28:54 +02:00
Schuyler Cebulskie
2349238f69 Fix #1287 (Role#serialize) 2017-03-21 01:24:53 -04:00
bdistin
14ae7cdf17 [Docs] Evaluated Permissions References (#1250)
* Docs / Permissions Overwrites Reference

* Docs / Evaluated Permissions Reference

* Clarify role.permissions is not evaluated

* Update Role.js
2017-03-09 18:32:44 -05:00
Gus Caplan
2897692cf1 fix created timestamp precision (#1241)
* fix created timestamp precision

* perf

* Update Snowflake.js

* gawdl3y was butthurt

* Update Snowflake.js
2017-03-09 18:31:31 -05:00
Schuyler Cebulskie
3e5096f9fe Update Role#hasPermission, and deprecate hasPermissions 2017-03-06 19:58:42 -05:00
Schuyler Cebulskie
df2333ac82 Fix Role#hasPermission 2017-03-06 19:38:58 -05:00
Schuyler Cebulskie
16fe48d405 Overhaul Permissions utilities (EvaluatedPermissions no more) 2017-03-06 02:22:42 -05:00
Programmix
a029999b09 Doc fixes, mostly pertaining to Snowflakes (#1218)
GUS!!!! @GusCaplan
2017-02-24 15:33:51 -05:00
Gus Caplan
566135d25b move permission stuff to the resolver (#1185) 2017-02-22 20:11:11 +00:00
Gus Caplan
1e94a9e2a4 serious role position stuff (#1159)
* serious role position stuff

* kill meh

* Update Role.js

* Update Guild.js

* Update Role.js
2017-02-01 22:02:16 +00:00
Gus Caplan
0d4eab8d24 add color resolvable, and color constants from the client (#1080)
* add color resolvable, and color constants from the client

* fix up docs

* Update ClientDataResolver.js

* add easter eggs

* Update ClientDataResolver.js

* Update RESTMethods.js
2017-01-12 18:43:22 +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
Gus Caplan
3451367591 fix the everyone role mentioning (#1032) 2016-12-28 19:04:54 +00:00
Alexander
264ee8e7f1 Equals updates (#987)
* Docs update

Changed the param names and param descriptions to be consistent.

* Added === comparison

Changed Presence.equals and Game.equals to first compare using ===

* Collection.equals fix

Now returns false when collection is undefined, instead of crashing
💯
2016-12-14 17:10:34 -05:00
Schuyler Cebulskie
6adc8a9d0d Move a getter around 2016-12-02 22:47:12 -05:00
Schuyler Cebulskie
2488e1a00f Improved the definition of structures' client properties 2016-12-02 19:52:27 -05:00
Schuyler Cebulskie
6dc93a0184 Simplify Role#setPosition 2016-11-27 20:03:44 -05:00
Amish Shah
e2932c05f2 whoops fix derp 2016-11-26 22:43:41 +00:00
Amish Shah
27e77d3839 Fix Role.setPosition not returning Role (addresses #902) 2016-11-26 22:42:33 +00:00
Amish Shah
544540fb02 Change Role.manageable to Role.editable 2016-11-06 16:49:14 +00:00
HyperCoder
7d02e73a26 Add <Role>.manageable (#878) 2016-11-06 16:43:39 +00: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