Commit Graph

64 Commits

Author SHA1 Message Date
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
Isabella
9810bdbc5f fix(MessageEmbed): remove length checks (#2304)
* fix(MessageEmbed): remove length checks

* update error messages
2018-01-29 10:56:55 -06:00
Michel Nguyen
19591b0bb1 docs: fix attachFiles() docs (#2267)
* docs change

* fix attachFiles docs

* why was this still here
2018-01-18 07:42:05 +01:00
Dim
351f5f7209 fix: missing height & width in embeds (#2249) 2018-01-14 13:28:46 +00:00
SpaceEEC
0101392334 Documentation improvements (#2069)
* docs: fix documentation in various places

All stores: resolveID returns a nullable Snowflake
GuildAuditLogs: ActionType also can be ALL
MessageEmbed: make files property show up in the docs
ClientApplication: resetSecret and resetToken return a promise
ClientManager: status is readonly
Guild: features is an array of strings and ban no longer accepts a number or string
Guild: ban method no longer accepts a string or number
GuildMember: ^
RichPresenceAssets: small and large Image are Snowflakes, also fixed parameter documentation for small and large image url method
WebhookMessageOptions: file property is no longer a thing

* docs: improve GuildAuditLogs documentation

Prefix types with AuditLog to avoid confusion
Document GuildAuditLogs' static Targets and Actions properties and add necessary typedefs
Use typdefs over primitives where possible.

* fix documentation for Guild#defaultRole
2017-10-28 19:04:03 +02:00
Robin B
97823bc376 Various documentation adjustments (#2001)
* docs(various): Add "at" to createdAt description

* docs(Client): Adjust to fit with guilds property

* docs(various): Adjust phrasing & fix typos

* docs(various): Clarifications

* docs(Permissions): fix numerus

* docs(DataStore): capitalize DataStore

* docs(various): Formatting changes

* docs(Presence): Expand RichPresenceAssets docs

* Add space
2017-10-07 01:56:17 +02:00
SpaceEEC
1537dd7be7 fix(MessageEmbed): don't send 'files' as part of the embed (#1982) 2017-09-26 19:17:27 +02:00
Drahcirius
63f6247ce5 fix/feat(MessageEmbed): deep copy fields and fix files when passed into constructor (#1864) 2017-09-09 23:43:13 +02:00
Robin B
d6b276bc29 refactor(Attachment): Merge MessageAttachment with Attachment (#1894)
* refactor(Attachment): Merge MessageAttachment with Attachment

* refactor(Attachment): Rename setup to _patch for consistency

* refactor(MessageAttachment): Global rename of Attachment class
2017-09-06 23:12:20 +02:00
Frangu Vlad
284f4e8ac0 Fix MessageEmbed copy paste (#1834)
The addField function wouldn't have errored if value wasn't a string
2017-08-26 10:03:44 +01:00
BigBrainAFK
86ffdc38d3 Mark video property as readonly (#1833) 2017-08-26 10:00:33 +01:00
iCrawl
2aa2f73c74 Docs cleanup 2017-08-17 20:04:01 +02:00
Isabella
62fc9fce6d Add Attachment structure (#1731)
* Add Attachment structure

* Fix linter issues + @private

* Fixed array sends, also added embed sends

* fixed proving path to attachment

* fixed incorrect name assumption from path

* linting fix

* ;)

* im really good at this

* changes as requested by gus

and computer from #1459

* am a dum

* update webhook#send

* readonly addition to getters

* i... uh... oops

* farming deez commits

* fix webhook split

* removed some ugly

* removed .every checks
2017-08-06 18:09:47 -04:00
SpaceEEC
fdb8f046b5 Fixing MessageEmbed's timestamp transforming (#1688)
when sending to discord
Also storing the timestamp in milliseconds when using setTimestamp
2017-07-16 17:55:51 +02:00
SpaceEEC
8580380541 fixed MessageEmbed#timestamp and changed attachFile to attachFiles (#1670)
* fixed MessageEmbed#timestamp and changed attachFile to attachFiles
as well as a few doc changes

* Embed#files shouldn't be a nested array
2017-07-16 14:11:49 +02:00
Drahcirius
b1d9084345 Remove RichEmbed in favour of MessageEmbed (#1584)
* remove RichEmbed in favour of MessageEmbed

* fix provider typo
2017-07-04 00:53:22 +02:00
Gus Caplan
63e54982f4 Errors Standardization (#1246)
* errors and stuff

* more errors

* all the errors

* fix build
2017-06-25 18:48:05 +01:00
Drahcirius
555317043e Message embeds (#1529)
* wowe

* fix sending

* Update MessageEmbed.js

* lel

* patched some fields for message embed and transforms edits as well

* webhook embeds transform

* apply transform to webhook embeds, and changed references

* Update MessageEmbed.js

* Update ClientDataResolver.js

* updated embeds params and use new util resolvers

* did not mean to add this back

* use master version of ClientDataResolver

* transform no longer needed
2017-05-28 03:34:30 +02:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
SpaceEEC
ecb8655dac Document readonly and private properties (#1338) 2017-04-03 20:05:36 +02:00
Crawl
f73e6a3e4d Fix typo in MessageEmbed#video 2017-03-30 22:14:06 +02:00
1Computer1
5334682682 Add missing properties for MessageEmbed (#1300)
* Add missing properties

* Derp
2017-03-30 08:47:34 -04:00