Hey.
I’m LuaHook and for the past couple hours I have been working on a module for simplifying Discord webhooks called EasyHook!
Why use it?
- Built-in ratelimit handling
- Configure custom proxy via constructor
- Simple API
Due to the projects simplicity, I will not be providing documentation. You can may infer it’s usage through the examples below.
local EasyHook = require(script["EasyHook"])
local Players = game:GetService("Players")
-- the webhook to use when sending
local WEBHOOK_URL = ""
Players.PlayerAdded:Connect(function(plr)
-- the function below takes one parameter (optionally two)
-- 1: the webhook url (in full form)
-- 2: proxy to use (optional: by default is "https://hooks.hyra.io")
local webhook = EasyHook:Create(WEBHOOK_URL)
-- webhook:Content -- takes a string which will be sent as the message in Discord
-- webhook:Username - takes a string which will be used as the webhooks username
-- webhook:Avatar - takes a string which will be used as a url that is sent to Discord for the webhook avatar
-- webhook:TTS - no params, when called it turns message into tts one
webhook:Content("Hello from GameId ``" .. game.GameId .. "``!")
webhook:Username("Our game")
local ourEmbed = webhook:Embed()
ourEmbed:Now() -- gives our embed the timestamp of now in discord
ourEmbed:Color("#00ff47") -- takes either a number or a string (0xffffff or "#ffffff")
ourEmbed:Title("A Player Joined")
ourEmbed:Description("``" .. plr.Name .. "`` has joined our experience")
ourEmbed:Author("LuaHook") -- takes a name but can also take a url and icon_url
-- ourEmbed:Footer() -- takes text but also can take icon_url
-- ourEmbed:URL() -- takes a url
ourEmbed:Field("Account Age", tostring(plr.AccountAge)) -- takes a title, value and optionally whether its inline or not
-- ALWAYS WHEN DEALING WITH EMBEDS REMEMBER TO CALL :DONE()
ourEmbed:Done()
-- this function syncs the embed with the main webhook and allows it to be sent to Discord
-- call this function to send the webhook!
webhook:Send()
end)
What are you waiting for? Grab the module today.