Commit Graph

263 Commits

Author SHA1 Message Date
Noel
0a591a9697 feat(Browser): remove browser � (#5113) 2020-12-14 13:56:16 +01:00
Advaith
41078997ae feat(APIMessage): remove disableMentions (#4836)
* chore: remove disableMentions

* style: fix eslint
2020-12-14 13:51:31 +01:00
X-Classified
bb78120283 fix(Message): #system non-zero message types are not guaranteed to be system (#5108)
* fix(Message): #system not all nonzero message types are system

* feat(Message): introduce system message types

* refactor(Constants): change SystemMessageTypes to be exclusionary

* fix(Constants): only need to check if type exists

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

* fix(Constants): lint

* fix(Typings): add SystemMessageTypees to Constants

Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
2020-12-12 22:40:39 +01:00
monbrey
60e5a0e46f feat(Message|TextChannel): Inline replies (#4874)
* feat(Message): remove reply functionality

* feat(InlineReplies): add INLINE_REPLY constant/typing

* feat(InlineReplies): add Message#replyReference property

* feat(InlineReplies): add typings for sending inline replies

* feat(InlineReplies): provide support for inline-replying to messages

* feat(Message): add referencedMessage getter

* fix: check that Message#reference is defined in referencedMessage

* refactor(InlineReplies): rename property, rework Message resolution

* docs: update jsdoc for inline replies

* feat(Message): inline reply method

* fix(ApiMessage): finish renaming replyTo

* fix: jsdocs for Message#referencedMessage

Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>

* fix: restore reply typings

* fix: dont pass channel_id to API when replying

* chore: update jsdocs

* chore: more jsdoc updates

* feat(AllowedMentions): add typings for replied_user

* fix: naming conventions

* fix(Message): referenced_message is null, not undefined

* fix(MessageMentionOptions): repliedUser should be optional

* chore: get this back to the right state

* fix(ApiMessage): pass allowed_mentions when replying without content

* fix(ApiMessage): prevent mutation of client options

Co-authored-by: almostSouji <timoqueezle@gmail.com>
Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
2020-12-08 21:08:26 +01:00
izexi
2b2994badc feat: add support for guild templates (#4907)
Co-authored-by: Noel <buechler.noel@outlook.com>
2020-11-21 15:09:56 +01:00
Sugden
7faa73a561 feat: add missing error codes (#5008)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-11-20 16:18:13 +01:00
Matt (IPv4) Cowley
c412cd7521 feat(Message): add messageEditHistoryMaxSize to limit stored msg edits (#4867) 2020-10-17 15:34:49 +02:00
Advaith
9c76129a23 feat(ActivityTypes): add Competing (type 5) (#4824) 2020-09-15 18:33:52 +02:00
InkoHX
cfc68677ee docs(ClientOptions): fix typo (#4730) 2020-08-27 16:39:55 +02:00
Advaith
f991bd46f3 chore(Constants): update large_threshold default (#4698) 2020-08-13 20:38:59 +02:00
Advaith
de8d26d791 docs(Constants): Improve large_threshold description (#3744)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-08-12 12:17:13 +02:00
Phineas
ea19faa411 Change domain to discord.com (#4160) 2020-06-19 11:46:59 +02:00
Evan
b0b62d63cf chore(docs): remove comment about type 13 (#4159) 2020-05-21 13:18:06 +02:00
Ryan Munro
7c6000c5e3 feat(ClientOptions): allow setting default allowedMentions (#4085)
* feat(ClientOptions): add default allowedMentions

* feat(ClientOptions): use default allowedMentions when not provided

* Update src/structures/APIMessage.js

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

* Update src/structures/APIMessage.js

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

* fix(ClientOptions): default allowedMentions should be undefined

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-04-17 11:23:31 +02:00
Roki
1330e2d246 feat: add supported 4096 image size and jpeg format (#4031)
* add 4096 avatar size that discord supports

* jpeg is also a thing

* update jsdocs

* update typings and remove duplicate type
2020-04-12 22:20:31 +02:00
SouSinner
88133d0d77 feat(GuildPreview): implement support for "preview" endpoint (#3965)
* feat(GuildPreview): method — fetchGuildPreview

* feat(GuildPreview): structure — GuildPreview

* feat(GuildPreview): update typings

* fix(GuildPreview): remove typedef for Features — already exists

* refactor(GuildPreview): update JSDocs & method

* feat(GuildPreview): implement DiscoverySplash function

* fix(GuildPreview): description & error handling for id

* fix(GuildPreview): misleading description, assign emojis correctly

* feat(GuildPreview): func DisplaySplash & GuildPreviewEmoji interface

* fix(Typings): satisfy TSLint

* fix(GuildPreview): toJSON - returns a value now

* feat(GuildPreview): add fetchPreview method on instance of Guild

* feat(GuildPreview): update typings

* fix: missing client constructor

* fix: typo in typings

* feat(BaseEmoji): implement BaseEmoji — parent for emoji instances

* feat(BaseEmoji): refactor - GuildEmoji extends BaseEmoji now

* feat(BaseEmoji): refactor - adjust emojis prop to BaseEmoji instance

* feat(BaseEmoji): not documented fully - GuildPreviewEmoji

* feat(BaseEmoji): update typings

* fix: remove duplicate typing properties - inherited

* fix: remove redundant methods & properties - inherited / already set

* fix: let -> const

* fix: typings - put BaseEmoji after BaseClient

* fix: remove _clone method  - redundant

* refactor(GuildPreview): emojis should be a collection

* refactor: rename base class, move relevant props there and expose roles

* fix(GuildPreview): update emojis in _patch

* fix(Typings): remove empty line, add Client#fetchGuildPreview

* feat: export GuildPreview

* fix(Typings): add GuildPreview#discoverSplash, icon, and splash

Co-authored-by: LxveFades <twitchisadeck@gmail.com>
Co-authored-by: Crawl <icrawltogo@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-03-27 20:57:28 +01:00
Jyguy
fee9a218e8 docs(MessageMentionTypes): move possible values to description (#3990)
* docs(MessageMentionTypes): correct type

* docs(MessageMentionTypes): change role to roles

* docs(MessageMentionOptions): correct description to allow usage as an array

* remove unneeded part of description

Co-Authored-By: Ryan Munro <rsm999@uowmail.edu.au>

* docs: add DisableMentionType to remove literal string types

Co-authored-by: Ryan Munro <rsm999@uowmail.edu.au>
2020-03-27 20:54:27 +01:00
Saya
f4b1b398d9 feat: document intent error code messages (#3871)
* Add 4013, Invalid Intents close code

* Add 4014, Disallowed Intents Code

* Add error messages for 4013 & 4014

* Rephrase invalid & disallowed intent error message

* Rephrase disallowed intent error message
2020-03-01 17:21:48 +00:00
Souji
8a2f8938be feat: Intents bitfield (#3844)
* feat: Intents bitfield

* suggestion: properly construct Intents.ALL

* fix: actually document the ws option

* suggestion: remove disabledEvents in favor of intents

* suggestion: remove obsolete check, validate falsy values

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

* fix: GUILD_BANS flag

* fix: exception for intents check in ws options

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

* docs: IntentsResolvable

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

* Update Client.js

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-02-29 15:20:15 +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
Papa
9c8aaf1bbc feat: reimplement disableEveryone into disableMentions
* User input sanitation: reimplement disableEveryone into disableMentions

* Change default value of ClientOptions#disableMentions to 'none'

* Update type declarations of disableMentions to include default

* update for compliance with ESLint

* Overlooked these files. Updated for complete compliance with ESLint
2020-02-29 14:20:39 +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
Timo
9cb306c823 feat: replace disableEveryone with disableMentions (#3830)
* add ClientOptions#disableMentions and MessageOptions#disableMentions

* provide tests

* don't sanitize controlled mentions

* add @here mentions to tests

* fix indents (6 spaces instead of 8)

* add Util#cleanContent tests

* add typings for removeMentions

* replace @ with @\u200b AFTER cleaning content as suggested instead of using removeMentions

* better explanation of this option

* no newline in Util.removeMentions

* fix long line

* remove double space

* remove comments (change has been reverted)

* Use Util.removeMentions to remove mentions

* use Util.removeMentions in Util.cleanContent
2020-02-26 11:13:23 +00:00
Sugden
ef8acecc70 feat: add new MessageTypes (14 and 15) (#3812)
* document types

* typings

* move comment
2020-02-22 12:31:51 +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
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
BorgerKing
3f8ea38b3a docs: info tag for ActivityType regarding CUSTOM_STATUS (#3757) 2020-02-12 22:23:06 +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
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
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
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
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
Vlad Frangu
5519d6fbaa src: sharding cleanup and checkReady rewrite (#3393)
* src: Step 1 of who knows how many

* src: Remove accidentally committed test file

* src: Remove useless added property in package.json

* docs: Trailing spaces, come back >.>

* src: Buhbye uws, we will miss you..not!

* src: Move 'auto' shard selection from totalShardCount to shards

* src: tweak

* src: Filter out floats from shard IDs
You want half of a shard or what?

* src: Misc cleanup and bugfix for GUILD_BAN_ADD

* src: Rewrite checkReady

* src: Misse this while merging master into my branch

* typings: Bring these up to date

* typings: Forgot allReady event

* src: Don't checkReady if the shard isn't waiting for guilds

* src: Fix a possible bug for when the ws dies and the session becomes -1

* src: Hopefully fix last edge case that could case a shard to infinitely boot loop

* src: Rename totalShardCount to shardCount

* src: Small bugfix

* src: Correct error message for shardCount being imvalid

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

* src: Small tweaks

* src: If this doesn't fix the issues I'm gonna throw a brick at my PC

* src: I swear, STOP BREAKING

* src: *groans at a certain snake*

* src: Use undefined instead of null on destroy in close event

Setting it to null sets the close code to null, which causes a WebSocket error to be thrown. The error is thrown from WebSocket, although there is no connection alive. Fun times!

* src: @SpaceEEC's requested changes

* src: Remove zucc from discord.js

Discord is removing support for it, sooo... Bye bye

* src: Missed this

* src: Apply @kyranet's suggestions

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

* src: @kyranet's suggestions

* src: Remove pako, update debug messages
- Pako is officially gone from both enviroments
  Install zlib-sync on node.js if you want it
- Improve a few debug messages some more
- Discover that internal sharding works in browsers but please don't do that
2019-12-15 20:45:27 +01:00
Jeroen Claassens
2ca74d6b63 feat(Activity): support for CUSTOM_STATUS activity type (#3353)
* feat: support for custom status in activity

* nit(typings): order properties
2019-12-05 13:13:42 +01:00
Antonio Román
a60f8b3d49 src(constants): add missing APIErrors (#3531)
* src: Updated APIErrors

* typings: Updated constants
2019-10-11 11:01:16 +02:00
Vlad Frangu
a4f06bdffd src: support new message fields (#3388)
* src: Update channel pattern

* src: Remove useless non-capture group

* src: it's as though we're starting fresh

* src: Bring this up to date for reals now

* src: typings and a bug fix

* src: Add crossposted channels to message mentions

* src: Requested changes and add typings

* src: Move Object.keys outside loop

* typings: Fix enum being exported when it shouldn't

* src: Consistency with roles and users

* docs: Correct docstring for MessageFlags#flags

* docs: Correct docstring for MessageMentions#crosspostedChannels

* docs: Suggestions
Co-authored-by: SpaceEEC

* src: Reset flags to 0 if no flags are received on MESSAGE_UPDATE
2019-10-01 11:01:55 +02:00
Crawl
321beb73bd revert: "feat(Partials): add DMChannel/MessageReaction#fetch()… (#3468)
This reverts commit b0047c424b.
2019-09-10 19:49:56 +02:00
newt
37ecf7b826 feat(constants): add verificationLevels (#3369)
* add Util.parseVerification()

* Made the code much cleaner.

* Removed method and created constant.

* Lint!

* refactor(constants): capitalize VerficiationLevels and add a typedef

* Changed VerificationLevels typedef to singular.

Co-Authored-By: Will Nelson <will@wnelson.xyz>
2019-09-10 16:12:27 +02:00
izexi
b0047c424b feat(Partials): add DMChannel/MessageReaction#fetch() and Parti… (#3261)
* 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>
2019-09-10 16:09:06 +02:00
Schuyler Cebulskie
4b34f1acbe Remove past-tense naming on shard events 2019-08-31 17:14:48 -04:00
Gryffon Bellish
4c08812302 docs(ClientOptions): document unit of restRequestTimeout (#3449) 2019-08-26 18:52:30 +02:00
Saya
e4309b23d5 feat: abort Requests that takes a lot of time to resolve (#3327)
* Add Request Timeout

* Add abort controller in packages

* Fix Lint Error.

* Fix Lint Errors

* Make Timeout Customizable & use finally

* Fixed a minor issue

* Fix eslint

* Update request timeout to use d.js client timeout methods.
2019-08-19 18:55:07 +02:00
MoreThanTom
547bf83100 feat(typings): constants export (#2915)
* Added typings for Constants export

* Full typing of list Constants

* Fix mistake in Package typing

* Cleanup for requested changes

moved fs import to import cluster
WSEvents using WSEventType to build type

* Satisfy tslint rules

* Update Constants.js

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts
2019-07-12 17:02:45 +02:00
bdistin
a22aabf6a8 feature: teams support (#3350)
* basic teams support

* export Team & TeamMember

* use typedef

* typings and some fixes

* Update src/structures/TeamMember.js

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

* fix Team#iconURL()

* fix typings and a bug

* fix states start at 1

* team icon hash can be null

* fix owner typings
2019-06-25 20:31:48 +02:00
SpaceEEC
1bec28bd81 feat(Guild): default iconURL to gif if animated (#3338)
* feat(Guild): default iconURL to gif if animated

* Icon, not Banner

* fix url
2019-06-13 14:14:47 +02:00
Saya
ddcc6cfec9 docs(Constants): add missing GUILD_EMOJIS_UPDATE to WSEvents (#3325) 2019-06-05 21:37:10 +02: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
Deivu (Saya)
405bdb5b55 cleanup(Constants): remove duplicate VOICE_STATE_UPDATE (#3313) 2019-05-31 09:06:28 +02:00
Vlad Frangu
a59968f7de src: add news and store channels, and missing guild props (#3168)
* src: Implement store and news channels!

* src: Remove code dupe

* src: Add missing guild properties

* docs: Add a small notice that the channel type may also change

* src: Remove re-creation of the MessageStore

* lint: Unused Import

* src: Requested changes for StoreChannels

* typings: Fix typings

* src: Moar guild updates

* src: Set maximumPresence to the data prop, the already existent one, or default to 5000

* typings: afkChannel is a VC

I keep confusing them, ffs

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

* docs: Document that maximumMembers and maximumPresences may be inaccurate before fetching

* src Appels requested changes
2019-05-03 17:08:07 +02:00