1.0.1 • Published 4 years ago

@moskalyka/discord-webhook v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Xeus Discord-Webhook

Xeus Discord-Webhook is an SDK for the Discord Webhook api

Installation

Use the package manager npm to install discord-webhookr.

npm i @moskalyka/discord-webhook

Example

const Discord_Webhook = require('@moskalyka/discord-webhook')
const Instance = new Discord_Webhook.Client('id', 'token')
Instance.createWebhook({
    "content": "this `supports` __a__ **subset** *of* ~~markdown~~ 😃 ```js\nfunction foo(bar) {\n  console.log(bar);\n}\n\nfoo(1);```",
    "embeds": [{
        "title": "title ~~(did you know you can have markdown here too?)~~",
        "description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
        "url": "https://discordapp.com",
        "color": 5793266,
        "timestamp": "2021-06-23T22:41:43.908Z",
        "footer": {
            "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
            "text": "footer text"
        },
        "thumbnail": {
            "url": "https://cdn.discordapp.com/embed/avatars/0.png"
        },
        "image": {
            "url": "https://cdn.discordapp.com/embed/avatars/0.png"
        },
        "author": {
            "name": "author name",
            "url": "https://discordapp.com",
            "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
        },
        "fields": [
            {
                "name": "🤔",
                "value": "some of these properties have certain limits..."
            },
            {
                "name": "😱",
                "value": "try exceeding some of them!"
            },
            {
                "name": "🙄",
                "value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
            },
            {
                "name": "<:thonkang:219069250692841473>",
                "value": "these last two",
                "inline": true
            },
            {
                "name": "<:thonkang:219069250692841473>",
                "value": "are inline fields",
                "inline": true
            }
        ]
    }]
})

Render

render

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.1

4 years ago

1.0.0

4 years ago