Commit Graph

4085 Commits

Author SHA1 Message Date
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
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
BorgerKing
cbb8db3058 feat(Collectors): make collectors auto-stop when relevant structures are deleted (#3632)
* Collectors: make Collectors automatically stop when Channel, Guild, or Message are deleted.

* fix potential error with DM collectors

* Message collectors dont have a `this.message` you dummy

* Fix(various): nitpicks, documentation, typings, and stray error

* Pleasing mr tslint

* fix: typings

* Grammatical fixes

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

* Fixing the linting after space's suggestions

* docs(ReactionCollector): remove whitespace

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-01-19 11:24:55 +01:00
Gryffon Bellish
69c79a4136 typings/docs(GuildEmoji): id isn't nullable (#3694)
* Fix: GuildEmoji#id isn't nullable

* Move ID to be alphabetical

* Add JSDoc to say it's not nullable

* fix linting
2020-01-17 20:11:14 +01:00
Crawl
6a0fe467e5 docs: replace all occurances of node-opus with @discordjs/opus (#3698)
* docs: replace all occurances of node-opus with @discordjs/opus

* chore: leave in node-opus in case not everyone switched
2020-01-16 14:10:48 +01:00
Crawl
d096e40f6f feat/fix: use updated eslint action (#3699) 2020-01-16 12:59:03 +01:00
Helmasaur
d77229f423 chore: ffmpeg package in the voice doc (#3697)
ffmpeg package changed from "ffmpeg-binaries" to "ffmpeg-static"
2020-01-16 12:57:20 +01:00
Souji
7f99be739a docs(MessageMentions): add sort order notice (#3693)
* mention order returned from API
* not left to right in text
2020-01-14 11:28:19 +01:00
Gryffon Bellish
75fe1faf2f Remove BroadcastAudioPlayer from typings (#3692) 2020-01-13 22:45:58 +00:00
Amish Shah
629c57f890 fix: regression (changing voice servers) 2020-01-13 22:29:05 +00:00
SpaceEEC
ee0b7c155a feat(Presence): add support for multiple activities (#3661)
* feat(Presence): add support for multiple activites

* typings(Presence): fix spelling of 'activities'

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

Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
2020-01-13 20:28:29 +00:00
Vlad Frangu
c23cc7a42e src: Cleanup event listeners on WebSocket connections (#3681)
* src: Cleanup event listeners on WebSocket connections
Should prevent #3641 from happening, as well as double connections on a shard

* typings: Forgot to add the method
2020-01-13 18:53:07 +00:00
Ayyan Lewis
45cd58b68c types(VoiceBroadcast): add subscribers property (#3677)
* types(VoiceBroadcast): add subscribers property

* types(VoiceBroadcast): change player property to private

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

Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
2020-01-13 17:01:16 +00:00
Antonio Román
53a1f8fcd4 refactor: Remove util alias export (#3691) 2020-01-13 16:16:22 +00:00
Antonio Román
62afafdbe9 typings: Fixed build error (#3689) 2020-01-13 16:48:49 +01:00
Tenpi
8014ddcd1c feat: dynamic property for ImageURLOptions (#3530)
* Added dynamic property to ImageURLOptions

* fixes

* order

* typings fix

* made dynamic false by default

* add curly spaces
2020-01-13 14:32:29 +00:00
SpaceEEC
400cb56358 fix(ShardingManager): assert shardList to be spawned, not totalShards (#3649) 2020-01-13 14:12:18 +00:00
SpaceEEC
11f9118551 fix(BitField): remove for..in in favor of Object.entries (#3650)
* fix(BitField): remove for..in in favor of Object.keys

* refactor: do not re-resolve bits

Co-Authored-By: bdistin <bdistin@gmail.com>

Co-authored-by: bdistin <bdistin@gmail.com>
2020-01-13 14:07:54 +00:00
Souji
59205a2152 fix: provide count on bulk deletion (#3682)
* GuildAuditLogsEntry should provide count as extra in case of  MESSAGE_BULK_DELETE
* inner class: GuildAuditLogsEntry in GuildAuditLogs.js
2020-01-13 14:02:31 +00:00
SpaceEEC
b5825c33b0 feat(Speaking): add PRIORITY_SPEAKING bit (#3680) 2020-01-13 13:58:40 +00:00
didinele
f74ae12d6a fix(typings): remove VoiceChannel#connection (#3676) 2020-01-11 20:42:01 +01:00
Saya
a53d86579b typings(BaseClient): remove delay parameter from setImmediate (#3667)
There is no delay parameter on setImmediate in Node.JS docs:
https://nodejs.org/docs/latest-v12.x/api/timers.html#timers_setimmediate_callback_args
2020-01-09 23:14:55 +01:00
Gryffon Bellish
d2ef02906c cleanup(DataResolver): stats can't be falsy (#3651) 2020-01-05 17:45:16 +01:00
izexi
6af0da1043 feat(Partials): add DMChannel/MessageReaction#fetch() and PartialTypes.REACTION (#3474)
* add DMChannel#fetch() & Action#getChannel({recipients})

* ref for MessageReaction partial

* typings

* add PartialTypes.REACTION

* accommodate for fully removed reactions

* fix incorrect wording and typo

* typings: MessageReaction#count is nullable

* typings: mark MessageReaction#partial as readonly

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* fix(User): fetch dm channel if cached one is partial

* docs: add missing comma

Co-Authored-By: Antonio Román <kyradiscord@gmail.com>

* fix: accomodate for new reactions

* fix: updating existing/new count on _patch

* docs: typo

* for consistency

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2020-01-05 16:45:49 +01:00
tipakA
bf31b28ad9 feat(RichPresenceAssets): add Twitch preview link for largeImageURL (#3655) 2020-01-05 00:50:38 +01:00
Jyguy
155b682f6c typings(GuildEmoji): make url not-nullable (#3656)
* typings(GuildEmoji): make url not-nullable

* make GuildEmoji.url readonly
2020-01-04 23:23:01 +01:00
Cadence Fish
c734979ad4 typings(ShardingManager): add options.shardList (#3657) 2020-01-03 13:53:27 +01:00
SpaceEEC
97eac663b3 feat(MessageMentions): cache mentioned members (#3601) 2019-12-27 19:28:04 +01:00
SpaceEEC
e660ea90cc fix(Webhook): edit channel when editing avatar (#3588) 2019-12-27 19:27:48 +01:00
SpaceEEC
ea76a56639 feat(Webhook): add type property and created* getters (#3585)
* feat(Webhook): add created* getters

* feat(Webhook): add type property

* typings(WebhookFields): use primitive string for url getter

Co-Authored-By: Gryffon Bellish <owenbellish@gmail.com>

* fix(Webhook): token can be null

Co-authored-by: Gryffon Bellish <owenbellish@gmail.com>
2019-12-27 19:27:34 +01:00
SpaceEEC
fc27ce1a15 typings(Bitfield): add hasParams to toArray, fix serialize's type (#3579)
* typings(Bitfield): add hasParams to toArray, fix serialize's type

* fix: apply suggested changes

* chore: remove incorrect whitespace

* fix: make params optional

* nit: pluralize bit in Permissions#missing

* nit: group non-static methods together
2019-12-27 19:26:41 +01:00
NightScript
50ed3293a5 chore: issue config refactor (#3640)
* Create config.yml

Instead of making an entire new page with just text talking about the discord server (which they could ignore, as most people don't read), just link people directly to the discord server

* Delete question---general-support-request.md
2019-12-25 03:29:19 +01:00
Gryffon Bellish
d4333f5bbe chore: node version in package.json (#3643) 2019-12-25 03:28:09 +01:00
Gryffon Bellish
45b8971000 deps: mark utf-8-validate as optional, remove mentions of uws and zucc (#3638)
* Mark utf-8-validate as optional

* remove uws and zucc
2019-12-23 23:01:07 +01:00
Vlad Frangu
710101c580 src(WebSocket): fix race condition (#3636)
A race condition caused Client#user to be null in the ready event if the client handled 0 guilds.
2019-12-22 10:31:26 +01:00