LogModule - makes logs with Discord Webhook(s)

LogModule

Github | Roblox

Please read the post before commenting.

Hello everyone, i have been working on this module around 1 - 2 months. I’ve made several unsuccessful modules but this is the one that got me this far.

LogModule Will help you keep track of stuff happening in game, you can customize it as you wanted.

LogModuleTest

How to use:

How to use

Before you start you need to turn on Allow HTTP Requests (You need to publish your game/experience first before getting the options.)

Next get the file rbxm then put the folder to ServerScriptService;

ModelFolder

  • LogScript will be the example code that you can use
  • LogModule is the module, Open it for more infos;

ModuleInside

  • Put your discord Webhooks in the ‘Webhooks’ ModuleScript
  • You can edit anything in ‘Settings’ two important one is ‘Admins’ and ‘SendLogsCommand’

Admins

So when an admin says the ‘SendLogsCommand’ word, it will sends the game latest logs

You can try making a custom reporting by using this module.

Example Code:

Code
local plrs = game:GetService("Players")
local LogModule = require(script.Parent.LogModule)

local landmine = script.Landmine.Value

landmine.Touched:Connect(function(hit)
   local char = hit.Parent

   if char and char:FindFirstChild("Humanoid") then
   	-- adds a log when Landmine triggered
   	LogModule.AddLog(char.Name .. " Triggered the landmine")

   	local ex = Instance.new("Explosion")
   	ex.Position = landmine.Position

   	ex.Parent = workspace
   	landmine:Destroy()
   end 
end)

plrs.PlayerAdded:Connect(function(plr)
   -- Adds a log when player joins
   LogModule.AddLog(plr.Name .. " has joined the game")
   
   plr.Chatted:Connect(function(msg)
   	-- Adds a log when player chatted
   	LogModule.AddLog("["..  plr.Name .."]: " .. msg)
   	
   end)
   
   -- Checks if player an admin or not, if player an admin then the player can send logs
   LogModule.CheckAdmin(plr)
end)

Idea:

You can add custom Logs, lets say you have a game about Sword Fighting, you can use this module to keep track of the latest kills and if someone is being suspected as a cheater. Example;

img

Notes/Credit(s):

When trying to put the Webhooks, use hooks.hyra.io proxy by @melodrvma
Thanks to @PysephDEV for making TableToString Module.

This is my first ever post on Community Resource, tell me if theres something missing/wrong in this post. Thank you!

4 Likes

Discord is not a logging service. Using it as such is against their TOS and will get your webhook blocked.

6 Likes

this module will send messages whenever an admin typed a command, this module is not going to pass the ratelimit.

please read this post: Can I use discord webhooks for logs?

edit: i’ve never seen a discord offical post telling you cannot use webhooks as logs, can you provide the link? i will delete this post if its true.

Well to be more clear, I should’ve said that mass logging isn’t allowed by discord. As far as I know, it’s alright if you don’t go overboard with it. Consider reading this post, it explains it pretty well.

that means i’m still okay to use my module, right?.. my module is not sending server logs every second, its only sending logs when an admin typed the SendLogsCommand to the chat.

Yes, as long as you respect the rate limits, you’re in the clear.

thank you for clearing it out, i thought i need to wipe this 2 month old project :face_in_clouds:

1 Like

You should be safe, though I recommend you add a rate limiter if there isn’t one already!

Edit: typo, meant rate and not date lol

1 Like

Yeah, I agree that default rate-limiting should probably be part of this resource. If you do not respect the rate-limits, Discord may block you, or worse, Roblox may block you from using HttpService in order to keep good relations with Discord.

This module only sends whenever someone fires the .SendLogs function on the module. While it sending Logs you cannot call the the sendlogs function until the first one is done.

Example:
local LogModule = require()

LogModule.SendLogs()
-- Sends the Logs.

LogModule.SendLogs()
-- Will get a warning from the module because the first one is still running.

The sending system can be called by multiple Webhooks making it harder to get past the rate-limits.

I do not understand to why are you guys saying i need to keep the rate-limit even tho the code shows that it’s super rate-limited (like… really).

If theres any concerns in the code that may fall into the rate-limited category that i didn’t find, you can message me in devforum or discord (fayking#8312).

I’m using a proxy; hooks.hyra.io the proxy will block me if i go past the proxy rate-limit, not discord.

I’ve never seen someone got blocked by simply using HttpService, can you provide more proof/evidence?..

By the way, discord blocked roblox from sending webhooks, that’s why i’m using a proxy.

I forgot to reply, theres already a rate-limiter from the proxy itself and from the module too.

1 Like