Do you know how to implement the queue into @LuaScape 's V3 module? @lewisakura
I’ve tried using the code from here WebhookProxy | Discord webhooks go brrrrrrr - #42 by LewisTehMinerz
Within V3, but CJ’s code does not divide the webhook URL into smaller parts.
I got a group using the proxy, and since I can’t get CJ’s error logging module to support queue, it manages to get the webhook ratelimited.
Also, is there a way I can remove the ratelimit from a webhook, if it calms down on the sending?
Or is that putting it into a perm block?
Summary
--[[WARNING!!! MAKE SURE THIS MODULE IS IN SERVER STORAGE OR SERVER SCRIPT SERVICE]]
-- This module was created by LuaScape (Roblox: Snawrk)
-- Proxy Created By LewisTehMinerz
-- DO NOT Edit the code below unless you know what you're doing!
---------------------------------------------------------------------------------------
local webhookService = {}
local https = game:GetService("HttpService")
function webhookService:createMessage(url, message : string)
local data = {
["content"] = message
}
local finalData = https:JSONEncode(data)
local finalUrl = string.gsub(url, "discord.com", "webhook.lewistehminerz.dev")
local finalBackupUrl = string.gsub(url, "discord.com", "webhook.newstargeted.com")
local good, bad = pcall(function()
https:PostAsync(finalUrl, finalData)
end)
if good then
print("Webhook Request Success!")
else
print("Webhook Request Failed " .. bad .. " Trying backup URL")
https:PostAsync(finalBackupUrl, finalData)
print("Attempted request with backup URL, if webhook does not send then both URLS are down or you have a bad request.")
end
end
function webhookService:createEmbed(url, title : string, message :string , fields, image)
local data = {
['content'] = "",
['embeds'] = {{
["image"] = {["url"] = image},
['title'] = "**"..title.."**",
['description'] = message,
['type'] = "rich",
["color"] = tonumber(0xffffff),
['fields'] = fields
},
},
}
local finalData = https:JSONEncode(data)
local finalUrl = string.gsub(url, "discord.com", "webhook.lewistehminerz.dev")
local finalBackupUrl = string.gsub(url, "discord.com", "webhook.newstargeted.com")
local good, bad = pcall(function()
https:PostAsync(finalUrl, finalData)
end)
if good then
print("Webhook Request Success!")
else
print("Webhook Request Failed " .. bad .. " Trying backup URL")
https:PostAsync(finalBackupUrl, finalData)
print("Attempted request with backup URL, if webhook does not send then both URLS are down or you have a bad request.")
end
end
function webhookService:createAuthorEmbed(url, authorName : string, iconurl, description : string, fields)
local data = {
["embeds"] = {{
["author"] = {
["name"] = authorName,
["icon_url"] = iconurl,
},
["description"] = description,
["color"] = tonumber(0xFFFAFA),
["fields"] = fields
}},
}
local finalData = https:JSONEncode(data)
local finalUrl = string.gsub(url, "discord.com", "webhook.lewistehminerz.dev")
local finalBackupUrl = string.gsub(url, "discord.com", "webhook.newstargeted.com")
local good, bad = pcall(function()
https:PostAsync(finalUrl, finalData)
end)
if good then
print("Webhook Request Success!")
else
print("Webhook Request Failed " .. bad .. " Trying backup URL")
https:PostAsync(finalBackupUrl, finalData)
print("Attempted request with backup URL, if webhook does not send then both URLS are down or you have a bad request.")
end
end
return webhookService