Commit Graph

64 Commits

Author SHA1 Message Date
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
Noel
dea48d64a5 chore(Deps): upgrade deps (#4701) 2020-08-14 21:46:23 +02:00
Jan
0e61fca974 docs: make use of MessageResolvable type for bulkDelete (#4661) 2020-07-29 12:15:23 +02: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
Sugden
a04b4cae3e docs(TextBasedChannel): fix typo (#3858) 2020-02-29 15:11:06 +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
Crawl
3a0470b45c chore(deps): update deps and fix lint (#3833) 2020-02-24 23:14:31 +01: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
Ryan Munro
d8b4725caa fix(TextChannel#bulkDelete): use GenericAction#getMessage to handle return value correctly (#3664)
* Corrected the handling of the action

* Apply same fix to handling of single message in bulkDelete

* Revert to using await
2020-01-25 15:27:39 +01: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
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
Andrew Lehman
3298ea1869 docs: correct default value for SplitOptions.maxLength in Util#splitMessage (#2847) 2018-09-23 21:35:56 +02: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
Ash
e96a60361a feat(TextBasedChannel): add lastPinTimestamp and lastPinAt (#2813)
* add lastPinTimestamp

* typings

* use or instead of ternary
2018-09-03 09:11:52 +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
bdistin
5afd77ab73 refactor: remove user bot methods (#2559)
* [WIP] Remove user bots

* more backend userbot removal

* Add mfaEnabled back

* revert client presences store removal

* partially revert getAuth changes

* remove more no longer used children of ClientUserGuildSettings

* fix a bug with this pr and TextBasedChannel.applyToClass

* remove a syncGuilds reference

* more user bot data handling

* various guildSync cleanup

* bots can't call logout

Had the user/bot portions of the code mixed up. Though, does this need to be a promise anymore?

* make ClientManager#destroy() sync

It nolonger needs to be a promise, and nothing depended on it being a promise that I can tell.

* requested change

* Fix massive error

* no longer used as it's userbot only
2018-07-25 22:14:23 -04:00
SpaceEEC
90312952d9 revert: "Improved TextBasedChannel#send (#2537)"
This reverts commit 556e679bdb,
which broke resolving of non object literal message options.
2018-05-04 16:44:06 +02:00
Kyra
556e679bdb Improved TextBasedChannel#send (#2537) 2018-05-04 14:56:22 +02:00
Lewdcario
745669a7c9 docs: consistency 2018-04-29 13:28:12 -05:00
bdistin
630009f3cf fix: Convert lastMessage to getters (#2384)
* convert lastMessage to getters

* fix bug in pr

* requested changes
2018-03-08 10:19:43 -06:00
Lewdcario
24571e465b docs: examples & improvements 2018-03-01 22:50:45 -06:00
Isabella
45127bb408 docs: improve examples (master branch) (#2209)
* docs: improve examples

* more improvements


fix


maybe this


another example


collectors

* stuff
2018-01-04 01:12:05 +01:00
Gus Caplan
29a81eab73 standardize message object creation (#1986)
* standardize message object creation so i don't flip out again

* fix stuff

* Update Message.js

* Update index.js

* Update SendMessage.js

* Update Message.js
2017-10-29 14:54:00 +01:00
SpaceEEC
94a4a068b9 fix(TextBasedChannel): return a promise in startTyping and clarify count parameter (#2047)
* fix(TextBasedChannel): return a promise in startTyping

This fixes #2040

Calling TextBasedChannel#startTyping now returns a promise.
This promise resolves when the bot stops typing (TextBasedChannel#stopTyping) or rejects when an error occurs.
Calling the method again returns the same promise as long the bot is still typing.

* move code into the promise' executor

* Clarify the purpose of the returned Promise

* inverse if and clarify count parameter
2017-10-29 14:53:34 +01: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
3c0d7b8105 enhancement/feature(bulkDelete): accept array of ids and handle case of 0 or 1 message(s) (#1980) 2017-10-01 11:58:13 +02:00
Gus Caplan
27ccad1f1c tinify webpacks (#1975)
* tinify webpack

* meme

* fix long version

* more changes

* even smoler

* fix up logic

* fix build

* undo changes to user agent manager because its not webpack'd anymore

* the heck

* fix stupid

* clean up browser rules

* typo
2017-09-26 07:18:12 +02:00
bdistin
dd085ceaee Datastore cleanup (#1892)
* Start Store cleanup

* wip store cleanup

* fix iterables initiating datastores

* handle the possibility of a datastore with no holds and no its own 'create' method

* more cleanup (instances that need more than just client/data)

* missed RoleStore extras

* not sure how eslint didn't catch that tab...

* avoid re-getting the channel we already have...

* cleanup resolvers and refactor them into DataStores

* ^

* and remove

* fix some bugs

* fix lint

* fix documentation maybe?

* formatting

* fix presences

* really fix presences this time

* bad fix was bad... let;s see how bad this one is..

* forgot to save a file

* make presence resolving take userresolveables too

* fix tabs in jsdocs

* fix bad fix from last night that caused issues, with better fix...

* oops
2017-09-08 23:06:10 +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
434a22dc4e MessageOptions can take content (#1861) 2017-08-31 18:27:58 +02:00
SpaceEEC
65d9d46a3c Fixed DataStore, deprecation leftovers and a bit of Event Constants (#1841)
* Fixed leftover fetchThing and removed unused methods/error messages

* Added resume event constant and used event constants wherever possible

* Replaced mentions of removed method name with their new name.

* Fixed typo: resume -> resumed
2017-08-28 00:11:28 +02:00
Amish Shah
b8315b79c7 Store and Model Refactor (#1618)
* UserStore refactor

* Create ChannelStore, remove redundant methods in ClientDataManager

* Create GuildStore

* Emoji stuff

* Use a Base class where possible to reduce code duplication

* Remove unnecessary comments from ChannelStore

* Add Base._clone();

* Remove unused ClientDataManager methods

* Refactor some more stuff

* ESLint

* Move Client#fetchUser to client.users.fetch

* Remove .has checks and just see if .get is truthy

* Fix guild member chunk error

* ESLint

* Fix typo

* Fix channel storing for user bots

* Remove ClientDataManager

* GuildChannelStore

* Reduce use of Util.cloneObject

* and this one too

* update typings

* Fix MessageUpdate handling (#1507)

* Fix role updates (probably fixes #1525)

* fix for eslint

* Address some of appell's comments

* Use debug constant

* start message store crap if it's ugly tell me later k

* fix that

* message store but works™️

* clean up guild stuff

* clean up channel store stuff

* clean up channel event handling

* does this message stuff work? find out soon in the next episode of dIsCoRd.Js

* eslint

* emojis

* emojis and reactions

* hi my name is eslint and im A LIL SHIT

* so i forgot this huh

* user stuff

* Fix @class

* Fix message stuff

* Fix user store docs

* Document all the bases

* fix the super things

* tidy up remove

* fix textbasedchannel

* fix that too

* fix emoji store

* make voice state stuff less ugly

* make voice states even less ugly

* make members less bad

* fix bug

* fix that too

* fix reactions

* how was this broken for so long

* role store

* remove super._patch from UserConnection

* Rename UserProfile#setup to _patch

* remove unnecessary super calls

* update docgen dep (pls fix travis thx)

* doc messagestore

* fix docs

* message store docs

* things

* DOCS PLS

* more things

* Document TextBasedChannel#messages as a MessageStore

* Rebase

* All the stores!
2017-08-25 21:08:58 +01:00
Isabella
4520c801d3 update attachment & docs (#1815) 2017-08-21 23:11:58 +02: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
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
Gus Caplan
4e5556ba09 important build stuff (#1663) 2017-07-08 07:16:46 +02:00
Crawl
0c34f3a313 Update dependencies & make webpack great again 2017-07-05 11:53:53 +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
SpaceEEC
3da95d7e68 Corrected some docstrings (#1611)
* corrected some docstrings

* merge master

* fixed MessageSearchResult typedef and moved the note for the hit property to there
2017-07-04 00:22:48 +02:00
SpaceEEC
ee3a2415e4 Removed deprecated file option from MessageOptions (#1614) 2017-07-04 00:06:29 +02:00
Gus Caplan
5ecd5f7d69 REST API speed improvement (#1577) 2017-07-01 10:14:17 +01: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
Gus Caplan
7f8cc9c297 sanity changes to search (#1593)
* Create Search.js

* Create Guild.js

* Create TextBasedChannel.js

* Create Search.js

* Create Search.js

* Create Guild.js

* Create TextBasedChannel.js

* Create Search.js
2017-06-24 23:23:45 +01:00
Crawl
0898e1dd5b Fix createMessageCollector example 2017-06-08 14:50:26 +02:00
Gus Caplan
1aa2293ebf add nsfw option to search (#1534)
* Update Search.js

* Update TextBasedChannel.js

* Update Search.js
2017-05-29 15:19:31 +02:00