Commit Graph

85 Commits

Author SHA1 Message Date
Antonio Román
3c62bd2d47 refactor: import timers, process, and Buffer from node: (#7157)
Co-authored-by: muchnameless <12682826+muchnameless@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
2021-12-28 10:15:24 +01:00
Jiralite
2a0dedf3e9 chore: Emit deprecation messages (#6994) 2021-11-23 10:29:45 +01:00
Jiralite
73854ee852 refactor(MessageEmbed): Utilise an object approach for .setAuthor() (#6966)
Co-authored-by: Almeida <almeidx@pm.me>
2021-11-16 18:31:08 +01:00
Rodry
95d2a4d35e fix(MessageEmbed): only compare image urls in #equals (#6926) 2021-11-01 18:36:41 +01:00
Rodry
fae4abf2f7 feat(MessageEmbed): add #equals (#6885) 2021-10-27 12:08:20 +02:00
Jiralite
c44ea50157 docs: Typos, consistency and grammar fixes (#6811) 2021-10-13 12:20:44 +02:00
Rodry
256fb905fe types(MessageEmbed): allow APIEmbed type (#6629) 2021-09-15 00:19:49 +02:00
Jeroen Claassens
7aff15a055 typings(MessageEmbed): allow null for setTimestamp (#6514) 2021-08-24 21:19:03 +01:00
Rodry
b4afcf8236 docs: general cleanup and improvements (#6299)
Co-authored-by: DaStormer <40336269+DaStormer@users.noreply.github.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2021-08-05 20:34:06 +01:00
Rodry
a25e16599a feat(MessageEmbed): add setFields method (#6186)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2021-07-31 13:15:49 +01:00
ckohen
b62d646271 docs: add Partial typedef (#6029) 2021-07-04 12:25:35 +01:00
Sugden
1e8f01253e refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2021-06-30 21:40:33 +01:00
Rodry
e0efcc6ab0 docs(*): add links to Discord's API objects & data (#5862) 2021-06-24 09:55:44 +01:00
Jan
e3e466d3e5 refactor(MessageEmbed): remove files (#5813)
* refactor(MessageEmbed): remove files

* fix: test
2021-06-11 21:36:31 +01:00
Tyler Resch
f5f3f77286 docs(MessageEmbed): deprecation advisory for type (#5774)
Co-authored-by: DTrombett <73136330+DTrombett@users.noreply.github.com>
Co-authored-by: Noel <icrawltogo@gmail.com>
2021-06-10 19:35:35 +01:00
Jan
bfe01b52ab fix(MessageEmbed): import custom RangeError class (#5740) 2021-06-03 15:54:19 +01:00
Souji
7b85a7259f feat(*): enforce strings (#4880)
BREAKING CHANGE: Removes all Resolvables for only string inputs

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2021-06-01 16:31:49 +01:00
anandre
ff2f7372f2 feat(MessageEmbed): remove normalizeField validation (#5459) 2021-05-11 22:24:35 +02:00
Rodry
4a06dd1295 docs(MessageEmbed): MessageEmbedOptions typedef (#5466)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2021-05-10 12:31:35 +02:00
Bread
e37160f4e3 fix(MessageEmbed): include author.name in length getter (#5167)
* fix(MessageEmbed): include `author.name` in length getter

* Update src/structures/MessageEmbed.js

Co-authored-by: Papaia <43409674+papaia@users.noreply.github.com>

* style: oxford comma

Co-authored-by: Papaia <43409674+papaia@users.noreply.github.com>

* refactor: es2020 syntax

Co-authored-by: Papaia <43409674+papaia@users.noreply.github.com>
2021-01-01 00:11:52 +01:00
Sugden
af670fc718 refactor: improve the accuracy of docs/improve docs (#4845)
Co-authored-by: Noel <icrawltogo@gmail.com>
2020-10-17 15:53:02 +02:00
Sardonyx
2a7f749d5a docs(Embeds): Added descriptions to the typedefs (#4303)
Co-authored-by: RDambrosio <rdambrosio016@gmail.com>
2020-08-12 12:29:02 +02:00
Corentin Poupry
605ee8587b fix(MessageEmbed): explicitly mark proxyIconURL as undefined (#4097) 2020-04-26 17:02:45 +02:00
SpaceEEC
4625881c54 docs(MessageEmbed): document the constructor (#4077) 2020-04-16 12:07:08 +02:00
Sugden
a5267e1163 docs(MessageEmbed): correct description of createdAt (#3897)
* docs(MessageEmbed): correct description of createdAt

* typo
2020-03-17 19:04:46 +01:00
Matt (IPv4) Cowley
3e169cb4d3 fix(MessageEmbed): skip validation of fields when inside a message (#3894)
* fix(MessageEmbed): Add skipValidation flag to MessageEmbed

* fix(MessageEmbed): Use skipValidation flag in Message

* fix(MessageEmbed): Restore static normalizeField(s) methods

* fix(MessageEmbed): Update typings for constructor

* fix(MessageEmbed): Remove private docstrings/typings

* fix(MessageEmbed): Use skipValidation without storing in instance

* fix(MessageEmbed): skipValidation without modifying normalizeFields

* fix(MessageEmbed): Revert indentation change in typings

* fix(MessageEmbed): Clone logic from normalizeFields (duplicated code ftw)

* revert(MessageEmbed): remove dead code / breaking change

- dead code
  discord.js does not use those methods interally and won't in the future, as Discord
  does not emit any partial embed updates and doing so in the future seems unlikely.
- a breaking change (an incompatible api change)
  Although it's not recommended to do, users can modify
  received embeds without cloning them, e.g.:
  const embed = message.embeds[0].addField('some title', '');
  (replace '' with some function call; this is just an example)
  This would no longer throw a synchronous error (breaking change),
  but at a later point when actually sending it. (poorer to debug)

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-03-08 17:24:18 +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
Bence
bbe169deac fix(MessageEmbed): prevent possible destructuring error 2020-02-29 14:19:56 +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
31a3a86ebc docs(MessageEmbed): document article embed type (#3846) 2020-02-28 17:43:11 +01:00
BorgerKing
52c0a4067b fix(MessageEmbed): various typos and fixes (#3819)
* fix: typo

* fix: couple more typos

* fix: grammar stuff

* fix: EmbedField takes StringResolvable not string

* Revert "fix: EmbedField takes StringResolvable not string"

This reverts commit c1bdd78ad3.

Co-authored-by: Crawl <icrawltogo@gmail.com>
2020-02-24 18:21:29 +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
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
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
iBisho
b347e9ec26 refactor(MessageEmbed): simplify initialization of files property (#3814) 2020-02-22 22:36:29 +01:00
MoreThanTom
52bc5b0170 feat(MessageEmbed): resolve color in embed constructor (#2912)
* Resolve color in embed constructor

* Use ColorResolvable type for color parameter

* docs(MessageEmbed): color property is still a number
2019-04-15 20:46:59 +02:00
Linn Dahlgren
7006f00ae4 feat(MessageEmbed): add missing proxyURL property to video (#3109)
* Added missing property to MessageEmbed.video

* Updated typings for MessageEmbed.video
2019-02-24 09:27:57 +01:00
Linn Dahlgren
4d3f76656a docs(MessageEmbed): add missing type value (#3106) 2019-02-23 10:05:04 +01:00
Rattmann (fallen)
1db78994dd feat: MessageEmbed#length (#3003)
* add MessageEmbed#length

* update typings (+MessageEmbed#length)

* eslint: L181 (max line length), L183 (missing semi)

* eslint: L181 (trailing space)
2019-02-02 20:29:10 +01:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
bdistin
8feb874586 feat(MessageEmbed): add spliceField method (#2857)
* Add spliceField and refactor to prevent code dupe

* String() was for a falsy check, fixed

* requested: remove embed field count checks
2018-10-10 09:57:56 +02:00
Isabella
1fe36087d4 feat(MessageEmbed): allow setTimestamp to take a timestamp (#2875)
* feat: allow MessageEmbed#setTimestamp to take a timestamp

* fix the dumb i did
2018-10-10 09:57:13 +02:00
1Computer1
19c298f5cc refactor: rewrite message creation (#2774)
* Rework createMessage
- MessageAttachment is now structurally similar to FileOptions
- No longer mutates the object passed as options
- Supports more permutations of arguments

* Ignore complexity warning

* Refactor name finding

* Fix typo

* Update typings

* Default name to null for MessageAttachment

* Make Message#reply use transformOptions

* Move transformOptions

* Fix Message#reply

* Fix mutation

* Update tests

* Fix options passing

* Refactor into APIMessage

* Fix webhook send

* Expose APIMessage

* Add documentation

* Add types

* Fix type doc

* Fix another type doc

* Fix another another type doc (is this one even right!?)

* Remove trailing comma

* Properly clone split options

* Add support for sending file as stream

* Missed a doc

* Resolve files only once when splitting messages

* This looks nicer

* Assign directly

* Don't cache data and files

* Missing return type

* Use object spread instead Object.assign

* Document constructors

* Crawl is a little dot

* comp pls

* tests: sanitize local file path, disable no-await-in-loop
2018-08-21 18:22:29 +02:00
Crawl
5980d04f2b docs: implement #2707 on master 2018-08-08 12:48:34 +02:00
Jacz
e12ab7428f fix(MessageEmbed): correct docs, default to array, resolve MessageAttachments (#2492)
* Fix(MessageEmbed): Remove useless for...of & change this.files to be out of the data.files check...

* Requested changes
2018-04-23 19:38:56 +02:00
Will Nelson
b5b436f9cb Revert "fix message embed json serialization (#2420)"
This reverts commit c40488eb54.
2018-03-24 18:47:15 -06:00
Will Nelson
c40488eb54 fix message embed json serialization (#2420)
* fix message embed json serialization

remove the toJSON method on message embeds so the raw data is exposed
for JSON seralization. this removes the hexColor property, but it
probably should not have been there in the first place. fixes #2419

* change api transform to tojson
2018-03-24 19:43:56 -05:00
Will Nelson
cf7dcba1a5 Add toJSON methods (#1859)
* tojson things

* fix client

* ignore private properties

* remove extra property descriptors

* handle primitive flattening

* remove unused import

* add toJSON to collections

* reduce stateful props

* state

* allow custom prop names when flattening

* fix client

* fix build

* fix flatten docs

* remove guild.available, cleanup permissions, remove arbitrary id reduction

* fix util import

* add valueOf as needed, update member props

* fix incorrect merge

* update permissionoverwrites and permissions

remove serialization of permissions in PermissionOverwrites#toJSON.
change Permissions#toJSON to serialize permissions, by default excluding
admin checks.

* change Permissions#toJSON to return the primitive

* Permissions#toJSON explicitly return bitfield
2018-03-01 23:00:21 -06:00