@rbxts/discord-webhook
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

@rbxts/discord-webhook

A wrapper around Discord's webhook API to send messages from within Roblox.

Example usage:

import { DiscordWebhook, DiscordEmbed } from '@rbxts/discord-webhook';

const webhook = new DiscordWebhook('YOUR_WEBHOOK_URL_HERE');

const embed = new DiscordEmbed()
	.setTitle('Example Embed')
	.setDescription('Hello, world!')
	.addField('Inline Field', 'Foo', true)
	.addField('Generic Field', 'Bar')
	.setColor(Color3.fromRGB(46, 204, 113));

webhook.send(embed);

Advanced usage:

import { DiscordWebhook, DiscordEmbed, DiscordMessage } from '@rbxts/discord-webhook';

const webhook = new DiscordWebhook('YOUR_WEBHOOK_URL_HERE');

const embedA = new DiscordEmbed()
	.setTitle('Example Embed')
	.setDescription('Hello, world!')
	.addField('Inline Field', 'Foo', true)
	.addField('Generic Field', 'Bar')
	.setColor(Color3.fromRGB(46, 204, 113));
const embedB = new DiscordEmbed()
	.setTitle('Other Embed')
	.setDescription('Hello, world!')
	.addField('Inline Field', 'Foo', true)
	.addField('Generic Field', 'Bar')
	.setColor(Color3.fromRGB(46, 204, 113))
	.setAuthor({
		name: 'builderman'
	});

const message = new DiscordMessage('Below are some embeds:')
	.addEmbed(embedA)
	.addEmbed(embedB);

webhook.send(message);

Readme

Keywords

none

Package Sidebar

Install

npm i @rbxts/discord-webhook

Weekly Downloads

0

Version

1.1.2

License

Unlicense

Unpacked Size

15.3 kB

Total Files

11

Last publish

Collaborators

  • xethlyx