Commander | Open Sourced Admin Panel

How do I make discord webhook logs for the admin panel

I want it to be “USERNAME: (Command Here)”

Please do not use Discord as a logging service.

1 Like

Why not?

I used it with admin panels and I want to use it for commander admin panel
I want to also change the admin to bind it with userid rather than usernames and I want to make bans and kicks say in chat “(username) has been Banned” or kicked.

I can’t help you code it now but I can give you a little tip.

If you use a webhook for logging commands or anything else then it’s very important that you use the Hyra proxy because it complies with the Discord TOS and won’t get you banned on Roblox.

And here is another link that could help you.

Using Discord as a logging service is against its Developer Terms of Service.

Take a look at this post for more details:

1 Like

I use a webhook proxy.

The proxy I use has a limit and stops it if it is going to break discord tos.

Do not worry on how I will do it, every time I attempt to do it it wont work, I do not know why,

We do not encourage users to violate other platforms’ ToS, this includes Roblox as well. No official support if ToS violation is involved.

It is not breaking any ToS of any platform.

You are breaking the Discord Developer Terms of Service by using Discord as a logging service, which is not its intended purpose.

There are rate limits in the proxy which prevent any discord tos from being broken.

Please can you help me have webhook logging and make the Admin Panel giving users admin via userid

Rate limits are not the only thing detailed in the Discord Terms of Service.

The proxy I use has been confirmed via a discord staff member, instead of worrying about me I just want to know how to make the panel give admin via userids instead of usernames as its
wont work if somene changes a username. I also want to add discord webhook logging.

??? It’s literally tells you in the settings.

module.admins = {
    [12312322] = "Moderator", -- user with User Id 12312322 will get Moderator,
}

I ain’t saying you shouldn’t… but there are better alternatives even if a “discord staff member” “confirmed” it.

I found this script on the community discord… replace this with the script in MainModule/systemPackages/Services/Waypoint. Just know I’m not sure if this works.

Script
local module = {}
local items = {}

local HttpService = game:GetService("HttpService")

local DISCORD_WEBHOOK_ID = ""
--replace discord.com with hooks.hyra.io due to discord banning ROBLOX requests

local function Retry(callback)
	local tries = 0
	local ok, msg = pcall(callback)
	
	if not ok then
		while tries < 3 do
			task.wait(5)
			
			ok, msg = pcall(callback)
			
			if ok then
				return;
			end
		end
	end
	
	warn("Couldn't send webhook:\n"..msg)
end

local function sendDiscordWebhook(Data)
	coroutine.wrap(function()
		Retry(function()
			HttpService:PostAsync(DISCORD_WEBHOOK_ID, HttpService:JSONEncode({
				embeds = {
					{
						title = "New command ran",
						description = `**{Data.Client}** @ {os.date("%x %H:%M", tonumber(Data.Timestamp))}: {Data.Action} • {Data.Attachments[1] or "all"}`,
						color = 5814783
					}
				},
			}))
		end)
	end)()
	
	return Data
end

function module.fetch()
	return items
end

function module.new(client: string, action: string, attachment)
	table.insert(items, sendDiscordWebhook {
		Client = client,
		Action = action,
		Attachments = attachment,
		Timestamp = os.time()
	})
end

return setmetatable({}, {
	__index = module,
	__metatable = "The metatable is locked",
	__newindex = function() error("Attempt to modify a readonly table", 2) end
})

2 Likes

I have joined the community discord, I do not know how to get the main module working (downloaded in the serverscripts as well) do I place it in the commander script or what do I do?

Yes. Replace the server script with

require(script.MainModule)(script.Settings, script.Packages, script.Stylesheets)

and add the main module in the script.

1 Like

It should work now… did you replace the Waypoint module?

??? whats the waypoint module???

Did you read my earlier post? No, I won’t try the heart button

hi,
why I cant download it anymore? it just gives bad request :frowning:

greats,
jopio0819