Skip to content
Quick & easy Discord webhook runner for Lua
Lua
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lefthook
rockspec
LICENSE
README.md
lefthook-scm-1.rockspec

README.md

Lefthook

LuaRocks GitHub

Lefthook is a library for quickly running Discord Webhooks.

Installation

Lefthook is available as a rock from luarocks:

$ luarocks install lefthook

Examples

Getting a webhook running is as simple as three lines of code:

require("lefthook.static");
local hook = Webhook.new("webhook id", "webhook token"); -- Format of the url is /api/webhooks/<id>/<token>
hook:sendMessage("Hello, world!");

You can also add rich-content embeds to your webhooks:

require("lefthook.static");
local hook = Webhook.new("webhook id", "webhook token");
local form = WebhookForm.new();
local embed = Embed.new("Cool title", "Cool description!", "https://www.example.com", 0x00FF00);
embed:setFooter("Cool footer!");
embed:setTimestamp(os.time()); -- accepts any UNIX timestamp
form:addEmbed(embed);
hook:execute(form);
You can’t perform that action at this time.