Commit Graph

141 Commits

Author SHA1 Message Date
Souji
599cde3627 fix(GuildChannel): make lockPermissions use parent overwrites (#4627)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2020-08-12 09:23:31 +02:00
Papaia
fc4bddf82a fix: grammatical errors in INVALID_TYPE errors (#4289)
* fix(GuildMemberRoleManager): grammatical error

* fix: eslint

* fix(GuildChannel): an

* fix(PermissionOverwrites): an

Co-authored-by: Papaia <43409674+ItsPapaia@users.noreply.github.com>
2020-06-04 13:02:28 +02:00
SpaceEEC
b441469044 revert: channel unions (#3918 69d69f2) (#3978)
* revert: channel unions (#3918 69d69f25b9)

* fix: correct tslint:disable

* revert: keep the GuildChannel#setParent change

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-03-27 20:58:11 +01:00
Ryan Munro
69d69f25b9 feat(Types): support type-guarding using Channel#type string li… (#3918)
* feat(types): union type for Channels

* feat(Types): union for TextBasedChannelTypes

* fix(Types): use new union types in return values

* Update typings/index.d.ts

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

* Update typings/index.d.ts

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

* fix(Types): various minor improvements for Partials

* fix(GuildChannel): partial should return false

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-03-14 16:50:43 +01:00
Souji
61ef46ff30 fix: adapt #manageable to check for CONNECT for VoiceChannel (#3885) 2020-03-06 07:00:49 +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
Sugden
e4f567c65e refactor(GuildChannel): change overwritePermisions to accept an… (#3853)
* refactor(GuildChannel): change overwritePermisions to no longer accept an object

* fix: check for instanceof Collection too
2020-02-29 14:19:21 +01:00
Sugden
2ee0f1cdc6 feat(GuildManager): Allow for more options for GuildManager.cre… (#3742)
* typings: add GuildVerificationLevel and GuildExplicitContentFilter

* implement new types

* fix jsdoc on stores

* typo

* add more options for GuildStore#create

* add channels and roles

* update typings

* fix typings and use snake case for permissionOverwrites

* typings & jsdoc

* fix tslint

* remove trailing whitespace

* fix jsdoc

* fix jsdoc

* fix oopsies

* fix lint

* fix lint

* fix mr lint man

* add typedefs and support for setting channel parents

* fix tab indenation

* update jsdoc

* suggested changes

* style: fix silly format

* docs(PartialChannelData): name is not optional

* style: remove silly format
2020-02-29 07:43:42 +01:00
Crawl
3a0470b45c chore(deps): update deps and fix lint (#3833) 2020-02-24 23:14:31 +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
Jiralite
cc466fa4b9 docs: NewsChannel and StoreChannel (#3557)
* Added news & store

* Update GuildChannel.js

* Added in News and Store
2019-11-04 11:35:14 +01:00
anandre
55447fd4da docs(TextChanne): specify unit of rateLimitPerUser (#3272)
* Update TextChannel.js

Update `setRateLimitPerUser` description to specify the `number` is in seconds, per the Discord docs

* Update TextChannel.js

Add unit to the rateLimitPerUser property

* Update GuildChannel.js
2019-05-15 22:33:27 +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
izexi
62cba2e148 docs(GuildChannel): fix setPosition's reason type (#3199) 2019-04-11 10:10:31 +02:00
SpaceEEC
7324a993ed fix: ensure VIEW_CHANNEL permissions before trying to join (#3046)
* fix: ensure VIEW_CHANNEL permissions before joining

* nit(GuildChannel): remove the redundant truthy check
2019-02-10 15:21:59 +00:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Crawl
377ecd73ea docs(GuildChannel): fix doc string for clone method 2018-11-20 16:42:27 +01:00
SpaceEEC
d92ee2ff99 feat(GuildChannel): allow to set all options when cloning (#2937) 2018-11-17 15:43:04 +01:00
SpaceEEC
6e5f088e44 refactor: consistently use permissionOverwrites over overwrites (#2886) 2018-10-10 10:25:00 +02:00
Kyra
d4c0bb2a0d feat(TextChannel): RateLimitPerUser (#2811)
* feat: Add TextChannel#rateLimitPerUser
Rename parameter in TextChannel#setRateLimitPerUser
feat: Add `rateLimitPerUser` param to ChannelData
fix: eslint

* docs: Updated typings

* fix: Requested changes

* fix: rateLimitPerUser being undefined when 0

When `rate_limit_per_user` is 0, the gateway does not send it (but REST does). When this is set to a non-zero number, this property starts to exist. Otherwise this will be `0`. Adding `|| 0` should do the trick changing `undefined` to `0`.

* fix: eslint
2018-09-29 16:02:49 +02:00
bdistin
3d8207a3db refactor: comprehensive permissionOverwrites refactor (#2818)
* wip: comprehensive permissionOverwrites refactor

* PermissionOverwrites.resolve should Promise.reject()

where a promise is the expected return value

* On second thought, async rewrite to automatically reject on throw

* Fix some docs

* Fix a bug

* fix 2 more bugs

* typings: Updated for latest commit

* typings: Add missing method in GuildChannel

* typings: Add missing `| null` in PermissionOverwriteOption type

* Suggested changes
2018-09-21 12:21:51 +02:00
SpaceEEC
6b9dd13d43 docs/typings(GuildChannel): permissionsfor returns a nullable readonly Permissions instance 2018-09-02 13:23:39 +02:00
Souji
cb08a0961a Docs: merge PermissionOverwriteOptions and OverwriteData (#2738)
* Docs: merge PermissionOverwriteOptions and OverwriteData

* fix user-member and replace eslint-disable with linebreaks

* consistency fix

* Fix: remove empty line between jsdocs and method

* Fix: allowed/denied to allow/deny to conform with recent master changes
2018-08-24 16:51:15 +02: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
d437cecb3f Fix permission checking for Administrator channel overwrites (#2756) 2018-08-17 08:46:09 +01:00
Amish Shah
8ac664801c GuildChannel#setParent should allow channel to be a Snowflake (#2644) 2018-08-11 11:34:24 +01:00
Souji
0a21280990 add Collection as possible param to GuildChannel#overwritePermissions + wording port from 11.3-dev (#2719)
* add Collection as possible param to GuildChannel#overwritePermissions

* change PermissionoverwriteOptions desc. default to unset

* fix eslint hiccup

* fix spelling of snowflake
2018-08-10 10:57:05 +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
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
Pascal
e431ccdad2 fix(GuildChannel): always return a boolean from the manageable getter
Overlooked the comment pointing that out in #2439
2018-04-02 20:52:12 +02:00
Favna
ef4bd92c8a feat(GuildChannel): add manageable getter (#2439)
* Adds GuildChannel.manageable

* Resolve requested changes

* fix eslint max-len error

* Fix for nullable permissionsFor()

* Indent fixes
2018-04-02 20:00:47 +02:00
bdistin
799eea957e consistency: getters return null instead of undefined (#2385) 2018-03-08 10:15:06 -06: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
24571e465b docs: examples & improvements 2018-03-01 22:50:45 -06:00
SpaceEEC
47bc0fc51e feat(GuildChannel): add fetchInvites method (#2339)
* feat(GuildChannel): add fetchInvites method

* fix: actually use the 'channels' endpoint
2018-02-13 17:29:42 +01:00
Kyra
986e6da196 Fix(GuildChannel#clone) options.parent not accepting (falsy) null. (#2262)
* Fixed (falsy) options not being set correctly

* Requested changes.

As a side note, I also default `options.withPermissions` for simplicity, and because it gets ignored in [`GuildChannelStore#create()`](https://discord.js.org/#/docs/main/master/class/GuildChannelStore?scrollTo=create).

* Fixed the overwrites option
2018-01-20 19:30:30 +01:00
Schuyler Cebulskie
f649610c26 Merge branch 'master' into voice-rewrite 2018-01-18 19:49:23 -05:00
bdistin
b846cbd2b3 GuildChannel.permissionsFor(role) (#2254)
* GuildChannel.permissionsFor(role)

* 1Comp's requested changes
2018-01-18 02:28:14 -06:00
Amish Shah
b94d60d2ab Merge branch 'master' into voice-rewrite 2018-01-16 17:24:07 +00:00
bdistin
4fb7e64a39 Add parent, nsfw, bitrate, and userLimit options to GuildChannel.clone() (#2259)
* Add parent, nsfw, bitrate, and userLimit options to GuildChannel.clone()

* fix lint
2018-01-16 01:20:09 +01:00
Amish Shah
d541cac9b3 Merge branch 'master' into voice-rewrite 2018-01-13 12:47:56 +00:00
bdistin
2249da464f Fix member.ban() and channel.clone() (#2241)
* Fix member.ban()

* also fix channel.clone()

* type is an option parameter in the new create

* lint

* better fix for clone
2018-01-11 18:44:35 +00:00
Amish Shah
096124b179 Merge branch 'master' into voice-rewrite 2018-01-05 21:24:23 +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
Gus Caplan
abb93c9eb9 fix location of toString for channels (#2202) 2018-01-04 01:01:39 +01:00
Amish Shah
ac7e066126 Merge branch 'master' into voice-rewrite 2018-01-03 11:28:59 +00:00
Isabella
4f8f2087c1 docs/fix(setParent): docs update and nullable channel param (#2160)
* fix(setParent): no longer in GuildChannel

* refactored

* little bit less ugly

* space/appel suggestion

* docs fix

* shhhhhhhh

* fun docs trip

* prototype thing

* mark nullable
2017-12-21 09:31:17 +01:00
Yukine
0c16859746 enchanced docs for GuildChannel (#2155)
* enchanced docs for GuildChannel

* changes due request
2017-12-21 09:30:32 +01:00