simple-discord-webhooks

Very simple package to send, edit and delete Discord Webhook Messages

Usage no npm install needed!

<script type="module">
  import simpleDiscordWebhooks from 'https://cdn.skypack.dev/simple-discord-webhooks';
</script>

README

simple-discord-webhooks

npm package stats

♥ Sponsor or ★ Star

Features

  • Send webhook messages
  • Edit webhook messages
  • Delete webhook messages
  • Fetch webhook messages
  • Delete and edit webhooks
  • Support for custom avatarUrl and username per message
  • Support for Embed-Objects
  • Support for Allowed-Mentions-Object
  • Support for Message-Component-Object. ⚠ This will only work, if your webhook is owned by an application.

Install from NPM

$ npm i simple-discord-webhooks --save

Changelog

You can find the changelog here.

Example Usage

const {Webhook} = require('simple-discord-webhooks');

const webhook = new Webhook('https://discord.com/api/webhooks/820304489637871657/QPZWXNS6wUsQ7iKA-Sm7YDIODCbxk60WNeRDoPtEOxZaMvlqbrM_1LQ_LVZHMNhbdz6N');

webhook.send('This message should get edited (hopefully) soon').then(async (result) => {
    setTimeout(async () => {
        await result.edit('And should get deleted (hopefully) soon');
        console.log('Successfully edited send message!');
    }, 3000);
    setTimeout(async () => {
        await result.delete();
        console.log('Successfully deleted send message!');
    }, 6000);
});

const message = webhook.resolveMessageID('820311219432194068');
message.edit('Hello there!').then(() => console.log('Edited message'))

API

Please refer to the online documentation.

Questions or suggestions?

Please create a discussion on Github.

Contributing

Feel free to create any issues and PRs in our github repository if you want to contribute.

© Simon Csaba, 22021 | mail[at]scderox.de