Commit Graph

137 Commits

Author SHA1 Message Date
Ryan Munro
0f49d67e2e feat(Message/Mentions): implement caching of members (#3684)
* Convert message#member to a getter

*  Try to cache members from data in message payloads

* Cache mentioned members

* Revert Message#member getter - breaking change

* Revise member caching

* Revise member mention caching

* Pass member to _addMember correctly

* Use message.guild instead of this.guild

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

* Merge if's onto one line

* fix(Message): use this.author.id to check cache

Discord does not send an id in the member data here

* chore(Message): reindent equals

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2020-01-19 12:27:57 +01:00
SpaceEEC
db492e66e2 chore: explicitly mark everything deprecated as @ deprecated (#3307) 2019-05-29 22:18:14 +02:00
bdistin
8c213e9088 fix(Message#pinnable): you can't pin system messages (#3279) 2019-05-18 19:06:15 +02:00
SpaceEEC
616e0dd398 fix(Message): properly check for an edited_timestamp in patch
Fixes #2750
2018-08-15 09:18:17 +02:00
Lewdcario
41f6eaa635 backport: Message#url getter 2018-07-26 11:22:29 -06:00
Lewdcario
3fa9ed1f42 backport: deleted property 2018-06-29 19:11:50 -05:00
SpaceEEC
8a3ae875bb fix: do not cache webhook users (#2611)
Goal in mind is to not save the name and avatar used by webhooks because
those can change between messages without any other update.
2018-06-21 21:34:30 +02:00
SpaceEEC
3ba26ad972 fix(Message): do not update editedTimestamp when there is none in the payload
Fixes #2307
2018-04-19 13:13:50 +02:00
Lewdcario
38f5288be8 docs: Message#type 2018-03-01 20:12:14 -06:00
Isabella
af3517594f docs: improvements 2018-02-27 10:43:31 -06:00
Isabella
c79823002b docs: improve examples (#2200)
* docs: improve examples


another

* remove conflict

* some nuances

* backport
2018-01-04 01:14:36 +01:00
SpaceEEC
425efe1fe4 Consistently store message reactions keyed under their unicode (#1852) 2017-08-30 02:15:24 +02:00
SpaceEEC
56fe70266e Allow Message#edit to accept a RichEmbed and fixed RichEmbed#file's type (#1829) 2017-08-25 19:50:01 +02:00
SpaceEEC
1fe201ae90 Backporting, doc/bug fixes as well deprecation (#1826)
* Backporting, doc/bug fixes as well deprecation

* Adress issue with not resettable icons/images
2017-08-25 15:14:05 +02:00
Crawl
c7d1507e19 Docs cleanup 2017-08-20 22:08:37 +02:00
SpaceEEC
2611efe9c1 No longer double increment the reaction count when the client reacts (#1755) 2017-08-12 11:25:29 +02:00
Mythic
ddfa57e96d Improve Message's ID attribute documentation (#1450)
Remove the implication that a Message object's ID is unique only to the channel it was sent on
Message ID's are snowflakes, and as stated in Discord's API documentation, globally unique throughout Discord
2017-06-29 19:51:37 +01:00
vzwGrey
8e80b6660c Fix reaction collector example (#1513) 2017-05-21 21:15:23 +02:00
1Computer1
294f5ea5c8 Deprecate aliases (#1469) 2017-05-06 01:24:53 +02:00
Amish Shah
db45d99d0c More deprecated stuff 2017-05-01 11:28:48 +01:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
SpaceEEC
5b3e971c5c Message.editedTimestamp should be a number (#1402) 2017-04-22 16:54:48 +02:00
Will Nelson
ca34c43ba0 Add message reaction collectors & abstract collectors (#1335)
* message reaction collectors

* docs cleanup

* abstraction

* remove pointless method

* rename reaction collector creator method

* docs and stuff

* fix docs & build

* backwards compatibility, fix docs

* fix docs

* remove deprecated comments

* betterer docs again

* Fix documentation

* Fix Alias to not break depreciated code
2017-04-19 18:52:40 +02:00
Amish Shah
78895ace17 Fix reactions not being uncached once they hit a count of 0 2017-04-12 21:22:08 +01:00
bdistin
9365272baf Fix embeds getting converted to collection on edgecase (#1356) 2017-04-10 14:30:06 -04:00
SpaceEEC
e60d2bd175 Fix MessageMentions properties always being null or empty (#1357) 2017-04-10 20:06:00 +02:00
Schuyler Cebulskie
fa016b6b41 Clean up Message#mentions and message updates 2017-04-10 03:01:50 -04:00
bdistin
bca101aac8 Fix for #1089 & Message Reactions (#1236)
* [requires more testing] Fix #1089

* Clean up unshift

* Remove <Message>.patch(data)

Nothing calls this method any longer. It is also a private method, so this shouldn't be a breaking change.

* Fix Message Reactions

Purposely reference previous reaction collections, so collection is consistant accross all message edits (no unnecisary data duplication). Makes #1221 extranious.

* Some Data Packets come Incomplete

And several properties can be falsy, so instead of || opted for hasOwnProperty().

* No reason MessageTypes should be an object...

* Use `prop in obj` isntead of hasOwnProp

per @Gawdl3y
2017-04-01 01:51:12 -04:00
Schuyler Cebulskie
c73b9483f4 Clean up and add comments 2017-03-22 01:16:30 -04:00
Schuyler Cebulskie
cff7069275 Switch from for..of to forEach 2017-03-22 01:12:46 -04:00
Drahcirius
8444f19662 Added mentions.members (#1271)
* Added mentions.members

* made member.mentions undefined on when not on guild channel

* changed property to getter

* Update Message.js
2017-03-22 01:08:25 -04:00
Gus Caplan
94062d19dd Add message/channel/guild acknowledging (#1239)
* add acking

* 👀

* Update RESTMethods.js

* Update TextBasedChannel.js

* Update RESTMethods.js

* Update Guild.js

* Update TextBasedChannel.js

* Update Message.js

* super shitty names

* Update GroupDMChannel.js

* Update DMChannel.js

* Update TextChannel.js
2017-03-16 09:38:12 -04:00
Crawl
4ef0ec491c Add arrow-parens eslint rule & fix inconsistencies 2017-03-13 15:56:00 +01:00
Schuyler Cebulskie
16fe48d405 Overhaul Permissions utilities (EvaluatedPermissions no more) 2017-03-06 02:22:42 -05:00
Programmix
a029999b09 Doc fixes, mostly pertaining to Snowflakes (#1218)
GUS!!!! @GusCaplan
2017-02-24 15:33:51 -05:00
Kelvin Wu
d870b27ece Message#member should be a nullable. (#1205) 2017-02-21 13:49:20 -05:00
Schuyler Cebulskie
7232531eb1 Move all util methods into class
Remove TransformMessageOptions altogether
2017-02-15 22:25:18 -05:00
Programmix
5059c59a31 Message patching: clear mention collections (#1138)
* Message patching: clear mention collections

Fixes #1089
When discord sends an array of mentions, it is a full list of mentions -- therefore, we should clear the old mention collection. The same goes for when we re-analyze the message for channel mentions.

* Use Collection.clear() instead of new Collection
2017-01-29 19:02:54 +00:00
Programmix
ba11f76284 Fix patching message reactions (fixes #1071) (#1137) 2017-01-26 21:20:40 +00:00
Hackzzila
f8b9bf6884 Fix reaction events (#1105)
* Fix reaction events

* Made it better

* one line ftw
2017-01-16 22:52:25 +00:00
Schuyler Cebulskie
5caa7df1d8 Add centralised reply option to message options 2017-01-10 19:25:05 -05:00
Gus Caplan
42527ea969 fix message#isMemberMentioned (#1061)
* fix this

* e

* Update Message.js
2017-01-07 03:38:23 -05:00
Gus Caplan
495264761c Add snowflake utils (#1064)
* snowflakes

* use proper binary for snowflake example

* fix jsdoc errors

* remove dupe
2017-01-05 15:41:42 +00:00
Gus Caplan
7cbe81e71a fix editing with an array (#1059)
* fix editing with an array

* fix build

* put this back because reasons

* i'm having one of those nights
2017-01-03 06:59:34 +00:00
Michael Huang
3b9b06227e Fix _removeReaction's reaction lookup (#1045)
* Fix _removeReaction's `this.reactions` lookup

* Use emoji.identifier for reaction collection keys
2016-12-30 21:06:05 -05:00
Gus Caplan
beffb390e6 Add search (#1043)
* add search

* Update ClientDataResolver.js
2016-12-30 02:44:19 -05:00
Schuyler Cebulskie
ba77e69edf Document boolean for code option 2016-12-29 10:51:05 -05:00
Gus Caplan
ed8fcf651a Centralise message sending logic in one method, remove sendTTSMessage, add client shortcut in RESTMethods (#1031)
* start wip rewrite of sending/editing messages

* pass the build, modify the edit method to fit the new system

* simplify the applyToClass method

* change handling of file options

* add back message splitting

* i couldn't help myself

* add some smart message options

* clean up, add sexy options

* fix indentation

* fix up splitting

* add \b

* add back old methods for hydar happiness

* clean up more

* move code handling to the rest method

* clean up this.rest.client

* Update TextBasedChannel.js

* add docs back for the bad methods

* fix reply in group dms

* srsly gawdl3y

* make code better

* fix changes for gawdl3y

* fix checking

* remove getter

* make code handling more robust

* k

* fix up sendEmbed docs

* stupid

* fix up more docs because aaaaa

* no more pls
2016-12-28 23:58:30 -05:00
Schuyler Cebulskie
977e29ceba 👏 @Programmix 2016-12-04 20:25:24 -05:00
Programmix
8b7ef0c850 Add Message.fetchWebhook (#947)
* Add Message.fetchWebhook

* Update Message.js
2016-12-02 22:59:44 -05:00