Commit Graph

4627 Commits

Author SHA1 Message Date
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
SpaceEEC
46e8bc44fc feat(BitField): add BitField base class (#3759)
* feat(BitField): add BitField base class

* fix(Permissions): properly deprecate the getters/setters
2020-02-12 22:23:48 +01:00
BorgerKing
b7ccf9a53e docs: info tag for ActivityType regarding CUSTOM_STATUS (#3758) 2020-02-12 22:23:35 +01:00
BorgerKing
3f8ea38b3a docs: info tag for ActivityType regarding CUSTOM_STATUS (#3757) 2020-02-12 22:23:06 +01:00
Ryan Munro
dbdb49ee1c feat(GuildAuditLogs): handle new event types (#3760)
* Define new AuditLogActions

* Backport constructor rewrite

* Typings

* fix(GuildAuditLogEntry): switch on correct property, coerce to numbers, simplify extra for deleted entities

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-12 18:42:57 +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
SpaceEEC
83bc6e0779 fix(Guild): update premiumSinceTimestamp on guild member update 2020-02-07 19:13:02 +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
364914fd35 fix(GuildMember): manageable - let owner override (#3766)
This backports #3765
2020-02-07 18:27:56 +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
SpaceEEC
c955fd00c7 feat(Integration): add guild integrations (#3756) 2020-02-02 11:11:31 +01:00
SpaceEEC
a12e1e87ee typings(Constants): add CUSTOM_STATUS to ActivityTypes 2020-02-01 21:14:02 +01:00
SpaceEEC
2589db6633 feat(Constants): add CUSTOM_STATUS to ActivityTypes 2020-02-01 21:12:58 +01:00
SpaceEEC
17b8b23b80 feat(Presence/Game): multiple activities and custom status (#3747)
* feat(Presence): add activities

* feat(Game): add created* and emoji
2020-02-01 18:27:20 +01:00
SpaceEEC
ccd60438df feat(Collector): add idle option (#3746) 2020-02-01 18:23:56 +01:00
SpaceEEC
fbcd363ec9 fix(Voice*): fix speaking event and voice receive (#3749)
* fix(Voice*): synthesize speaking event from UDP packets

* fix(VoiceReceiver): skip over undocumented Discord byte

See #3555

* fix(VoiceConnection): play frame silence before emitting ready

* typings: account for changes in private api
2020-01-31 22:37:11 +01:00
SpaceEEC
6d7e1e4953 fix: remove for..in in favor of Object.keys (#3745) 2020-01-31 11:38:47 +00: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
ab7f9e80b4 feat(MessageReaction): backport removeAll and MessageReactionRemoveEmoji event (#3741)
* Add new action and websocket handler

* Add REST method for removing reaction emoji

* Update Message#_removeReaction to handle removing whole emoji

* Add MessageReaction#removeAll and update typings

* Apply uncached user fix
2020-01-25 15:36:35 +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
PLASMAchicken
6b297b8776 chore: bump version to 11.6.0-dev (#3731)
* Update package.json

* Change Version String after amishshah's  suggestion

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

Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
2020-01-25 15:09:30 +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
SpaceEEC
099a1a47e8 fix(*Collector): always run postCheck, remove 'translatation' of message collector options (#3718)
* fix(*Collector): always run postCheck, correctly 'translate' message collector options

* fix(MessageCollector): remove translation, fix postCheck conditions
2020-01-24 16:56:04 +01:00
SpaceEEC
30adb378fc feat(Webhook): backport missing properties (#3710)
* feat(Webhook): add avatarURL getter

This backports: https://github.com/discordjs/discord.js/pull/3625

* feat(Webhook): add type, createAt, and createdTimestamp

This backports: https://github.com/discordjs/discord.js/pull/3585

* feat(Webhook): add url getter

This backports: https://github.com/discordjs/discord.js/pull/3178

* docs(Webhook): add missing type and readonly tags
2020-01-24 16:52:52 +01:00
SpaceEEC
88b675d38a feat(MessageReaction): backport animated, client, created*, and url (#3711) 2020-01-24 16:50:16 +01:00
SpaceEEC
4ca18647ba feat(MessageAttachment): add spoiler getter (#3713) 2020-01-24 16:45:52 +01:00
SpaceEEC
a505a55e03 fix(RichPresenceAssets): add Twitch preview link for largeImageURL (#3715) 2020-01-24 16:43:16 +01:00
SpaceEEC
903f6ca75f fix: only setMaxListeners when max listeners is not 0 (#3716) 2020-01-24 16:41:37 +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
Ryan Munro
40afbc1d7e feat(Client): backport INVITE_CREATE and INVITE_DELETE events (#3728)
* Backport INVITE_CREATE and INVITE_DELETE

* Register events to Websocket

* Dont create an Invite if the guild is null

* Null check channel too
2020-01-24 16:34:59 +01:00
Ryan Munro
17237c70c8 typings(TextChannel): topic can be null (#3687)
* Mark topic as nullable for TextChannel

* Backport separate NewsChannel typings

* Ensure NewsChannel#rateLimitPerUser is undefined

* Revert rateLimitPerUser, considered breaking

* Add rateLimitPerUser back to typings

* Linting

* Revert NewsChannel extends TextBasedChannel
2020-01-24 16:33:19 +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
SpaceEEC
464ef25898 fix(ClientDataResolver): return a user in resolveUser when passing guild (#3719) 2020-01-20 22:02:28 +01:00
Sugden
877577badc typings(RichPresenceAssets): *ImageURL's options are optional (#3727) 2020-01-20 22:02:02 +01:00
Souji
d8419ac2c7 docs(MessageMentions): backport mention order notice (#3712) 2020-01-19 13:09:33 +01:00
SpaceEEC
c5d2b96524 fix(VoiceConnection): use Client#clearTimeout to clear timeouts (#3709) 2020-01-19 13:08:49 +01:00
SpaceEEC
01826aeefe feat(Guild): add setBanner method and banner to edit (#3708) 2020-01-19 13:07:09 +01:00
SpaceEEC
6302afb84b docs(MessageMentions): channels are actually in order (#3705)
* docs(MessageMentions): channels are actually in order

* docs(MessageMentions): readd info about order for channels

* docs(MessageMentions): reword info to account for rtl locales
2020-01-19 13:06:21 +01:00
SpaceEEC
f501d06c0d fix(Presence): account for multiple activities everywhere (#3703)
* fix(Presence): account for multiple activities everywhere

* refactor(Presence): make initialization of 'activities' more readable
2020-01-19 13:05:45 +01:00