Changing a webhook script to a different style

Hey, I do not have a lot of experience with webhooks. I am using Basic Admin essentials and also using the webhook module script. It is set up to change the Webhooks name to the player that used the command, and then the text, what the command was used.

image

Instead of this I want to make it into a Embedded, the title would be ‘admin logs’ and it would have text in the embedded, ‘Players name that used the command’ below that, ‘Command that was used.’
Like this:

image

Basically I’m wondering what I would have to change in order to make it an embedded and not ruin the code.

I have looked through a lot of stuff but I have not been able to find an answer. This is the code I have so far:

--[[ 
	
	 ____                                   
	/\  _`\                    __           
	\ \ \L\ \     __      ____/\_\    ___   
	 \ \  _ <'  /'__`\   /',__\/\ \  /'___\ 
	  \ \ \L\ \/\ \L\.\_/\__, `\ \ \/\ \__/ 
	   \ \____/\ \__/.\_\/\____/\ \_\ \____\
	    \/___/  \/__/\/_/\/___/  \/_/\/____/
	                                        
	Place this ModuleScript in the Plugins folder for
	Basic Admin Essentials 2.0	       
	
	Types of Logs:
	Admin Logs
	Kick Logs
	Ban Logs
	Shutdown Logs
	Exploit Logs
	Chat Logs 
	
--]]

local Plugin = function(...)
	local Data = {...}
	
	local returnPermissions = Data[1][3]
	local pluginEvent = Data[1][9]
	
	local tostring = tostring
	local httpService = game:GetService('HttpService')
		
	local Configuration = {
		{
			Log = "Admin Logs",
			Webhook_Url = "",
		},
	}
	
	pluginEvent.Event:connect(function(Type,Data)
		for _,Config in next,Configuration do
			if Type == Config.Log then
				local Succ,Msg
				repeat
					Succ,Msg = pcall(function()
						local Table = {}
						Table['username'] = (Data[1].Name or Data[1])
						Table['content'] = (Data[2] or "nil")
						
						local JSONTable = httpService:JSONEncode(Table)
						httpService:PostAsync(Config.Webhook_Url, JSONTable)
					end)
					wait(1)
				until Succ and not Msg
			end
		end
	end)

	return
end

return Plugin

You can change code, it’s not will does not break the script

How do you make a discord webhook send an embed message? - #3 by PeZsmistic?

I am not sure how I would go about to change it. I am not very good with webhooks. Would I change Local Table?

You can use special websites for create your own embed message,
There’s a lot of on internet, just search for “Discord embed generator JSON” and use it. You should change table named “Table”. If you trust yourself, delete it. And watch some Roblox discord embed tutorials from internet for use them correctly.

I mean yes you should change local Table.

Thanks for the help I’ve looked through some stuff and have been able to get the general idea of it into my head. I appreciate the help!

1 Like