Skip to content

Send messages to your Discord channel via webhooks.

License

Notifications You must be signed in to change notification settings

lumpn/unity-discord

Repository files navigation

unity-discord

Send messages to your Discord channel via webhooks.

Installation

Download the entire repository from https://github.com/lumpn/unity-discord and use Unity's built in package manager to Add package from disk.

Usage

public WebhookData webhookData;

IEnumerator Start()
{
    var webhook = webhookData.CreateWebhook();
    return webhook.Send("Hello, World!");
}

Creating a webhook

Follow Discord's guide to creating a webhook in Discord, then copy the webhook URL, create a WebhookData asset, and paste the webhook URL into the WebhookData asset.

Copy Webhook URL

Samples

Samples are included in the package. Install them via Unity's package manager.

public WebhookData webhookData;

IEnumerator Start()
{
  var embed = new Embed()
      .SetColor(color)
      .SetTitle(title)
      .SetAuthor(author, authorIconUrl)
      .SetDescription(description)
      .SetThumbnail(thumbnailUrl)
      .SetImage(MediaType.PNG, imageBytes)
      .SetFooter(footer, footerIconUrl);

  var webhook = webhookData.CreateWebhook();
  return webhook.Send(embed);
}

Unity Discord

About

Send messages to your Discord channel via webhooks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages