diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5cc37b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +## v1.1.0 (October 5, 2021) +* Added support for [`PATCH /webhooks/{webhook.id}/{webhook.token}` Discord-API-Call](https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token): You can now modify the username or avatar of your webhook user +* Added support for [`DELETE /webhooks/{webhook.id}/{webhook.token}` Discord-API-Call](https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token): You can now delete your webhook +* Added support for [`GET https://discord.com/developers/docs/resources/webhook#edit-webhook-message` Discord-API-Call](https://discord.com/developers/docs/resources/webhook#get-webhook-message): You can now fetch an already sent webhook message (including content) +* Added support for [Message-Component-Object](https://discord.com/developers/docs/interactions/message-components#component-object). ⚠ This will only work, if your webhook is owned by an application. + +## v1.0.1 (March 13, 2021)) +* Fixed bug: The module should *actually* work now. + +## v1.0.0 (March 13, 2021) +* 🚀 Initial commit \ No newline at end of file diff --git a/Message.js b/Message.js index 1c6068f..82767aa 100644 --- a/Message.js +++ b/Message.js @@ -19,11 +19,12 @@ class Message { return true; } - async edit(content, embeds = [], allowedMentions = {}) { + async edit(content, embeds = [], allowedMentions = {}, components = []) { const res = await centra(this.webhookUrl + `/messages/${this.id}`, 'PATCH').body({ content: content, embeds: embeds, - allowed_mentions: allowedMentions + allowed_mentions: allowedMentions, + components }) .header('Content-Type', 'application/json') .send('form'); diff --git a/README.md b/README.md index c179b54..8814d95 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,20 @@ * Send webhook messages * Edit webhook messages * Delete webhook messages -* Support for custom avatarUrl and username +* Fetch webhook messages +* Delete and edit webhooks +* Support for custom avatarUrl and username per message * Support for [Embed-Objects](https://discord.com/developers/docs/resources/channel#embed-object) * Support for [Allowed-Mentions-Object](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) +* Support for [Message-Component-Object](https://discord.com/developers/docs/interactions/message-components#component-object). ⚠ This will only work, if your webhook is owned by an application. # Install from [NPM](https://www.npmjs.com/package/simple-discord-webhooks) `$ npm i simple-discord-webhooks --save` +## Changelog +You can find the changelog [here](CHANGELOG.md). + # Example Usage ```js @@ -47,13 +53,25 @@ message.edit('Hello there!').then(() => console.log('Edited message')) * allowedMentions (object, optional): A [Allowed-Mentions-Object](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) * tts (boolean, optional): Set to `true` to enable TTS. + * components (array, optional): Array + of [message components](https://discord.com/developers/docs/interactions/message-components#component-object). + ⚠ This will only work, if your webhook is owned by an application. * Returns `Promise` (with all the values from [here](https://discord.com/developers/docs/resources/channel#message-object)) + * function `edit(name = null, base64Avatar = null)` - Edits the webhook object + * name (string, optional): New username of the webhook + * base64Avatar (base64String (string), optional): [Base64](https://en.wikipedia.org/wiki/Base64) -String of your + image. If you don't know how to use this, please google `Image to Base64 nodejs` or `File to Base 64` if you + have an image file. + * function `fetchMessage(id)` - Fetches a message. Includes content and all parameters returned by Discord. + * id(string): ID of a message send by this webhook + * Returns `Message` + * function `delete()` - Deletes the webhook. Use with caution. * function `resolveMessageID(messageID)` - Returns a MessageObject of a Message-ID * messageID(string): ID of a message send by this webhook * Returns `Message` * NOTE: You can only get a `Message`-Object with to edit and delete the message - You can not (!) get the - content of it. + content of it. Use `fetchMessage(id)` if you want to fetch content too. * Class: `Message(messageData, webhookurl)` * `messageData` (object) has to have a value called `id` with the id of the message in it @@ -65,16 +83,20 @@ message.edit('Hello there!').then(() => console.log('Edited message')) of [Embed-Objects](https://discord.com/developers/docs/resources/channel#embed-object) * allowedMentions (object, optional): A [Allowed-Mentions-Object](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) + * components (array, optional): Array + of [message components](https://discord.com/developers/docs/interactions/message-components#component-object). + ⚠ This will only work, if your webhook is owned by an application. + * Returns `Promise` (with all the values from [here](https://discord.com/developers/docs/resources/channel#message-object)) # Questions or suggestions? -Feel free to send me a DM on Discord: `SCDerox#4645` +Please create [a discussion](https://github.com/SCDerox/simple-discord-webhooks/discussions) on Github. # Contributing -Feel free to create any issues and PRs in our [github repository](https://github.com/SCDerox/simple-discord-webhooks) if you -want to contribute. +Feel free to create any issues and PRs in our [github repository](https://github.com/SCDerox/simple-discord-webhooks) if +you want to contribute. © Simon Csaba, 22021 | mail[at]scderox.de \ No newline at end of file diff --git a/Webhook.js b/Webhook.js index 7f1c298..1517f53 100644 --- a/Webhook.js +++ b/Webhook.js @@ -8,14 +8,15 @@ class Webhook { this.avatarUrl = avatarUrl; } - async send(content, embeds = [], allowedMentions = {}, tts = false) { + async send(content, embeds = [], allowedMentions = {}, tts = false, components = []) { const res = await centra(this.url + '?wait=true', 'POST').body({ content: content, username: this.username, avatar_url: this.avatarUrl, tts: tts, embeds: embeds, - allowed_mentions: allowedMentions + allowed_mentions: allowedMentions, + components }) .header('Content-Type', 'application/json') .send('form'); @@ -26,6 +27,37 @@ class Webhook { return new Message(JSON.parse(res.body.toString()), this.url); } + async edit(name = null, base64Avatar = null) { + const res = await centra(this.url, 'PATCH').body({ + name, + avatar: base64Avatar ? `data:image/jpeg;base64,${base64Avatar}` : null + }) + .header('Content-Type', 'application/json') + .send('form'); + if (res.statusCode !== 200) { + console.error(`Something went wrong while sending while sending the webhook ${this.url}. Here is the answer from discord: `, res.body.toString()); + return false; + } + } + + async delete() { + const res = await centra(this.url, 'DELETE').body().send('form'); + if (res.statusCode !== 204) { + console.error(`Something went wrong while sending while sending the webhook ${this.url}. Here is the answer from discord: `, res.body.toString()); + return false; + } + } + + async fetchMessage(id) { + const res = await centra(this.url + `/messages/${id}`, 'GET') + .send('form'); + if (res.statusCode !== 200) { + console.error(`Something went wrong while sending while sending the webhook ${this.url}. Here is the answer from discord: `, res.body.toString()); + return false; + } + return new Message(JSON.parse(res.body.toString()), this.url) + } + resolveMessageID(messageID) { // YOU CAN NOT GET ANY CONTENT OF A MESSAGE VIA THIS METHOD. YOU CAN *ONLY* USE THIS TO EDIT / DELETE ALREADY SEND MESSAGES return new Message({id: messageID}, this.url); } diff --git a/package-lock.json b/package-lock.json index 2d665c0..7ee6eec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,33 @@ { - "name": "discord-webhooks", - "version": "1.0.0", + "name": "simple-discord-webhooks", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.0.0", - "license": "ISC", + "name": "simple-discord-webhooks", + "version": "1.1.0", + "license": "MIT", "dependencies": { "@aero/centra": "^1.0.6" + }, + "devDependencies": { + "process": "^0.11.10" } }, "node_modules/@aero/centra": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@aero/centra/-/centra-1.0.6.tgz", "integrity": "sha512-e7sUh/VjugT8LsHb4/hcbmhaVVi9deWWPQnlMnU0RAnF8+iCdGdCcKvoHnDNl/ELykwjpbKpBYbWPx0yKZaDpw==" + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } } }, "dependencies": { @@ -22,6 +35,12 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@aero/centra/-/centra-1.0.6.tgz", "integrity": "sha512-e7sUh/VjugT8LsHb4/hcbmhaVVi9deWWPQnlMnU0RAnF8+iCdGdCcKvoHnDNl/ELykwjpbKpBYbWPx0yKZaDpw==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true } } } diff --git a/package.json b/package.json index a96e5dc..bcc82ec 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,17 @@ { "name": "simple-discord-webhooks", - "version": "1.0.1", + "version": "1.1.0", "main": "Webhook.js", "description": "Very simple package to send, edit and delete Discord Webhook Messages", "scripts": { "test": "node test/test.js" }, - "keywords": ["discord", "discord-webhook", "webhook", "webhooks"], + "keywords": [ + "discord", + "discord-webhook", + "webhook", + "webhooks" + ], "author": "SCDerox ", "license": "MIT", "homepage": "https://github.com/SCDerox/simple-discord-webhooks", @@ -23,4 +28,4 @@ "dependencies": { "@aero/centra": "^1.0.6" } -} +} \ No newline at end of file diff --git a/test/test.js b/test/test.js index a439b01..8ee5a09 100644 --- a/test/test.js +++ b/test/test.js @@ -1,13 +1,22 @@ const {Webhook} = require('../Webhook'); -const webhook = new Webhook('https://discord.com/api/webhooks/820304489637871657/QPZWXNS6wUsQ7iKA-Sm7YDIODCbxk60WNeRDoPtEOxZaMvlqbrM_1LQ_LVZHMNhbdz6N'); +const webhook = new Webhook(process.env.WEBHOOK_URL); + +webhook.fetchMessage('895006405122224169').then(m => { + console.log(m.content) +}) webhook.send('This message should get edited (hopefully) soon').then(async (result) => { + // return webhook.delete(); console.log('Successfully send new message!'); await webhook.resolveMessageID('820311219432194068').edit(`I got edited!`); console.log('Successfully resolved messageID and edited message!'); + // Use https://base64.guru/converter/encode/image or https://www.npmjs.com/package/filetobase64 (not tested) to generate a base64 string of a image + await webhook.edit('Hello', 'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAATxUlEQVRogY2ayY9lyXXefxE37vTumzKzqjJr7upmTyJbbAKkTXZLoheW5IVgSKDXGgAD9kqA4b/BC2/sjQ3/AQYMDwtrsGEIhiwvvCAk2iSbzaG71N2subryvXzTnW8MRsTLkqV2d1VF1UW+zHx5b5wT53znO9954u//vd9y2miwMAw9bd9ijaHvOuq6ZhgGptMpu92OKIro+x7nHE3XYoxBa41SKrz2v4uzlKEfEDIiVjFt16AixajIiaTl5Vff+tfHl678/nRy0Tocf2M5R5LlZOMCqVT4/ovWG6+9xD/8ve+gjNVoPYSH1m3NYDRqsHR9R9O2ZGkaDOnalrbrEAhUrMA69KBBSXa6xw2ayAmcFkgb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oiCMaft0II9UHDGYKu6WMw6KLOhsE1qcMGgdb/TBGrzOvoIan96fiBQ5o2iFHM++89YtdbnBpIhFckJMprRj4slQrv9WPZtu78VDHwpiQZMZ4cVOPi8NQ/02++NppNtQ25/Dw4VX5vXj4fjE8Md94oBNk29ATDsIervVLgiKIkXJ5DeQldihGxmPLeDx/yaLEJCOIbIM/IfXX3w5EoyMIiKNMBFOxepvZNlD/l8fTS/zTSnHkWvN6VxEnGi46cZOvx1M9u/JQ95I8MErn/3g/r/CmEEDrXQfeJLVFREn5u7UAUx2zKXXikH2o4KUI4hiGHZ41S+Nl10F8Tj3axb2i8aq08UDM7OK6Wm3JqQqCIZ6PoZw3ow5DYBkj0iOMnJ34nyg8xvM4s5Tkq7acwHq089HoDfMPiZ2R+sh8mNtZixP4UveTupRV/f219TbF0ztBbQ+s/CWA0jVYYNeH2zz/5vQ9v/+y9B/fv/0et9ZtSyviLYv7/CyH/f3A90nvWq87aBOAiTFpk+BoGFlYHODX+ZIRvgBxx7Gg7h9UyGN8LhzyfvNjzsAsz5QBr7GdmPkGFr+MC5QcqqRcPokQad/Phwwc3pZT/IM2zZT4a/fG4mP5JHMc/ds6tgKXwn2H4rAEinaJLrwzvva/7Icxxw0DTP9dL6mGI50iTLIyahG7pTY1zJmRLZ7qQL35AYjyvsnsH6H3qhwiVdh9WfoRmnQyOOJiMGTwp8Q7qOmbjIoRh33dHXd/+bl3XvyuIjFJqpZT6cDKZ/Vel1J9IKX/wdOYoRTGlivwNXZh/ea97eaQ95z5+417jt2FY7acpfrjW+IlzIG8+N7rOhf5ZWoWygsjnsHFI7VFX7KUFqQIF9kNyT5V9SFbbikSmoZf2zthst0Hin/qP2/iTDJ/HED42LzRV/c6DB3f+2fs//sGf3b378R/3ff+L/rb/F/mKrS0aCJxXAAAAAElFTkSuQmCC'); + console.log('Edited webhook info'); + setTimeout(async () => { await result.edit('And should get deleted (hopefully) soon'); console.log('Successfully edited send message!'); @@ -16,4 +25,4 @@ webhook.send('This message should get edited (hopefully) soon').then(async (resu await result.delete(); console.log('Successfully deleted send message!'); }, 6000); -}); +}); \ No newline at end of file