diff --git a/.npmignore b/.npmignore index bc78b64..b302b67 100644 --- a/.npmignore +++ b/.npmignore @@ -18,4 +18,6 @@ examples/ .npm-deprecaterc .npm-deprecaterc.json .eslintignore -.eslintrc.js \ No newline at end of file +.eslintrc.js +.npmrc +lib/ diff --git a/lib/structures/Message.ts b/lib/structures/Message.ts index fef9e0b..6b36f0c 100644 --- a/lib/structures/Message.ts +++ b/lib/structures/Message.ts @@ -20,7 +20,7 @@ import { AnyTextableChannel, CreateMessageOptions, EditMessageOptions, - MessageEmbedOptions, + Embed, RawMessage, RawEmbed, RawMentions @@ -430,7 +430,7 @@ export class Message extends Base { /** Edit the last message sent with the message itself. * @param newMessage New message's options. */ - async editLast(newMessage: {content?: string; embeds?: Array;}): Promise>{ + async editLast(newMessage: {content?: string; embeds?: Array;}): Promise>{ if (!this._lastMessageID) throw new TypeError("Cannot edit last message if it does not exist."); return this.client.rest.channels.editMessage( this.channelID, @@ -444,7 +444,7 @@ export class Message extends Base { async editOriginal( newMessage: { content?: string; - embeds?: Array; + embeds?: Array; } ): Promise>{ if (!this.originals.responseID || this.isOriginal) diff --git a/lib/types/channels.d.ts b/lib/types/channels.d.ts index 1a79c72..9ab9f07 100644 --- a/lib/types/channels.d.ts +++ b/lib/types/channels.d.ts @@ -91,7 +91,7 @@ export interface CreateMessageOptions { * (min items 1; must have unique items true) */ hiddenLinkPreviewURLs?: Array; /** Embeds */ - embeds?: Array; + embeds?: Array; /** Message IDs to reply to (min items 1; max items 5) */ replyMessageIDs?: Array; /** If set, this message will not notify any mentioned users or roles (default `false`) */ @@ -107,7 +107,7 @@ export interface EditMessageOptions { * (min items 1; must have unique items true) */ hiddenLinkPreviewURLs?: Array; /** Embeds */ - embeds?: Array; + embeds?: Array; // /** Message IDs to reply to (min items 1; max items 5) */ // replyMessageIds?: Array; // /** If set, this message will not notify any mentioned users or roles (default `false`) */ @@ -116,7 +116,7 @@ export interface EditMessageOptions { // isPrivate?: boolean; } -export interface MessageEmbedOptions { +export interface Embed { /** Main header of the embed (max length 256) */ title?: string; /** Subtext of the embed (max length 2048) */ diff --git a/lib/types/webhooks.d.ts b/lib/types/webhooks.d.ts index 155e90a..8d695ba 100644 --- a/lib/types/webhooks.d.ts +++ b/lib/types/webhooks.d.ts @@ -4,7 +4,7 @@ // Copyright (c) 2024 DinographicPixels. All rights reserved. // -import { MessageEmbedOptions } from "./channels"; +import { Embed } from "./channels"; export interface WebhookEditOptions { /** New name of the webhook. */ @@ -24,7 +24,7 @@ export interface WebhookExecuteOptions { content?: string; username?: string; avatarURL?: string; - embeds?: Array; + embeds?: Array; } export interface WebhookMessageDetails { diff --git a/lib/util/Util.ts b/lib/util/Util.ts index b44a789..9c00bcd 100644 --- a/lib/util/Util.ts +++ b/lib/util/Util.ts @@ -10,7 +10,7 @@ import { Member } from "../structures/Member"; import { AnyChannel, AnyTextableChannel, - MessageEmbedOptions, + Embed, MessageConstructorParams, RawUser, RawMember, @@ -42,7 +42,7 @@ export class Util { this.#client = client; } - embedsToParsed(embeds: Array): Array { + embedsToParsed(embeds: Array): Array { return embeds.map(embed => ({ author: embed.author === undefined ? undefined : { name: embed.author.name, @@ -70,7 +70,7 @@ export class Util { url: embed.url })); } - embedsToRaw(embeds: Array): Array { + embedsToRaw(embeds: Array): Array { return embeds.map(embed => ({ author: embed.author === undefined ? undefined : { name: embed.author.name, diff --git a/package.json b/package.json index 5c089a3..897cbb0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "touchguild", "version": "1.2.5", - "description": "TouchGuild is a NodeJS library for interfacing with Guilded.", + "description": "TouchGuild, a NodeJS library for interfacing with Guilded.", "main": "./dist/lib/index.js", "types": "./dist/lib/index.d.ts", "module": "./dist/lib/index.mjs",