Basic Admin Essentials | Making a pmlogs command

Hi everyone! I’m trying to make a pmlogs command on Basic Admin Essentials 2.0. What I want is that when a person says :pmlogs as the command in Basic Admin, a panel shows up and shows all the replies and messages that were done in pms. a example would be like “[user] privately messaged [user] with content:”

I have no idea on how I could achieve this so I’d need your help.

2 Likes
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 = "PMLogs",
			Webhook_Url = "INSERT WEBHOOK HERE",
		},
	}
	
	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

So I need help connecting this to pmlogs.

1 Like

So your code seems fine, I’m assuming you used a normal discord webhook link? Roblox doesn’t allow normal discord webhook links, so you’d have to use a proxy which would do it for you.
You can use this instead:
https://webhook.lewisakura.moe/api/webhooks/FIRSTPARTOFWEBHOOK/SECONDPARTOFWEBHOOK/queue