core icon indicating copy to clipboard operation
core copied to clipboard

Discord Logger

Open Lucke0051 opened this issue 5 years ago • 5 comments

I have made an example of how I would want it to work here: https://www.roblox.com/games/5238935539/HD-Admin-Logger Would be cool to see something similar make its way into V3!

Lucke0051 avatar Jun 27 '20 10:06 Lucke0051

Can you provide more details on the specifics of what this does?

1ForeverHD avatar Jun 29 '20 11:06 1ForeverHD

Well all it does is basically log all commands on discord, how I made it was that it took the same string as the chat logs in HD Admin does and just sends it to the Webhook. Though one thing I would like to improve is that if you use multiple commands it adds a field for each command. Instead of sending a message for each command as it currently does. disc log

(This was Lord's idea, he needed it so I made it for him and then I thought that I could also make a feature request here)

Lucke0051 avatar Jun 29 '20 12:06 Lucke0051

Thanks, I definitely see that working and it looks relatively simple to setup. Does discord or roblox limit the amount of requests you can make within a period of time? If a larger game were to enable this feature (such as an admin house with 10,000+ concurrent users), there's potentially going to be over 50,000 requests/minute. I may explore at 'holding' all the logs a user makes within a short time-frame (such as 1-10 seconds), then firing it off together in one-go.

1ForeverHD avatar Jun 29 '20 12:06 1ForeverHD

Discord limits: 30 requests/minute per channel Roblox limits: 500 http GET/POST requests per minute

Make sure to make an option to set the limits yourself, at max the Roblox limits, though if any other scripts use HttpService you will need to make sure that script also has some room to post.

Grouping commands and maybe only sending one large message every 30 seconds might be a good idea. Though Discord embeds can have up to 25 fields, so you might want to send every 25 commands as long as it doesn't step over the limit. If it does then maybe cache it and wait until you can send more. Or for constantly actvie games a last alernative might be to just send them in plain text.

And here is a good guide on Discord webhooks: https://birdie0.github.io/discord-webhooks-guide/structure/embeds.html

Lucke0051 avatar Jun 29 '20 13:06 Lucke0051

That helps a lot, thanks! I'll see what I can come up with using that baseline - I'll look at returning to the issue once the LogService is fully setup.

1ForeverHD avatar Jun 29 '20 13:06 1ForeverHD