Commit Graph

284 Commits

Author SHA1 Message Date
Ryan Munro
f2fdb93318 fix(Typings): client message event should not emit PartialMessa… (#3983)
* fix(Typings): client message event should not emit PartialMessage

* Update typings/index.d.ts

Co-Authored-By: Jyguy <jskekkx@gmail.com>

Co-authored-by: Crawl <icrawltogo@gmail.com>
Co-authored-by: Jyguy <jskekkx@gmail.com>
2020-03-23 08:36:27 +01:00
Sugden
5da734c3d4 typings: add back accidental removal (#3984) 2020-03-23 08:30:04 +01:00
C eq Q divided-by U
495cfa96c2 fix(TypingStart): typing methods returning falsy values (#3939)
* fix: typing methods returning falsy values

* fix: eslint

* fix: no provided parameters; updated jsdocs

* fix(Typings): reflect typingStop

* refactor: since and lastTimestamp merged into one constructable value

* feat(Typings): document Channel#_typing

* feat: emit TypingData on typingStart; update jsdocs

* feat(Typings): move _typing to TextBasedChannel; sort props alphabetic

* feat(Event): remove typingStop

* feat(Typings): update typings - remove typingStop

* feat(Event): remove typingStop from Constants

* feat(Typing): remove TypingData class - redundant

* refactor(Events): remove TYPING_STOP event

* refactor(TypingData): now is an interface for _typing

* fix(TypingStart): timeout variable, removed emit for TypingData

* feat(Typing): timeout property on Channel#_typing, remove redundancy

* fix(Typings): extra overload(s)

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

* Update index.d.ts

* fix(Typings): remove "private" from interface — invalid TS

* feat(Typings): add PartialUser in case partials are enabled

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

* feat(Typings): document 'timeout' property of TypingData

Co-authored-by: Crawl <icrawltogo@gmail.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-03-21 09:52:40 +01:00
Ryan Munro
df324e2c21 feat(AllowedMentions): add support for MessageOptions#allowedMe… (#3893)
* feat(Allowed Mentions): Add support for new Allowed Mentions message options

* fix(docs): Update JSDoc for feature

* fix(apimessage): translate the propery into snake_case

* fix(typings): message mention options should be optional

* fix(docs): jsdoc typings for MessageMentionOptions

* fix(mentions): use Resolvables for MessageMentionOptions

* fix(docs): typedef for MessageMentionTypes

* Update typings/index.d.ts

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

* fix(mentions): drop support for Resolvables

* fix(AllowedMentions): remove the whole resolve function

* fix(docs): revert change to Resolvables

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-03-19 11:56:03 +01:00
KhaaZ
5b9cdc5cd2 feat(Permissions): Adds VIEW_GUILD_INSIGHTS (#3928) 2020-03-17 21:37:40 +00:00
Sugden
a6605155f0 typings/fix(Partials): fix unexpected TSC errors (#3957) 2020-03-17 20:01:26 +01:00
Sugden
8b906c69bb fix(Partials): correctly document properties for partialized st… (#3922)
* fix(Partials): properly document partial properties

* style: turn tabs into spaces

* style: order properties alphabetically

* fix(typings): PartialDMChannel will always have a recipient

* change properties to undefined instead of null

* docs: correctly mark properties

* style: remove tabs

* fix(partials): document properties properly

* style: tabs

* style: random line

* docs(User): tag is nullable

* typings(User/GuildMember): document lastMessageID properly

* typings/fix: change lastMessageID to lastMessageChannelID

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-03-17 18:59:47 +01:00
Daniell
2be9ebaad2 feat(typings): allow event listener type param inference (#3944)
* feat: allow listener type param inference

* fix: typo

* fix: invalid listener type

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

* fix: intellisense (user should extend interface)

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-03-17 18:52:11 +01:00
Joe Villegas
609a545131 typings(StreamDispatcher): remove end event (#3945) 2020-03-17 09:02:43 +01:00
Sugden
a53404fac3 typings(PartialTextBasedChannelFields): fix send overload (#3942) 2020-03-15 19:14:10 +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
Sugden
d43f78c845 typings(PartialTextBasedChannelFields): fix send overloads (#3935)
* typings(PartialTextBasedChannelFields): Remove duplicate types for parameters

* typings(PartialTextBasedChannelFields): fix overloads for send

* style: add semicolons and remove whitespace
2020-03-14 13:39:22 +01:00
Sugden
5b8f02243c typings(Client): remove typingStop event (#3919) 2020-03-14 11:41:05 +01:00
SpaceEEC
544bb78c8b refactor: make LimitedCollection an implementation detail (#3872) 2020-03-01 15:10:55 +01:00
Souji
acdd832fe2 fix(typings): enum values for ChannelType (#3861) 2020-02-29 18:58:20 +01:00
Souji
09e4912a90 fix(typings): remove duplicate VerificationLevels (#3862) 2020-02-29 18:58:11 +01:00
Souji
a6d3501ff8 fix(typings): for intents (#3860)
* re-introduce Intents export
* properly type WebsocketOptions#intents
2020-02-29 18:18:59 +01: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
didinele
d33fc741e3 typings: Refactor how channel types are done (#3808)
* refactor channel types

* really weird solution to make what the PR promises possible, I might revert this

* undo the dumb attempt

* Update index.d.ts

* fix GuildCreateChannelOptions#type

* fix(typings): remove initializers from the enum

* Update index.d.ts

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-02-29 15:11:56 +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
Ryan Munro
6650d50a56 feat(MessageEmbed): Support EmbedFieldData[] instead of EmbedFi… (#3845)
* fix(typings): MessageEmbedOptions#fields should be EmbedFieldData[]

* feat(MessageEmbed): Allow optional EmbedFieldData#inline in constructor

* docs(MessageEmbed): revert type change of fields

Co-authored-by: Crawl <icrawltogo@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-02-29 14:21:43 +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
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
izexi
de4b4a0939 feat(GuildMemberStore): add options.withPresences to fetch() (#3562)
* feat: add options.withPresences to fetch()

feat: update presences if present on received data

typings: add user & withPresences to FetchMembersOptions

fix: checking for added options

ref: qol changes to return type

so that all members are fetched

oopsie

* fix: use Manager.cache

* fix(typings): tslint error

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-02-29 14:18:37 +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
Sugden
1af1e0cbb8 refactor: add some more consistency (#3842)
* cleanup(StreamDispatcher): remove old 'end' event

* fix(StreamDispatcher): only listen to finish event once

* refactor(VoiceWebSocket): use `connection.client` in favour of `connection.voiceManager.client`

* fix(VoiceWebSocket): use `client.clearInterval` in favour of `clearInterval`

* refactor: destructure EventEmitter

* refactor: destructure EventEmitter from events

* refactor: use EventEmitter.off in favour of EventEmitter.removeListener

* style: order typings alphabetically

* oops

* fix indent

* style: alphabetically organize imports

* style: remove extra line

* Revert "style: remove extra line"

This reverts commit 96e182ed69.

* Revert "style: alphabetically organize imports"

This reverts commit 02aee9b06d.

* Revert "refactor: destructure EventEmitter from events"

This reverts commit 9953b4d267.

* Revert "refactor: destructure EventEmitter"

This reverts commit 930d7751ab.

* Revert "fix(StreamDispatcher): only listen to finish event once"

This reverts commit 485a6430a8.

* refactor: use .removeListener instead of .off
2020-02-28 18:02:51 +01:00
Souji
df88729c44 feat(MessageEmbed): re-introduce MessageEmbed#addField (#3850)
* feat(MessageEmbed): re-introduce MessageEmbed#addField

* suggestion: sorting alphabetically

* suggestion: document inline to default false for #addField
2020-02-28 17:58:52 +01:00
Sugden
6109669c97 typings(WebhookClient): client is not a client (#3838) 2020-02-28 17:41:12 +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
Crawl
c1d396a6c4 Partial-revert "typings(WebhookClient): client is not a Client" (#3831)
* Revert "typings(WebhookClient): client is not a Client (#3829)"

This reverts commit 44ff67dc11.

* Update index.d.ts

* Update index.d.ts
2020-02-24 22:44:46 +01:00
Sugden
44ff67dc11 typings(WebhookClient): client is not a Client (#3829)
* typings(WebhookClient): client is not a Client

* style: use tabs
2020-02-24 22:01:41 +01:00
Sugden
91a025caaa feat: GuildEmoji & Invite to GuildResolvable (#3637)
* Add GuildEmoji to GuildResolvable

* Add GuildEmoji to GuildResolvable

* Add Invite to GuildResolvable

* Add Invite to GuildResolvable

* oops

* oops x2

* Add Guild#fetchBan and an error for not resolving the ID

* typings

* Revert "Add Guild#fetchBan and an error for not resolving the ID"

This reverts commit a4d0ed16e7.

* Revert "typings"

This reverts commit 5a54e88785.

* fix jsdoc

* add trailing comma
2020-02-24 18:27:34 +01:00
matthewfripp
acf724e691 feat(Collector): Addition of resetTimer() (#3825)
* feat(Collector): Addition of resetTimer()

* typings
2020-02-24 18:17:24 +01:00
SpaceEEC
a69ebbe9d9 feat/fix(GuildAuditLogs): handle new event types (#3602)
* feat/fix(GuildAuditLogs): handle new event types

* fix(GuildAuditLogsEntry): coerce to numbers, simplify extra for deleted entities

* fix(GuildAuditLogsEntry): do not revert 'type' extra
2020-02-24 18:16:20 +01:00
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
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
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