Watchdog | Add security to your code with ease

I made a module for myself that lets me easily note, kick and ban players, but I decided to add more to it and release it for everyone to benefit from it. If there are any problems, I’ll try to address them as soon as I can.

How to use

This module is supposed to be used to note down problems with server code e.g. when an event is fired and things don’t add up. You can note the problem down easily and kick/ban if u have to, so it’s nothing like HD admin or anything similar.

I have added a Script that sets up the module for you and also grants moderators access to Chat Commands. To use the module itself in your code, all you have to do is require it. Make sure you are only using the module on the server.

local Watchdog = require(path)
local ServerModeratorId = -1 -- moderator id of -1 is reserved for the server

game:GetService("Players").PlayerAdded:Connect(function(player)
    Watchdog.Note(player, ServerModeratorId, "Testing")
end)

For the API, you can use the Github link below.

Watchdog
Github: https://github.com/ItsHiatus/Watchdog
Model: Watchdog - Roblox

WatchdogLite (without the embedded ChatCmds)
Github: https://github.com/ItsHiatus/WatchdogLite
Model: Watchdog Lite - Roblox


Usage example


How to use Chat Commands

If you don’t need the ChatCmd functionality, you can use WatchdogLite instead.


Updates

3rd Oct 2022

  • Added cross-server kicking (banning included)
  • Added Chat Commands
  • Removed the need to send the Moderator for most commands (except for logging purposes)
  • Renamed to “Watchdog” from “Moderation”, as it is more appropriate for what this module does and is less misleading

11th Oct 2022

  • Made a few changes with code structure - this shouldn’t affect your usage at all.
  • Added RemoveNote command
  • Added LocalNote and GetLocalNotes commands - these allow you to create temporary notes just for the server.
  • Made a WatchdogLite version without the embedded ChatCmds.

19th Oct 2022

  • Fixed a bug where the client script wasn’t being given to the player after resetting.

09th Jun 2023

  • Fixed ChatCmds to be compatible with the new TextChatService

Credits

  • Thank you @AljoSven for the ParseArg function
  • Thank you @EpicST19 for the new name (Watchdog)
45 Likes

This module is of incredible quality! I’ll be sure to use it in my future work.

4 Likes

Honestly, this is a module we didnt know we needed. One of my biggest pain in the ass was handling moderators, which slowed down my development of my admin system, so thanks

4 Likes

I appreciate it. I’ll be pushing a new update soon to fix some problems I noticed and also add cross-server kicking/banning support.

1 Like

Update

Fixed a few problems with adding/removing moderators using the commands.
Added cross-server kicking and banning:

3 Likes

Update
Added Chat Commands and a basic ServerScript setup for the module:

(more details in the post)
(also, ignore the avatar :eyes:)

2 Likes

I can’t wait to use this in my future games. Thank you very much for this module!

3 Likes

I am totally flabbergasted upon seeing the features this module offers! Truly exquisite.

3 Likes

You’ve done a fabulous job creating this. This does make life easier for us developers since we are stressed about getting the other parts of the games done, and we don’t focus much on how we manage our game.

However, I recommend using another system for managing your commands rather than using if & else if statements. Even though it works, it is harder to modify in the future. I recommend using a module script that holds all the commands with command descriptions and whatnot, so it’s all in one place and handled with another external hand.

3 Likes

YESSSSS!!! Cant wait to use this!!

I need words lmao

4 Likes

niiiiice it looks dope! especially with the fact you used roblox’s chat to display certain stuff

never seen anything like it tbh

3 Likes

Right, I agree with you. I did do that for other parts of my code; I just left that one large if elseif block as some people that reviewed my code told me to do so. I will probably change that in future updates. I appreciate your advice.

6 Likes

Maybe consider adding a LocalNote, which would only save the logs on the server, and not save, so you have saving logs, and non-saving logs. Otherwise, very interesting module, I’ll definitely check it out.

2 Likes

See, im confused is this for security for building a framework around a admin-panel?
It seems like for a admin-panel, but you state otherwise and could it technically be used for a admin-panel.

1 Like

It can definitely be used for an admin panel, but that isn’t what this is designed for. This module is intended to be used for resolving or noting down issues that arise in your code; not for giving yourself noclip or other features of dedicated admin panels.

For example, let’s say you have an item in your game that grants the player coins when used, but it has a cooldown of 1 minute between each use. Then on the server, you realise that the item is being used when it should have still been on cooldown, with this module, you can create a note on that player and choose to kick or ban them if you want.

2 Likes

Interesting…
I do like this a-lot.

2 Likes

Add a removenote chat command if there isn’t one already. Also a way to check if someone has a specific note.

1 Like

This module has some potential, my biggest complaint is that its currently not very open, its written around the chat commands and its a tedious and annoying task to remove that aspect of it. I think maybe writing a “Watchdog Lite” version of the module that handles the player verification, warns, bans etc without having the chat functionality built in would be beneficial.

3 Likes

I’ve been feeling the same way about it too. I’ll be sure to do this soon.

1 Like

Is it possible to add our own commands into Watchdog or not?

1 Like