Commit Graph

180 Commits

Author SHA1 Message Date
Shubham Parihar
fa5a37e51a fix(Resolvables): valid resolvables throw error when uncached (#5495)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2021-04-15 00:32:08 +02:00
Sugden
aff3625d4f fix(GuildMember): correctly check for premium_since (#5312) 2021-04-15 00:30:45 +02:00
Shubham Parihar
dedf43288e docs(BanOptions): make days description more clear (#5327) 2021-03-29 05:52:41 +02:00
Souji
62ba2499e0 docs(GuildMember): document owner override in permissions getter (#5320) 2021-03-28 15:27:32 +02:00
Ishmaam Khan
5401b92aac refactor(GuildMember): remove GuildMember#hasPermission (#5152)
* refactor(GuildMember): remove GuildMember#hasPermission

* refactor(GuildEmoji): remove use for `GuildMember#hasPermission`

* typings: remove `GuildMember#hasPermission`
2021-01-24 11:50:58 +01:00
Adrian Paschkowski
c4c817116f feat(GuildMember): #pending (#5121)
* Add GuildMember#isPending

* Rename is_pending to pending

* Improve jsdoc wording

* pending isn't nullable

* ??
2021-01-02 23:55:37 +01:00
Zaid
d70127cee6 feat(GuildMember): make GuildMember#setNickname first param nullable (#5070)
* Update index.d.ts

* Update GuildMember.js

* Update src/structures/GuildMember.js

Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>

* Update GuildMember.js

* Update index.d.ts

Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
2020-12-12 14:50:33 +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
7db6978012 fix(GuildMember): properly check permissions for hasPermissions (#4677) 2020-10-17 15:40:23 +02:00
Sugden
6aab9c3d64 fix: correctly import extendable classes (#4744) 2020-08-28 14:19:20 +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
Advaith
446bbfe9eb docs(Ban): days must be 0-7 (#4693)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Noel <icrawltogo@gmail.com>
2020-08-12 09:35:33 +02:00
Souvik
2adb5815bf fix: set #nickname to null as the default value (#4641) 2020-08-11 20:58:52 +02:00
Souji
2d67fbb24c docs: clarify which checks GuildMember#manageable does (#3870) 2020-03-01 15:11:06 +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
Souji
3f039016af fix(GuildMember): manageable - let owner override (#3765)
* if the bot is owner of the guild the target is managebale
* even though both roles are on the same position
2020-02-07 18:27:05 +01:00
izexi
c87758086b feat: add support for premium guilds (#3316)
* add premiumTier and premiumSubscriptionCount

* add premiumSinceTimestamp and premiumSince

* add premium message types

* typings

* add GuildEmoji#available

* fix doc description
2019-06-05 21:34:33 +02:00
izexi
3f1232ebf3 feat: throw custom error for uncached Guild#me (#3271)
* handle cases where Guild#me is uncached

* fix id prop

* remove unnecessary checks

* space's requested changes
2019-05-25 13:50:32 +02:00
SpaceEEC
3ad16fa351 fix(GuildMember): do not create a channel key when editing
This is to not break GuildMember#setNickname for the current user
2019-05-18 14:08:12 +02:00
Amish Shah
e64773e21b Add ability to kick members from VoiceChannels and remove duplicated methods (#3242)
* feat(voice): kick members from voice channels

* fix(VoiceState): improve stability in checking for client user

* feat(VoiceState): add setChannel for moving/kicking members

* update typings

* remove duplicated methods across GuildMember and VoiceState

member.setDeaf => member.voice.setDeaf
member.setMute => member.voice.setMute
member.setVoiceChannel => member.voice.setChannel
2019-05-04 16:46:42 +01:00
Vlad Frangu
75cd260808 src: Don't use the GuildMemberRoleStore to patch the GuildMember _roles (#3226)
* src: Don't use the GuildMemberRoleStore for patching GuildMember#_roles

* src: Remove usage of _patch from the store

* src: Finish up clone changes
2019-04-23 19:44:02 +01: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
SpaceEEC
4289b18ab2 docs(GuildMember): add missing @name to document user property
Fixes #3090
2019-02-14 11:19:05 +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
Kyra
9449f8df8f cleanup(GuildMember{RoleStore}): Rewrite to async/await (#3072)
- Fixed a bug where `GuildMemberRoleStore#{add,remove}` would create a rejected promise inside a promise, instead of rejecting the first one.
- Fixed a bug where `GuildMember#edit` with a specified unknown channel would throw synchronously, instead of rejecting asynchronously.
2019-02-09 17:20:10 +00:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Darqam
23a16c3a73 fix(GuildChannel): add explicit channel resolve error to member edit (#2958)
* Add explicit error to setting invalid voice channel

* restrict to guild

Co-Authored-By: Darqam <anhim2@gmail.com>

* add a more explicit error and channel type check

* bad tab
2018-11-27 21:41:34 +01:00
Isabella
928fb30040 fix: actually fix Readonly typos 2018-08-21 14:25:30 -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
e666574f36 document GuildMember#voice 2018-08-14 11:50:11 +01:00
Amish Shah
3c2eaff226 fix default presences again, remove redundant extras in PresenceStore 2018-08-11 10:19:31 +01:00
Amish Shah
f5ea673ebd fix default presence 2018-08-11 00:26:24 +01:00
Amish Shah
e059581eee GuildMember#voice never undefined, improve documentation for VoiceState 2018-08-10 17:05:26 +01:00
Amish Shah
08eff66939 Make presences track users and guilds, emit them in presenceUpdate 2018-08-10 16:46:14 +01:00
Amish Shah
be5efea461 rewrite voice state handling 2018-08-10 14:44:59 +01:00
Yukine
147488df89 use null for getters (#2723) 2018-08-10 10:56:07 +02:00
Amish Shah
ee6c19ca7e voice: rewrite GuildMember#speaking tracking (#2540) 2018-08-09 13:59:52 +01:00
Lewdcario
5071477172 fix(GuildMember): account for joinedTimestamp as well 2018-06-05 20:14:34 -05:00
Lewdcario
13bfceb83c fix(GuildMember): mark joined as nullable and fix fetching for these cases 2018-06-05 19:50:36 -05:00
Lewdcario
c8ecbe6585 docs: GuildMember#speaking
and consistency improvements
2018-06-05 00:33:54 -05:00
Lewdcario
46b19bbbdb fix(GuildMember): Invalid Date 2018-06-04 16:24:42 -05:00
Braxton
f0c4d0e834 feat: Add "deleted" property to multiple structures. (#2556)
* Add "deleted" property to "Message" structure

* Add "deleted" property to Multiple structures

Structures edited:
- Channel
- Emoji
- Guild
- Guild Member
- Role

* Update "deletable" getter

* Fix ESLint "no-trailing-spaces" errors

* Requested Change: Mark w/ bulkDelete
2018-05-28 17:42:51 -05:00
Frangu Vlad
5acf4061e8 fix: GuildMember#toJSON not having roles (#2520) 2018-04-29 11:28:45 -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
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