I want an embed sent to a webhook when a module is required.
The webhook sends just fine, however, the image that I try to send doesn’t load. I’ve checked to make sure that it isn’t my internet; it isn’t.
I’ve looked on the developer hub and found Imgur.
Module Code
return function()
local Configuration = {
{
Log = "Server Shutdown",
},
}
local WebhookMessage = {
["username"] = "Game Shutdown",
["avatar_url"] = "",
["content"] = "this would ping everyone but i had to remove it so it doesnt spam ping everyone 500 times",
["embeds"] = {{
["title"] = "Server has shutdown!",
["description"] = "**Our server has shutdown due to an update or fix.**\n\nStuck? Follow these steps below:\n\n1.Take a screenshot of your screen before you did anything.\n2. Send that screnshot to [here](https://discordapp.com/channels/1131955683974184980/1198490658298679296)\n3. Click the play button on the games' page again\n\nThen you're done!",
["type"] = "rich",
["color"] = tonumber(0xffffff),
["image"] = {
["url"] = 'https://imgur.com/XFssN5k',
["height"] = 11,
["width"] = 11,
}
},
}
}
local JSONTable = game.HttpService:JSONEncode(WebhookMessage)
task.delay(.5,function()
game.HttpService:PostAsync('webhook', JSONTable)
end)
end
ServerScript Code
revoked = {}
local function RunningOn(runservice:RunService)
if runservice:IsStudio() then
return 'Studio'
elseif runservice:IsClient() then
return 'Client'
elseif runservice:IsServer() then
return 'Server'
end
end
local log = require(script.Logging)
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(m)
local prefix = "!"
local new,ret
local split = m:split(prefix)
local cmd = split[2]
local args = m:split(" ")
if player:GetRankInGroup(32637334) > 251 and not table.find(revoked,player.UserId) then
if cmd == 'softshutdown' then
local Suceess,ErroRet = pcall(function()
for a,b in next,game.Players:GetPlayers() do
local ui = script.SoftShutdown:Clone()
ui.Parent = b.PlayerGui
ui.LocalScript.Enabled = true
local misc=require(script.Misc)
misc()
task.wait(5)
new,ret = pcall(function()
game["Teleport Service"]:Teleport(game.PlaceId,b,nil,nil)
end)
end
end)
task.wait(6)
if (Suceess) then
if (new) then
log(player,RunningOn(game:GetService("RunService")),m,tostring(Suceess),tostring(ret))
elseif not (new) then
log(player,RunningOn(game:GetService("RunService")),m,tostring(Suceess),tostring(ret))
end
elseif not (Suceess) then
if (new) then
log(player,RunningOn(game:GetService("RunService")),m,tostring(ErroRet),tostring(ret))
elseif not (new) then
log(player,RunningOn(game:GetService("RunService")),m,tostring(ErroRet),tostring(ret))
end
end
elseif cmd == 'lockdownstart' then
task.wait(.1)
game.ReplicatedStorage.Lockdown.Start:FireAllClients(true)
log(player,RunningOn(game:GetService("RunService")),m,nil,nil)
elseif cmd == 'lockdownend' then
task.wait(.1)
game.ReplicatedStorage.Lockdown.Start:FireAllClients(false)
log(player,RunningOn(game:GetService("RunService")),m,nil,nil)
end
end
end)
end)
-- Player, RunningOn, M, Result, Result
Please note that the webhook was removed and replaced with ‘webhook’. The webhook is not the problem.
Here is what the embed currently looks like: