Commit Graph

4120 Commits

Author SHA1 Message Date
Crawl
98a552107e tooling(typings): new linter for typings (#3827) 2020-02-24 17:56:44 +01:00
Crawl
e6d22527bb chore(typings): semicolon consistency (#3826) 2020-02-24 17:22:16 +01:00
Souji
54f24d1fea typings(MessageEmebd): fix typings for addFields (#3821)
* typings(MessageEmebd): fix typings for addFields

* fix: add missing semicolon

* docs(MessageEmbed): fix various types

* in accordance with the scope of the PR

* Update src/structures/MessageEmbed.js

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

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-24 14:02:06 +01:00
Sugden
967b533e9d typings(MessageEmbed): properly mark properties (#3822)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-24 13:06:22 +01:00
Sugden
25cd23e305 cleanup(DMChannel): remove _cacheMessage (#3824)
* cleanup(DMChannel): remove _cacheMessage

* update actions/checkout to v2

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-24 13:06:00 +01:00
SpaceEEC
d406f42ce0 docs/typings(SystemChannelFlags): properly document and use resolvable (#3794)
- Change GuildEditData#systemChannelFlags to use SystemChannelFlagsResolvable
- Move SystemChannelFlagsResolvable outside of class definition to make the docs generator happy
2020-02-24 13:03:45 +01:00
SpaceEEC
ccb83a71ee docs/typings(MessageAttachment): mark spoiler as readonly, order spoiler in typings (#3714) 2020-02-24 13:03:02 +01:00
Tenpi
e57ef25082 typings/fix(MessageEmbed): add interfaces for props, fix copy constructor (#3492)
* updated typings

* Updated docs

* fixed types for MessageEmbedOptions

* added curly bracket spaces

* fix(MessageEmbed): make copy constructor work properly

* fix(MessageEmbed): copy the provider too

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-24 11:44:54 +01:00
Sugden
28490e84b0 typings(Invite): channel can be a PartialGroupDMChannel (#3823) 2020-02-24 10:41:29 +01:00
SpaceEEC
4ec01ddef5 feat(MessageEmbed): change toJSON method to return an api-compatible object (#3813) 2020-02-23 20:42:47 +01:00
Souji
b727f6c1b9 feat: bring embed builder field manipulation in line with underlying array functionality (#3761)
* feat: splice multiple fields

* remove MessageEmbed#spliceField
* add MessageEmbed#spliceFields
* to behave more like Array#splice
* and allow multiple fields to be replaced/inserted
* update typings accordingly

* refactor: rename check to normalize

* check suggests boolean return type

* feat: allow spread args or array as field input

* rewrite: replace addField in favor of addFields

* typings: account for changes

* chore: bump min node to 11.0.0

* for Array#flat

* fix: bump min-node in package engines field

* remove addBlankField
2020-02-23 20:41:48 +01:00
Sugden
ecd8cccddf typings(AddGuildMemberOptions): change accessToken from String to string (#3815) 2020-02-23 09:16:20 +01:00
iBisho
b347e9ec26 refactor(MessageEmbed): simplify initialization of files property (#3814) 2020-02-22 22:36:29 +01:00
Sugden
161f90761a feat(PartialGroupDMChannel): to support Invite#channel for group dms (#3786)
* add PartialGroupDMChannel class

* fix lint

* add new errors

* add new class to Channel.create

* fix lint

* update typings accordingly

* better implement errors

* remove unnecessary functions

* oops

* lint

* lint

* lint

* more lint

* more lint

* jsdoc typo

* suggested changes

* i did not forget the typings
2020-02-22 13:25:27 +01:00
Sugden
bea6da621d feat(Guild): add rulesChannel and publicUpdatesChannel (#3810)
* add rulesChannel* & publicUpdatesChannel*

* update typings
2020-02-22 13:04:41 +01:00
Sugden
ef8acecc70 feat: add new MessageTypes (14 and 15) (#3812)
* document types

* typings

* move comment
2020-02-22 12:31:51 +01:00
Souji
f6075a6e3a typings(Constants): add VerificationLevels (#3811) 2020-02-21 21:48:08 +01:00
Sugden
f85230812f typings(Guild): mark afkChannel* & applicationID as nullable (#3805) 2020-02-19 21:34:26 +01:00
Sugden
c4c6ad4a63 docs/typings(WSEvents): add missing, remove duplicated and userbot events (#3800)
- Added `MESSAGE_REACTION_REMOVE_ALL`
- Remove duplicated `VOICE_STATE_UPDATE`
- Remove userbot `USER_SETTINGS_UPDATE`
2020-02-17 14:15:59 +01:00
Vlad Frangu
e4e977f447 src: update client options and shards value if fetching shard count (#3787)
* src: Update client options and shards value if fetching shard count

* src: Fix bug and remove more dead code
2020-02-16 19:41:37 +01:00
Vlad Frangu
46ee06b424 feat(Message): add support for flag editing / embed suppression (#3674) 2020-02-16 19:36:10 +01:00
Sugden
bc5e2950d0 fix(ReactionManager): update message if partial (#3789)
* update message after fetching if it is partial

* suggested changes

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

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-16 19:24:12 +01:00
Vlad Frangu
21d37ed0cc docs: clarify what zlib-sync does (#3785)
* docs: Clarify what zlib-sync does

* docs: Update docs site welcome

* src/docs: Remove `ws.compress` from docs

This is a deprecated parameter and you shouldn't use it unless you have zlib-sync installed, and even then, compression is automatically enabled

* docs: Apply suggestion

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

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-02-13 22:48:36 +01:00
Sugden
6770c7c786 typings: add invite events to WSEventType and constants (#3782)
* fix event typings

* add ws events to jsdoc
2020-02-13 22:46:46 +01:00
Ryan Munro
a36f3869b3 fix(Message): handle undefined/null content in cleanContent getter (#3778)
* Handle undefined/null content in Message#cleanContent

* Typings

* Update typings/index.d.ts

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

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-12 23:07:34 +01:00
Sugden
878cc050d4 fix(Guild): use snake case when editing system_channel_flags (#3781) 2020-02-12 22:47:24 +01:00
Sugden
562b5bfca7 refactor(VoiceChannel): use Permissions.FLAGS in speakable (#3780) 2020-02-12 22:42:43 +01:00
Sugden
d43692b0f2 docs(Guild): channels is a manager of channels (#3779) 2020-02-12 22:29:16 +01:00
Ryan Munro
62b227c2bd fix(BaseManager): BaseManager#valueOf should return cache (#3776)
* BaseManager#valueOf should return cache

* Update Util#flatten to handle valueOf being a Collection

* Update Util.js - typo

Co-Authored-By: Amish Shah <amishshah.2k@gmail.com>

Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
2020-02-12 22:26:17 +01:00
Ryan Munro
592021df92 feat(Message): throw a TypeError if delete is passed a non-object (#3772) 2020-02-12 22:25:14 +01:00
BorgerKing
3f8ea38b3a docs: info tag for ActivityType regarding CUSTOM_STATUS (#3757) 2020-02-12 22:23:06 +01:00
Sugden
149f72b50b typings(GuildMemberManager): fetch with no parameters returns collection (#3773) 2020-02-12 18:40:20 +01:00
Androz
94bb268639 docs: add extends to ChannelManager, cache is not nullable, resolveID accepts an object (#3771)
* Add extends to docs

* Cache shouldn't be nullable

* jsdoc: use same type for both resolve methods
2020-02-12 18:36:08 +01:00
SpaceEEC
92bc634520 docs(*Manager): fix child classes' cache type annotations (#3777) 2020-02-12 18:28:25 +01:00
Sugden
324d9e0a3a fix(TextChannel): remove old nsfw regex check (#3775) 2020-02-12 18:24:35 +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
didinele
fe7df708e4 typings: add HTTPOptions#api and export Constants as a value (#3768)
* fix(typings): Export Constants correctly

* fix(typings): HTTPOptions#api was missing

* fix some odd indent

* add semi to make CI happy uwu
2020-02-07 18:46:03 +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
Vlad Frangu
b4e56d3e0e src: fix up WebSocketShard errors (#3722)
* src: Fix up WebSocketShard errors

* typings: Forgot to update

* src: Forgot debug variable

* src: Fix issue Bella found
If the WS was not connected when the HELLO timeout passes
(CONNECTING, etc), the shard would get stuck
due to never rejecting the WebSocketShard#connect
Promise with the DESTROYED event
2020-02-02 11:12:58 +01:00
PLASMAchicken
6a381c68a2 chore(README): update link to Discord.js guide v12 changes (#3751)
* Update link to discord.js guide v12 changes

* Suggested Changes

* Suggested Changes

Co-Authored-By: Amish Shah <amishshah.2k@gmail.com>

Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
2020-01-31 11:38:10 +00:00
Jyguy
8e9e93da1d docs(Guild): fetchBan returns a promise (#3752) 2020-01-29 18:54:10 +01:00
BorgerKing
030d263a9e feat(MessageReaction): add remove method and Client#messageReactionRemoveEmoji (#3723)
* Add support for MessageReaction#remove and MESSAGE_REACTION_REMOVE_EMOJI

* Remove reaction from cache

Co-Authored-By: matthewfripp <50251454+matthewfripp@users.noreply.github.com>

* fix: message may be partial

* Clarify what the event entails

* Document client in MessageReaction

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

* await the REST call

* Add MessageReaction#remove to typings

Co-authored-by: matthewfripp <50251454+matthewfripp@users.noreply.github.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-01-25 20:00:53 +01:00
Ryan Munro
d8b4725caa fix(TextChannel#bulkDelete): use GenericAction#getMessage to handle return value correctly (#3664)
* Corrected the handling of the action

* Apply same fix to handling of single message in bulkDelete

* Revert to using await
2020-01-25 15:27:39 +01:00
Sugden
3ea9ac57dd fix(ClientUser): verified and enabled properties resetting (#3733)
* fix(ClientUser) verified and enabled properties resetting

* set this.mfaEnabled to null if it is undefined

* add missing curly brackets

* fix typo
2020-01-25 15:08:25 +01:00
BorgerKing
90aa5b3500 feat(GuildMemberStore): make timeout refresh after every GUILD_MEMBERS_CHUNK (#3645) 2020-01-24 17:08:40 +01:00
Gryffon Bellish
b81f771007 cleanup: fix deepscan issues (#3740)
* fix: don't double check if shards are auto.

* fix: remove useless roles array.

* fix: remove useless undefined checks.

* fix: remove useless `this` binding

* Apply suggestions from code review

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

* Fix: Space's suggestion

* Fix: time is always truthy

* Check if it's an invalid date.

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-01-24 16:58:23 +01:00
BorgerKing
929ff9ccd0 feat(Client): add support for INVITE_CREATE and INVITE_DELETE events (#3720)
* Add support for new Invite events

* Merge typings for events

Co-Authored-By: Sugden <leoaustin675@gmail.com>

* Add warning about requiring permissions

* Null check channel and guild

* fix: .guilds not .channels
2020-01-24 16:38:26 +01:00
Sugden
c779fe3670 feat(Guild): add fetchBan method (#3726)
* Add error for not resolving ID to fetch ban

* Add Guild#fetchBan

* add missing !

* typings

* lint fixes

* add jsdoc description
2020-01-24 15:29:53 +01:00
Carter
63293fe14d chore(License): bump license year (#3734) 2020-01-22 08:21:43 +00:00
Sugden
877577badc typings(RichPresenceAssets): *ImageURL's options are optional (#3727) 2020-01-20 22:02:02 +01:00