Commit Graph

100 Commits

Author SHA1 Message Date
Antonio Román
985d4d6a43 refactor: removed code and split options (#5918)
Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com>

BREAKING CHANGE: Removed `APIMessage#split`
BREAKING CHANGE: Removed `MessageEditOptions#code`
BREAKING CHANGE: Removed `BaseMessageOptions#code`
BREAKING CHANGE: Removed `BaseMessageOptions#split`
2021-06-26 23:11:40 +01:00
SpaceEEC
4714a961b8 fix(Webhook): resolve non-string avatars too (#5914) 2021-06-25 11:11:56 +01:00
ckohen
7346621d15 feat: api v9 and threads (#5570)
Co-authored-by: Noel <icrawltogo@gmail.com>
Co-authored-by: Amish Shah <dev@shah.gg>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SynthGhost <60333233+synthghost@users.noreply.github.com>
Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com>
Co-authored-by: Elliot <elliot@maisl.fr>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2021-06-24 20:48:29 +01:00
Rodry
e0efcc6ab0 docs(*): add links to Discord's API objects & data (#5862) 2021-06-24 09:55:44 +01:00
Shubham Parihar
6cebeae15e docs: move embeds field into BaseMessageOptions (#5902) 2021-06-22 15:25:18 +01:00
Shubham Parihar
f7eeccba4b feat(*): use enums for consistency and speed (#5843)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2021-06-15 12:33:31 +01:00
Shubham Parihar
a5a6e22316 fix(*): typedefs and typings for image & webhook options (#5805) 2021-06-11 23:22:01 +01:00
Almeida
93b0a4e005 fix(TextBasedChannel): allow passing an APIMessage with split (#5815)
* fix(TextBasedChannel): allow passing an APIMessage with split

* fix(Webhook): allow passing an APIMessage with slit
2021-06-11 22:54:29 +01:00
SpaceEEC
eb98e33a85 fix(Webhook): throw an error if no token is available when it's required (#5798) 2021-06-10 17:05:45 +01:00
monbrey
c4f1c75efa feat: general component improvements (#5787) 2021-06-09 13:59:12 +01:00
Adrian Castro
0467a9075f refactor: enforce single param on sending/editing methods (#5758)
Co-authored-by: ckohen <chaikohen@gmail.com>
Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2021-06-09 13:12:16 +01:00
monbrey
657635c1c0 fix: add components to MessageOption typedefs (#5768) 2021-06-07 09:32:50 +01:00
ckohen
dec191aa1e feat(Interactions): add InteractionWebhook for better internals (#5712) 2021-06-06 00:41:23 +01:00
Shubham Parihar
2901fd595b fix(Webhook): #editMessage throws error when content is null (#5757) 2021-06-05 20:26:12 +01:00
Shubham Parihar
678b7da5b3 docs: remove traces of StringResolvable (#5727) 2021-06-02 10:55:56 +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
Shubham Parihar
256d1b0dfc docs(Webhook): update typings and docs for #editMessage (#5713) 2021-05-31 20:56:08 +01:00
Shubham Parihar
3589e0f442 docs: add new typedef to properly doc InteractionReplyOptions (#5632) 2021-05-26 12:09:25 +01:00
Jan
f7643f7bbe feat: interactions (#5448)
Co-authored-by: izexi <43889168+izexi@users.noreply.github.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Advaith <advaithj1@gmail.com>
Co-authored-by: Shiaupiau <stu43005@gmail.com>
Co-authored-by: monbrey <rsm999@uowmail.edu.au>
Co-authored-by: Tiemen <ThaTiemsz@users.noreply.github.com>
Co-authored-by: Carter <carter@elhnet.net>
2021-05-07 17:22:33 +02:00
izexi
63398d6ae4 feat(Webhook): add 'fetchMessage' method (#5530) 2021-04-30 21:49:32 +02:00
Souji
116ecf246e feat(Webhook): sourceGuild, sourceChannel, improve owner (#5508) 2021-04-30 21:44:23 +02:00
Jan
164ddf668f refactor: rename Snowflake to SnowflakeUtil (#5502) 2021-04-15 00:37:54 +02:00
izexi
7cabc1c490 feat(Webhook): add '(edit|delete)Message' methods (#5223) 2021-04-03 15:06:18 +02:00
Advaith
41078997ae feat(APIMessage): remove disableMentions (#4836)
* chore: remove disableMentions

* style: fix eslint
2020-12-14 13:51:31 +01:00
Phineas
ea19faa411 Change domain to discord.com (#4160) 2020-06-19 11:46:59 +02: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
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
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
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
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
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
Carter
330d5db586 feat(Webhook): addition of Webhook#avatarURL function (#3625)
* feat: addition of Webhook#avatarURL

* typings: added Webhook#avatarURL

* fix: trailing space

* docs: fixed jsdoc function description

* fix: typo
2019-12-15 20:20:15 +01:00
Vlad Frangu
fbd811517a src: Update Webhook#sendSlackMessage to be accurate with what the API returns (#3429)
* src: Update sendSlackMessage

* typings
2019-08-19 21:02:33 +01:00
SpaceEEC
c786867bd6 fix(Webhook): return raw data if the channel is unavailable
Fixes #3424
2019-08-18 11:45:28 +02:00
Vlad Frangu
d7a9b74523 src: Replace instanceof Array checks with Array.isArray and instanceof Buffer with Buffer.isBuffer (#3227)
* src: Replace instanceof Array checks with Array.isArray

* src: Buffer.isBuffer instead of instanceof Buffer
2019-04-29 17:49:41 +01:00
izexi
c078682722 feat(Webhook): add url getter (#3178)
* add Webhook#url

* set typing as readonly

* suggested change

* another one
2019-04-05 11:09:58 +02:00
SpaceEEC
840d22f892 docs(Webhook): add mising '@name' to Webhook#token's docstring 2018-12-30 12:52:33 +01:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
SpaceEEC
0ab69c5ad4 fix(Webhook): APIMessage require should be a const 2018-09-23 17:04:22 +02:00
SpaceEEC
c0a9b08e73 fix(Webhook): APIMessage is not circular, fixes WebhookClients 2018-09-23 17:02:35 +02:00
Lewdcario
53420fa4e7 fix: Webhook#send not resolving content 2018-09-21 23:02:31 -05:00
bdistin
6d184257b3 refactor: remove duplicate send checks (#2790)
* re-direct pr code to master

* fix Webhook send docs

* requested changes

* typings: Updated to latest commit

* requested change

* requested change
2018-09-21 10:59:58 +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
Kyra
e0378cf350 refactor(Webhook): make token not enumerable (#2566)
* Hide Webhook#token (consistency with Client#token)

* Make `Webhook#token` writable

* fix: devsnek's requested change

Webhook#token must be both writable and configurable.
2018-07-18 11:37:57 +02:00
Lewdcario
077d41fbca fix(Webhook): import Channel correctly 2018-07-01 10:19:44 -05:00
Lewdcario
f293dddc29 fix: Webhook#edit attempting to use client.channels always 2018-05-02 21:19:00 -05:00
Lewdcario
745669a7c9 docs: consistency 2018-04-29 13:28:12 -05:00
Lewdcario
24571e465b docs: examples & improvements 2018-03-01 22:50:45 -06:00