Commit Graph

138 Commits

Author SHA1 Message Date
Rodry
e44ae96100 fix(User): fix bot and system properties being incorrect in some cases (#5923) 2021-06-27 12:46:24 +01:00
Rodry
e0efcc6ab0 docs(*): add links to Discord's API objects & data (#5862) 2021-06-24 09:55:44 +01:00
SpaceEEC
097c7b9cdd fix: don't patch missing properties from partial payloads (#5796)
* fix: don't patch missing properties from partial payloads

* fix(GuildChannel): initialize permissionOverwrites in the constructor

* refactor(GuildChannel): remove redundant if
2021-06-10 17:42:45 +01:00
Jan
164ddf668f refactor: rename Snowflake to SnowflakeUtil (#5502) 2021-04-15 00:37:54 +02:00
Sugden
ee5bc1a5c4 refactor: switch api and gateway to V8 (#4879)
Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
2021-02-11 18:10:35 +01:00
Carter
09d07553ab docs(User): fix typos in jsdoc (#5060) 2020-12-06 18:03:39 +01:00
Advaith
6f3076325e remove User#locale (#4932) 2020-11-22 19:39:06 +01:00
SpaceEEC
eaecd0e8b7 fix(User): only assign to bot initially or if info is actually present (#4990) 2020-11-20 16:48:05 +01:00
Sugden
af670fc718 refactor: improve the accuracy of docs/improve docs (#4845)
Co-authored-by: Noel <icrawltogo@gmail.com>
2020-10-17 15:53:02 +02:00
Sugden
6aab9c3d64 fix: correctly import extendable classes (#4744) 2020-08-28 14:19:20 +02:00
Carter
b6167d8c3b docs: update jsdoc type for User#bot (#4716) 2020-08-17 09:45:57 +02:00
Jan
db512d8f62 fix(User): set User#bot to false if not partial (#4706)
Co-authored-by: Noel <icrawltogo@gmail.com>
2020-08-15 20:04:32 +02:00
Sugden
980243f2d5 fix(Partials): correctly set properties as nullable (#4636) 2020-08-12 21:26:59 +02:00
Carter
290938bf80 feat: bypass cache check with forceFetch param (#4592) 2020-08-12 21:23:04 +02:00
Jyguy
6fbaf0a036 fix(User): jsdoc for User#flags (#4094) 2020-04-18 12:15:30 +02:00
Carter
2e5a6476d5 feat: User#flags (#4060)
* feat: user flags

* fix: unnecessary negated statement

* fix: wording for description

* fix: an vs. a

* feat: add verified bot and dev flags

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* typings :verified bot and dev flags

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* feat: mon's suggestion, async fetchFlags & jsdoc

* feat: added to index.js

* fix: typo

* style: leveled flags

* typings: update leveled flags

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2020-04-16 10:32:15 +02:00
Sugden
8b906c69bb fix(Partials): correctly document properties for partialized st… (#3922)
* fix(Partials): properly document partial properties

* style: turn tabs into spaces

* style: order properties alphabetically

* fix(typings): PartialDMChannel will always have a recipient

* change properties to undefined instead of null

* docs: correctly mark properties

* style: remove tabs

* fix(partials): document properties properly

* style: tabs

* style: random line

* docs(User): tag is nullable

* typings(User/GuildMember): document lastMessageID properly

* typings/fix: change lastMessageID to lastMessageChannelID

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-03-17 18:59:47 +01:00
Crawl
c065156a88 chore: consistency/prettier (#3852)
* chore: consistency/prettier

* chore: rebase

* chore: rebase

* chore: include typings

* fix: include typings file in prettier lint-staged
2020-02-29 14:35:57 +01:00
BorgerKing
bbdbc4cfa7 feat: remove datastores and implement Managers (#3696)
* Initial commit: add 5 initial managers

- Base manager
- GuildChannelManager
- MessageManager
- PresenceManager
- Reaction Manager
- Added LimitedCollection

* Add GuildEmojiManager, various fixes

* Modify some managers and add guildmembermanager

* Initial integration

* Delete old stores

* Integration part two, removed LRUCollection

- Most of the integration has been finished
- TODO typings
- Removed LRUCollection, needless sweeping

* Typings + stuff i somehow missed in ChannelManager

* LimitedCollection typings/ final changes

* Various jsdoc and syntactical fixes, Removed Util.mixin()

* tslint fix

* Grammatical and logical changes

* Delete temporary file placed by mistake

* Grammatical changes

* Add missing type

* Update jsdoc examples

* fix: ChannelManager#remove should call cache#delete not cache#remove

* fix recursive require

* Fix missed cache in util

* fix: more missed cache

* Remove accidental _fetchMany change from #3645

* fix: use .cache.delete() over .remove()

* fix: missing cache in ReactionCollector

* fix: missed cache in client

* fix: members is a collection not a manager

Co-Authored-By: Sugden <28943913+NotSugden@users.noreply.github.com>

* fix: various docs and cache fixes

* fix: missed cache

* fix: missing _roles

* Final testing and debugging

* LimitedCollection: return the Collection instead of undefined on .set

* Add cache to BaseManager in typings

* Commit fixes i forgot to stage yesterday

* Update invite events

* Account for new commit

* fix: MessageReactionRemoveAll should call .cache.clear()

* fix: add .cache at various places, correct return type

* docs: remove mentions of 'store'

* Add extra documented properties to typings

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-11 20:21:07 +01:00
Tenpi
8014ddcd1c feat: dynamic property for ImageURLOptions (#3530)
* Added dynamic property to ImageURLOptions

* fixes

* order

* typings fix

* made dynamic false by default

* add curly spaces
2020-01-13 14:32:29 +00:00
izexi
6af0da1043 feat(Partials): add DMChannel/MessageReaction#fetch() and PartialTypes.REACTION (#3474)
* add DMChannel#fetch() & Action#getChannel({recipients})

* ref for MessageReaction partial

* typings

* add PartialTypes.REACTION

* accommodate for fully removed reactions

* fix incorrect wording and typo

* typings: MessageReaction#count is nullable

* typings: mark MessageReaction#partial as readonly

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* fix(User): fetch dm channel if cached one is partial

* docs: add missing comma

Co-Authored-By: Antonio Román <kyradiscord@gmail.com>

* fix: accomodate for new reactions

* fix: updating existing/new count on _patch

* docs: typo

* for consistency

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2020-01-05 16:45:49 +01:00
izexi
43782839ec feat: add new MessageFlags.FLAGS & User#system (#3603)
* feat: add new FLAGS

* feat: add system property

* typings: add User#system & new MessageFlagsStrings
2019-12-15 20:23:06 +01:00
Crawl
321beb73bd revert: "feat(Partials): add DMChannel/MessageReaction#fetch()… (#3468)
This reverts commit b0047c424b.
2019-09-10 19:49:56 +02:00
izexi
b0047c424b feat(Partials): add DMChannel/MessageReaction#fetch() and Parti… (#3261)
* add DMChannel#fetch() & Action#getChannel({recipients})

* ref for MessageReaction partial

* typings

* add PartialTypes.REACTION

* accommodate for fully removed reactions

* fix incorrect wording and typo

* typings: MessageReaction#count is nullable

* typings: mark MessageReaction#partial as readonly

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* fix(User): fetch dm channel if cached one is partial

* docs: add missing comma

Co-Authored-By: Antonio Román <kyradiscord@gmail.com>
2019-09-10 16:09:06 +02:00
SpaceEEC
ca43919642 docs: document constructors of extendible structures (#3160)
* docs: document constructors of extendible structures

* docs(ClientPresence): document default value for data parameter

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

* docs(Presence): document default value for data parameter

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

* docs(DMChannel): capitalize DM in the constructor doc
2019-04-14 14:50:55 +02:00
SpaceEEC
e62833b5e1 docs: mark getters as @ readonly 2019-03-19 19:59:45 +01:00
bdistin
fe5563e158 refactor(User): avoid invoking dmChannel getter more than once per method (#3108)
also refactors to async methods
2019-02-24 09:37:10 +01:00
Amish Shah
5c3f5d7048 Partials (#3070)
* Remove GroupDMChannels

they sparked no joy

* Start partials for message deletion

* MessageUpdate partials

* Add partials as an opt-in client option

* Add fetch() to Message

* Message.author should never be undefined

* Fix channels being the wrong type

* Allow fetching channels

* Refactor and add reaction add partials

* Reaction remove partials

* Check for emoji first

* fix message fetching

janky

* User partials in audit logs

* refactor overwrite code

* guild member partials

* partials as a whitelist

* document GuildMember#fetch

* fix: check whether a structure is a partial, not whether cache is true

* typings: Updated for latest commit (#3075)

* partials: fix messageUpdate behaviour (now "old" message can be partial)

* partials: add warnings and docs

* partials: add partials to index.yml

* partials: tighten "partial" definitions

* partials: fix embed-only messages counting as partials
2019-02-13 17:39:39 +00:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Frangu Vlad
4a24e8c12c Remove double iteration (#2773) 2018-08-19 13:37:00 +02:00
bdistin
0ad7c24aa3 docs(User): fix hydrabolt's tag (#2747) 2018-08-14 19:09:10 +02:00
Amish Shah
e2ceea65ba Fix default presence for Users 2018-08-11 11:48:18 +01:00
Amish Shah
ea764afad2 add ClientPresence, remove ClientPresenceStore 2018-08-11 10:46:51 +01:00
bdistin
5afd77ab73 refactor: remove user bot methods (#2559)
* [WIP] Remove user bots

* more backend userbot removal

* Add mfaEnabled back

* revert client presences store removal

* partially revert getAuth changes

* remove more no longer used children of ClientUserGuildSettings

* fix a bug with this pr and TextBasedChannel.applyToClass

* remove a syncGuilds reference

* more user bot data handling

* various guildSync cleanup

* bots can't call logout

Had the user/bot portions of the code mixed up. Though, does this need to be a promise anymore?

* make ClientManager#destroy() sync

It nolonger needs to be a promise, and nothing depended on it being a promise that I can tell.

* requested change

* Fix massive error

* no longer used as it's userbot only
2018-07-25 22:14:23 -04:00
PLASMAchicken
c46cbbfd84 docs: added sizes 16, 32, 64 (#2666)
* documented sizes 16, 32, 64

* Removed space

* Added typedef

* The options to provide => Options for the Image URL

* fixed
2018-07-25 21:04:47 -04:00
iDroid
bce9a8af1b feat(User): add locale property (#2571) 2018-06-10 10:58:00 -05:00
bdistin
630009f3cf fix: Convert lastMessage to getters (#2384)
* convert lastMessage to getters

* fix bug in pr

* requested changes
2018-03-08 10:19:43 -06:00
bdistin
799eea957e consistency: getters return null instead of undefined (#2385) 2018-03-08 10:15:06 -06:00
Will Nelson
cf7dcba1a5 Add toJSON methods (#1859)
* tojson things

* fix client

* ignore private properties

* remove extra property descriptors

* handle primitive flattening

* remove unused import

* add toJSON to collections

* reduce stateful props

* state

* allow custom prop names when flattening

* fix client

* fix build

* fix flatten docs

* remove guild.available, cleanup permissions, remove arbitrary id reduction

* fix util import

* add valueOf as needed, update member props

* fix incorrect merge

* update permissionoverwrites and permissions

remove serialization of permissions in PermissionOverwrites#toJSON.
change Permissions#toJSON to serialize permissions, by default excluding
admin checks.

* change Permissions#toJSON to return the primitive

* Permissions#toJSON explicitly return bitfield
2018-03-01 23:00:21 -06:00
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
SpaceEEC
a62d1e954d fix(Presence): pass client and default to offline (#2071) 2017-10-28 19:03:27 +02:00
bdistin
b255af0825 Fix user.bot (#2073)
* fix user.bot

* user.avatar is nullable (docs)
2017-10-28 18:58:27 +02: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
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
Amish Shah
f95ae4fcb7 Fix userUpdate not triggering for initial setting (or removal) of avatars (#1849) 2017-09-05 19:44:59 +01: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
Amish Shah
2e4de62ddf Potentially fix #1870? 2017-09-04 14:14:11 +01: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