1.3.0
✨ What's new?
Major changes
- Message behavior, introducing acknowledgement & followups.
Messages created with a Message component are no longer independent and are replying to specific messages defined thanks to Message Originals, making things smoother, and more intuitive. - Message Originals: Message#isOriginal, getOriginal, deleteOriginal, getOriginals, originals, making huge behavior changes to Original methods. Learn more.
- Client REST methods listed as DEPRECATED (these methods are going to be removed on the next update), making a difference between cache methods and REST methods that are already available under Client#rest and are well organized for you.
- Message#attachmentURLs, enabling you to get an array of embedded content attached to the message
- Message#getAttachments, get an array of
MessageAttachment
including a wide range of information on embedded content attached to the message. - Caching app-created messages, making Message Originals work with sent messages using REST, and make you able to retrieve data that may be useful to you.
- Webhook execution support.
- Typing provider library partially using OpenAPI for more accurate and up-to-date typings.
- Bringing more consistency in type interfaces, and more.
- Renamed a bunch of structure classes such as GuildCategory, GuildRole, etc..
- Ported TouchGuild to TypeScript 5.0+
Resolved issues:
- Cannot remove user reactions (missing query)
- Client#editMessage replica
newMessage
property having typeobject
instead ofEditMessageOptions
- Message Constructor having
params?
property set to{ originalMessageID?: string | null; }
instead ofMessageConstructorParams
- EditMessageOptions:
replyMessageIds
,isSilent
,isPrivate
properties being present, however cannot be set. - Message#edit having a custom type instead of globalized
EditMessageOptions
. - Web socket reconnection attempt variable:
currReconnectAttempt
being reset at each attempt. - Session not being invalidated appropriately.
- AppUser (previously UserClient) undefined on "ready" event trigger (Client#user).
- REST/Channels#editMessage
params
property having typeobject
instead ofMessageConstructorParams
. - REST/Channels#getMessage
params
property having typeobject
instead ofMessageConstructorParams
. - Fixed REST route usage not working properly and being ignored.
- Fixed typing issues after updating the typing provider library.
Additions
General
- Add REST Mode, enabling you to perform requests without connecting to the gateway.
- Add
targetUserID?: "@me" | string
parameter to REST/Channels#deleteReaction, so you can target which user to remove the reaction from. - Add
MessageConstructorParams
, locating a wide range of Constructor parameters, including Originals. - Add the ability to set if the Web socket has to reconnect on connection loss or not using
wsReconnect
on Client constructor initialization. - Add type interface
MessageAttachment
- Add
deprecations
type into Client constructor parameters, making you able to revert to previous behaviors (independentMessageBehavior
), we do not recommend it, as it'll be removed sooner or later. - Grouping typings into an index.
- Ignore /lib path to make the library even more lightweight while maintaining TypeScript/JavaScript: CommonJS, ES compatibility.
Message
- createFollowup (can only be used if the message has been acknowledged),
- createMessage behavior, cannot be used after message is acknowledged.
- isOriginal, a property that is either set to "trigger", "response" or
false
. - acknowledged property
- getOriginal, deleteOriginal & getOriginals completing the Original methods.
- editFollowup, deleteFollowup
- Changed Message#bot -> app
- attachmentURLs – Get an Array of embedded attachment URLs
- getAttachments – Get an Array of
MessageAtachment
- Embeds are having more consistent types! Utility tools such as embedsToParsed and embedsToRaw have been added internally to enable this.
Webhook
- executeWebhook
- requestToken – Request the Webhook token if not defined, sets it automatically and returns the value.
- REST/Webhooks dedicated to Webhook methods such as create, edit, delete and execute.
WebhookExecuteOptions
,WebhookMessageDetails
type interfaces.
Modifications
General
- Methods are now sorted in alphabetically (internally).
- Removed: calendarEventComment.d.ts
- Removed: channel.d.ts
- Removed: doc.d.ts
- Removed: docComment.d.ts
- Removed: forumThread.d.ts
- Removed: calendarEvent.d.tss
- Improved JSDocs
- Each API types are having their Raw version for consistency.
- Renamed GuildSubscription to Subscription
- Renamed GuildRole to Role
- Renamed GuildGroup to Group
- Renamed GuildCategory to Category
- Renamed CalendarEventComment to CalendarComment
- UserTypes: app, user instead of bot, user. (added RawUserTypes as well)
- webhookCreate (REST/Guilds) -> create (REST/Webhooks)
- webhookEdit (REST/Guilds) -> edit (REST/Webhooks)
- webhookDelete (REST/Guilds) -> delete (REST/Webhooks)
- Moved editChannel & deleteChannel to REST/Channels and renamed them edit and delete.
- UserClient -> AppUser
- Renamed
MessageEmbedOptions
toEmbed
as opposed toRawEmbed
- Message#replyMessageIds -> replyMessageIDs
- Message#hiddenLinkPreviewUrls -> hiddenLinkPreviewURLs
Typings (consistency)
- RawChannel
- RawAnnouncement
- RawAnnouncementComment
- RawAnnouncementCommentReaction
- RawCalendarEvent
- RawCalendarRSVP
- RawCalendarComment
- RawCalendarCommentReaction
- CalendarRSVPStatus
- RawMessage
- RawForumThread
- RawPartialForumThread
- RawForumThreadReaction
- RawForumThreadComment
- RawForumThreadCommentReaction
- RawDoc
- RawDocComment
- RawDocCommentReaction
- RawListItem
- RawPartialListItem
- RawListItemNote
- RawPartialListItemNote
- RawGuild
- RawGroup
- RawCategory
- RawMember
- RawMemberBan
- RawPartialMember
- RawRole
- RawSubscription
- RawUser
- RawPartialUser
- RawAppUser
- RawEmbed
- RawMentions
- RawEmote
- RawSocialLink
and way more..
Contributors:
- Wade (@pakkographic)
Full Changelog: 1.2.5...1.3.0