Commit Graph

66 Commits

Author SHA1 Message Date
Amish Shah
08eff66939 Make presences track users and guilds, emit them in presenceUpdate 2018-08-10 16:46:14 +01:00
Amish Shah
fe8ece0192 voice state fixes 2018-08-10 15:15:52 +01:00
Amish Shah
be5efea461 rewrite voice state handling 2018-08-10 14:44:59 +01:00
Isabella
2c8e15e31c docs fix: RoleResolvable typedef missing and incorrecty documented methods (#2640)
* docs fix: RoleResolvable typedef missing and incorrecty documented methods

* requested changes???

* REAL requested changes

* shhh
2018-08-10 11:08:48 +02:00
Alex Hîncu
ce8a679a14 fix(Collection): use Symbol.species for creating derived collections (#2715) 2018-08-10 10:57:33 +02: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
Lewdcario
13bfceb83c fix(GuildMember): mark joined as nullable and fix fetching for these cases 2018-06-05 19:50:36 -05:00
Lewdcario
09708482f6 fix(ReactionUserStore): fetch inconsistency
It should be consistent with MessageStore#fetch now
2018-06-05 00:33:52 -05:00
Lewdcario
dfbd4bdde1 docs: add examples & improve notices 2018-06-05 00:33:43 -05:00
Lewdcario
745669a7c9 docs: consistency 2018-04-29 13:28:12 -05:00
Kyra
934e90b921 fix: Added everyone role to GuildMemberRoleStore#_filtered (#2514)
* Added everyone role to GuildMemberRoleStore#_filtered

* Changed to Guild#defaultRole
2018-04-28 13:40:24 -05:00
Lewdcario
30d43efa54 fix: GuildMemberRoleStore#remove 2018-04-25 18:01:28 -05:00
Isabella
8b83553462 refactor: role stores (#2478)
* refactor: reduced duplication in role stores

* fix docs

* fix: typo

* most of requested changes

* rest of changes

* ACTUAL rest of changes

* docs

* doooocs

* reason
2018-04-24 15:52:00 -05:00
Faith
c9c2d66971 feat(GuildChannelStore): add topic to create options (#2488)
The API provides the ability to send the topic, or description, of the channel within the creation post. Discord.js will now send it if its provided.
2018-04-20 19:11:46 +02:00
Lewdcario
ec9211c3ce docs: inconsistencies 2018-04-18 20:21:17 -05:00
bdistin
8551b8936c docs: fix a number of spelling mistakes (#2469) 2018-04-13 20:50:47 +02:00
bdistin
2bf68dcdfb docs(GuildStore): correct warning for create method (#2453)
Bots may create guilds if they are in less than 10 guilds.
2018-04-09 09:56:25 +02:00
Lewdcario
4e0e64d8a1 fix(MessageReaction): inaccurate count
also works towards async rewrite goal
fixes #2404
2018-03-24 15:22:21 -06:00
Pascal
d041cb2460 fix(GuildEmojiRoleStore): do not prematurely patch roles
Issue is the same as in #2312 and #2381, but for the GuildEmojiRoleStore.
Thanks to @KingDGrizzle for pointing this out.
2018-03-16 20:01:43 +01:00
Pascal
0f7ce3f720 fix(GuildemojiStore): allow resolving of external ReactionEmoji 2018-03-10 14:08:59 +01:00
Lewdcario
a68f14500d fix: GuildMemberStore: unban returns user
fixes #2388
2018-03-08 10:08:59 -06:00
Pascal
3e6c3107c2 fix(GuildMemberRoleStore): make remove role remove roles again 2018-03-05 14:50:59 +01:00
Pascal
3f6a0e4de1 fix(GuildMemberRoleStore): only update roles after successful request
Fixes #2381
2018-03-05 11:32:03 +01:00
Isabella
b637c9c220 feat: allow multiple permission overwrites when editing channel (#2370)
* feat: allow multiple permission overwrites when editing channel

* undo Permissions#resolve change
2018-03-03 11:18:58 -06:00
Lewdcario
9b41a6a8a6 fix: re-add highest property to RoleStore and GuildMemberRoleStore
closes #2302
2018-03-01 11:52:29 -06:00
Sanctuary
87e5a45659 feat(ClientOptions): add support for setting an initial presence (#2320)
* docs/feat(WebsocketOptions): Parse ws options presence

Allow the `presence` property in `WebsocketOptions` to be used the same way
as `ClientUser#setPresence`.

* Move presence options to top level
2018-02-04 21:32:45 +01:00
Pascal
32e2dd212e fix: add clone methods to GuildMember and GuildMemberRoleStore
Fixes #2312
This adds clone method to both classes to achieve the expected behaviour when cloning a GuildMember, also cloning their roles store
2018-01-31 21:04:15 +01:00
Lewdcario
bd154bdd9e fix: nullable activity 2018-01-25 02:06:28 -06:00
Lewdcario
7e0e457334 fix(ClientUser#setStatus): resetting activity
The method would pass in null if no activity was passed, so this takes the current client presence instead of deleting it.
2018-01-24 15:09:40 -06:00
Frangu Vlad
a832b56469 GuildEmoji: Move all role related functions to a separate store (#2271)
* Prepare to work on moving all role functions to a Store

And yes, this is *another* patch branch cause I messed up my master branch to hell

* Move all emoji role related functions to its own store
Tested everything and it works! (With a reload of the client)
Also had to change a value in DataStore#holds
holds.name for GuildEmojis would return the emoji name instead of the class name

* New Line

* Thanks JS for circular dependency!
Because we can't have nice things...

* Do space's request

* Fix equals

* Fix space's point.

Raw API data has the role property as an array of IDs
2018-01-24 20:47:20 +01:00
Pascal
048e147497 fix(RoleStore): create method is supposed to take an options object 2018-01-24 09:02:37 +01:00
Frangu Vlad
00172e6c7d refactor: Move member role-related functions to a special store (#2242)
* Ignore this I need a patch branch for Git

* Move all member role related stuff to a new DataStore
GuildMemberRoleStore is a new store that holds all member role related stuffs
Because its consistent!

* Minorest doc fix ever
To whoever did this object, they forgot a `{`

* Fix the spacing in the docs

* Resue the stores resolve rather than copy paste
Cause I'm dum and it overwrite resolve to the guild role stores resolve soo

* Fix some requests
- Removed the bs private functions
- Set the roles in the constructor

But, I need feedback. There is no way, that I saw, to make a member have roles whenever GuildMmber#_patch is called,
due to the roles being null on the guild. So the only way might be the for loop and getter.

* Fix an issue that I caused in #add
I was testing some other things, and changed that to test. Forgot to change it back

* Actually make the store generate just once when the member is created by first initializing the roles in the guild
Also replaces GuildMember#_roles with GuildMemberRoleStore#_roles
Tested all functions to make sure the expected result happens.

* I missed this from moving remove from GuildMember to GuildMemberRoleStore

* Fix RoleStore#create docs
For real this time

* Do all the requested changes
- Rename all `somethingRole` to `something` (hoistRole => hoist)
- Refactor add and remove to be cleaner and re-use set

* Fix a bug where the store would loose some roles due to null roles that can throw an error in the for loop after they've been deleted

* Remove the `role.id || role` part of the add and remove functions as Appel suggested

* Replace roles.resolve with roles.resolveID for GuildMemberRoleStore#remove

* Don't use Array.isArray in checks
Use instanceof instead

* Woops, I forgot to change this
Renamed colorRole to color

* The docs have dots, so we place the dots back
2018-01-24 08:12:58 +01:00
Pascal
07c48a6845 fix: require discordjserror to throw meaningful errors where necessary 2018-01-22 20:23:36 +01:00
Yukine
bf0a68dbac Mark DataStores as public to directly display them in the docs. (#2268)
* make EmojiStore not Private anymore.

because why have something private if there is priority functionality on that class? also that causes that the docs wont show it directly

* make GuildChannelStore not private anymore

because why have something private if there is priority functionality on that class? also that causes that the docs wont show it directly

* make RoleStore not private anymore

because why have something private if there is priority functionality on that class? also that causes that the docs wont show it directly

* make ReactionStore not private anymore

because why have something private if there is priority functionality on that class? also that causes that the docs wont show it directly

* make all non private to stay consistent

* fix merge conflicts because of other PRs.
2018-01-20 08:00:44 +01:00
SpaceEEC
aa3407f705 Base Emoji class for ReactionEmoji and renamed GuildEmoji classes (#2230)
* feat: create base Emoji class for ReactionEmoji and new GuildEmoji

* rename EmojiStore to GuildEmojiStore to account for the new class' name
2018-01-18 02:38:45 -06:00
Jisagi
ea028ae074 Fix destructuring errors in GuildChannelStore and RoleStore (#2244)
* Permissions#resolve fix

* Travis failed because >120 chars per line

* better fix

Permissions#resolve reverted
removed destructuring in GuildChannelStore and RoleStore
2018-01-13 12:51:09 +00:00
Isabella
9eac19d9d8 refactor: more oop with stores (#2216)
* refactor: more oop with stores

* forgot bulk delete

* Revert "forgot bulk delete"

This reverts commit 1b4fb999ee07b358ee6e1af9efb8981b84f83af1.

* appease linter

* missed some


shh

* fail
2018-01-11 16:33:30 +00:00
Isabella
45127bb408 docs: improve examples (master branch) (#2209)
* docs: improve examples

* more improvements


fix


maybe this


another example


collectors

* stuff
2018-01-04 01:12:05 +01:00
bdistin
3e3674b1af Fix channels.resolve (#2137) 2017-11-30 14:39:58 -05:00
Schuyler Cebulskie
1e0ee2f8fa Replace Structures.extend with set 2017-11-20 01:11:19 -05:00
Schuyler Cebulskie
3728c71867 Fix missing space 2017-11-20 00:24:43 -05:00
Schuyler Cebulskie
63b0c8d5cc Fix circular dependency 2017-11-20 00:23:41 -05:00
Schuyler Cebulskie
f004e6ccca Reimplement Structures.get 2017-11-19 23:00:56 -05:00
Schuyler Cebulskie
cfa512c447 Make structures for data stores extensible 2017-11-19 21:16:14 -05:00
Isabella
5cd42695ae refactor(MessageReaction): ReactionUserStore (#2078)
* refactor(MessageReactions): fetchUsers() is now users.fetch()

made a lovely class for it and all
happify linter


stuff


i know how to code i swear


i lied

* bdistin suggestions

* space suggestions, rename store

* fix count

* documentation update
2017-11-14 08:11:44 +00: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
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
c2029a66e9 Rip, fixes a bug we didn't even know to look for... 1870 lives on. (#1931)
possibly fixes #1870
2017-09-24 17:24:58 +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