Commit Graph

40 Commits

Author SHA1 Message Date
SpaceEEC
e62833b5e1 docs: mark getters as @ readonly 2019-03-19 19:59:45 +01:00
Isabella
75e264da57 feat: Presence#clientStatus (#2997)
* feat: Presence#clientStatus

* fix Presence#equals check

* fix typings

* vlad changes

* presence consistency docs

* fix docs

* fix big docs fail
2019-02-02 20:29:47 +01:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Isabella
928fb30040 fix: actually fix Readonly typos 2018-08-21 14:25:30 -05:00
Isabella
c59d3299bc fix: typo in Activity#flags 2018-08-21 13:19:45 -05:00
bdistin
c62f01f0e4 refactor(BitField): base class for Permissions, ActivityFlags, Speaking (#2765)
* abstract BitField from Permissions

* reduce useless code, improve docs

* add a ReadOnly identifier to the return type of Bitfield#freeze()

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#partial-readonly-record-and-pick

* fix the RangeError

* update docs, convert Speaking and ActivityFlags to bitfields

* fix some docs

* Fix Speaking BitField oops

* docs for oops

* more incorrect docs

* Fix incorrectly named property

* add new classes to index

* fix missing @extends docs

* default bitfield resolve to 0, and cleanup defaulting everywhere

Also removes GuildMember#missiongPermissions() alias that had incorrect behavior

* Breaking: Rename Overwrite allowed and denied to allow and deny

To be consistent with the api's naming

* fix setSpeaking usage to bitfields instead of booleans

* fix speaking bug in playChunk

* docs: Updated typings

* fix: BitFieldResolvable should use RecursiveArray

* bugfix/requested change

* typings: Cleanup (#2)

* typings: Fix BitField#{toArray,@@iterator} output type

* typings: correct PermissionOverwrites property names and nitpicks
2018-08-21 11:56:41 +02:00
bdistin
6506252054 fix/refactor: fix GuildMember#presence getter and cleanup (#2751)
* Fix guild being a guild and not an AbstractHandler in PresenceUpdate

* update the default guild to be a Guild, and not GuildMember

* getters return null instead of undefined

* fix lint
2018-08-15 08:50:22 +02:00
Amish Shah
08eff66939 Make presences track users and guilds, emit them in presenceUpdate 2018-08-10 16:46:14 +01:00
bdistin
8551b8936c docs: fix a number of spelling mistakes (#2469) 2018-04-13 20:50:47 +02: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
Pascal
464fc14edd fix(Activity): ensure that timestamps are actually numbers
Fixes #2364
Discord sends those timestamps packed as SMALL_BIG_EXT, which get converted to strings in js.
~~Maybe they are already preparing their timestamps for 2038.~~
2018-02-28 09:31:42 +01:00
Snazzah
43363172c2 docs: Add TypeDef for MessageActivity (#2321) 2018-02-04 20:44:13 +01:00
Gus Caplan
bd1bf11ed0 spotify stuff (#2314) 2018-02-02 12:45:18 -06:00
SpaceEEC
016526486c enhancement(Activity): add toString method (#2313) 2018-02-01 18:41:05 -06:00
SpaceEEC
0101392334 Documentation improvements (#2069)
* docs: fix documentation in various places

All stores: resolveID returns a nullable Snowflake
GuildAuditLogs: ActionType also can be ALL
MessageEmbed: make files property show up in the docs
ClientApplication: resetSecret and resetToken return a promise
ClientManager: status is readonly
Guild: features is an array of strings and ban no longer accepts a number or string
Guild: ban method no longer accepts a string or number
GuildMember: ^
RichPresenceAssets: small and large Image are Snowflakes, also fixed parameter documentation for small and large image url method
WebhookMessageOptions: file property is no longer a thing

* docs: improve GuildAuditLogs documentation

Prefix types with AuditLog to avoid confusion
Document GuildAuditLogs' static Targets and Actions properties and add necessary typedefs
Use typdefs over primitives where possible.

* fix documentation for Guild#defaultRole
2017-10-28 19:04:03 +02:00
SpaceEEC
a62d1e954d fix(Presence): pass client and default to offline (#2071) 2017-10-28 19:03:27 +02:00
William Tran
88719f0f42 Typos in docs (#2055)
* Typo in Guild.createRole docs

Added missing semicolon in example code.

* consistent periods in docs
2017-10-28 19:01:17 +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
Frangu Vlad
eb591dafba docs: Fix some small typos or "missing" docs (#1943)
* Fix documentation for GuildAuditLogEntry.target

* Update documentation for CategoryChannel#children

* Add EntryTarget for audit logs

I've done this to "fulfill" devsneks request while also showing all the possible results for the target of an AuditLogEntry

* Oops Eslint

* Private timeout sets gets set by BaseClient not WebhookClient

* Fix the "Missing Docs" for Presence#activity

* Small doc inconsistency

Array<Number> instead of Array<number> for Activity

* Client#emojis is an EmojiStore not a Collection

* Document ClientPresenceStore

Just so its clickable through the wiki, nothing else is documented

* Small fix for BaseClient#setInterval

You don't wait before executing, you execute every X ms

* GuildChannelResolvable takes a GuildChannel/Snowflake

* Typo in UserResolvable

* Another typo for UserResolvable

* Add the number to the Status and VoiceStatus docs

Its probably not needed, but just so the user knows what each number means, its now documented.
2017-09-21 07:02:47 +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
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
Amish Shah
30dd3e0cff Fix #1684 2017-08-26 13:43:13 +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
SpaceEEC
b2c7fcb603 Add support for new game types (#1777) 2017-08-13 13:56:45 +02:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02: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
318bb52c36 Clean up presence constructor 2016-11-12 17:46:11 -05: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
Amish Shah
1fc9676ba5 Fix presences, damn it hydra 2016-10-26 22:09:11 +01:00
Amish Shah
7c26603773 Fix presences probably ¯\_(ツ)_/¯ 2016-10-01 15:27:56 +01:00
Amish Shah
045153584a redo the client user presence stuff 2016-09-27 17:57:47 +01:00
Schuyler Cebulskie
e5f4823bd4 Document do not disturb 2016-09-26 22:56:07 -04:00
Schuyler Cebulskie
0c0c1da0d5 Fix Presence/Game.equals with null/undefined 2016-09-26 22:53:35 -04:00
Schuyler Cebulskie
909af2084f Clean up Presence 2016-09-26 22:53:08 -04:00
Schuyler Cebulskie
f2cd48d94b Reorganise Presence 2016-09-26 22:50:26 -04:00
Amish Shah
f1cb39a319 Expose Presence and Game structures 2016-09-25 20:17:35 +01:00
Amish Shah
761b8cfb8d fix docs 2016-09-25 14:28:51 +01:00
Amish Shah
03651fd6e3 Change how presences are handled 2016-09-25 14:16:03 +01:00