Commit Graph

3043 Commits

Author SHA1 Message Date
iCrawl
a8df63ad1a docs: collection first, firstKey, last, lastKey
"count is negative" -> "amount is negative"
2017-09-05 18:04:18 +02:00
Amish Shah
4a8ada9c43 Fix ESLint error 2017-09-05 12:02:21 +01:00
Amish Shah
e686c9a816 Fix userUpdate event 2017-09-05 11:52:17 +01:00
Robin B
e5ac8f34ee Collections: Negative amounts and fixes (#1889)
* feat(Collection): Negative amounts plus fixes and refactor

* fix(Collection): Fix result when supplying false boolean as amount
2017-09-05 11:31:33 +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
Schuyler Cebulskie
70612d3a7c Update typings 2017-09-04 18:39:47 -04:00
Gus Caplan
18e3801bb7 lots of important stuff (#1883)
* lots of important stuff

* Update Constants.js
2017-09-04 17:49:44 +02:00
Cynthia Lin
3a503ef56e Fix code inconsistencies and redundancy in util/Collections.js. (#1884)
* Normalize undefined type checks in collections with typeof operators.

* Remove redundant number type checking in collections.

Number.isInteger() throws false for strings and any other types that aren't numbers.
2017-09-04 17:45:58 +02:00
Amish Shah
2e4de62ddf Potentially fix #1870? 2017-09-04 14:14:11 +01:00
Robin B
ea1949a0e2 fix(MessageStore): Fix fetchPinned method and add notice. (#1881) 2017-09-04 05:26:36 +02:00
SpaceEEC
f40a5e9f88 feature(MessageReaction): add after option when fetching users who reacted with an emoji (#1882) 2017-09-04 05:22:01 +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
SpaceEEC
c93c4ad21f refactor(Emoji): remove Guild#deleteEmoji in favour of Emoji#delete (#1877) 2017-09-03 12:01:47 +02:00
Robin B
efbde07650 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.
2017-09-03 12:00:36 +02:00
Isabella
39013b1242 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
2017-09-03 12:00:11 +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
Raphael
765b652e6a fixed a little typo in docs of <User>.displayAvatarURL() (#1872) 2017-09-02 14:56:49 +02:00
SpaceEEC
1bdaa62481 fix(Guild): passing the constructor partial data from an invite no longer errors (#1868) 2017-09-01 16:05:02 +02:00
Isabella
b8a37b6f0c fix removal of Guild#afk/system channels and icon (#1863)
* fix removal of Guild#afk/system channels

* guild#setIcon too

* less ternary, many wow
2017-09-01 07:33:41 +02:00
Frangu Vlad
434a22dc4e MessageOptions can take content (#1861) 2017-08-31 18:27:58 +02:00
Amish Shah
7f921883f4 Fix TextChannel#createWebhook 2017-08-31 15:55:05 +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
Amish Shah
5121a02f13 Fix #1854 2017-08-30 12:33:01 +01:00
Amish Shah
eb5ba4e45e Fix #1855 2017-08-30 12:20:32 +01:00
SpaceEEC
4e028d713a Fixing MessageReaction#count always being 1 (#1857) 2017-08-30 13:01:27 +02:00
SpaceEEC
b7c55f02c2 Allow Message#edit to accept a MessageEmbed as options parameter (#1844) 2017-08-28 03:05:34 +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
SpaceEEC
c4fecf6609 Simplified image resolving and used an options object when creating webhooks (#1843) 2017-08-28 00:11:19 +02:00
SpaceEEC
258fc4ecf3 Fix MessageMentions#has not returning true for role mentions (#1840) 2017-08-27 23:51:15 +02:00
iCrawl
3c532f16bc Remove unused Util require 2017-08-26 16:12:18 +02:00
Amish Shah
4f5cbbc0f0 Merge branch 'master' of https://github.com/hydrabolt/discord.js 2017-08-26 13:51:56 +01:00
Amish Shah
7d750c4680 pass on error 2017-08-26 13:51:53 +01:00
Gus Caplan
d792c6764a ChannelStore LRU (#1832) 2017-08-26 13:48:31 +01:00
Amish Shah
92a52460e1 Fix GuildMemberStore docs 2017-08-26 13:47:26 +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
c3d7c73e47 Add GuildMemberStore#fetch 2017-08-26 13:00:36 +01:00
Frangu Vlad
284f4e8ac0 Fix MessageEmbed copy paste (#1834)
The addField function wouldn't have errored if value wasn't a string
2017-08-26 10:03:44 +01:00
BigBrainAFK
86ffdc38d3 Mark video property as readonly (#1833) 2017-08-26 10:00:33 +01:00
Amish Shah
5fcc483ded Donate badge thxxx 2017-08-26 00:26:03 +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
84153be894 Fix #1281 2017-08-25 23:41:26 +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
iCrawl
243ff48a67 Remove unneeded doc string 2017-08-24 00:36:13 +02:00
Gus Caplan
b9ea83afb4 update web.md (#1821) 2017-08-22 21:20:26 +02:00