Hello, I would like to know how you get all Roblox errors like the developer console so you can use them. I would like to make a system that notifies the server if a client has a error or warning, or if the server has a warning or error. This is so I can use Discord Web hooks to send any error info in runtime to a debug discord server to see any problems as they come about. Thanks in advance, Rex
You dont need to give me the code, only a API reference
Yes I know, but I do not want to use all of that, when I always use discord, I have it on my phone, the developers I work with have it, and I find it overall easier. I only want simple error logging that I will get a notification for and dont have to download anything or make a account for anything I dont have
Found a previous topic similar. They stated that Discord shouldn’t be used for logging. Clearly they state that webhooks connected to Roblox is killing Discord’s bandwidth. Better use alternatives.
On a side note, keep your rates low for sure. Otherwise you’ll be hauling trouble from Discord.
Discord is providing public web hooks, I have never had a big issue with invalid requests, and will not decide not to use it because its using bandwidth, every alternative uses bandwidth, the discord route just suits me best. I have only asked for how to get error and warning information from the server and clients, I did not ask for a discussion about weather I should use discord web hooks for logging the data.
local HttpService = game:GetService("HttpService")
local ScriptContext = game:GetService("ScriptContext")
local webhook = "https://discordapp.com/api/webhooks" -- fill here
ScriptContext.Error:Connect(function(Error)
local payload = {
content = Error
}
HttpService:PostAsync(webhook, payload)
end)
First time I actually do touch the PostAsync I must say.
local HttpService = game:GetService("HttpService")
local ScriptContext = game:GetService("ScriptContext")
local webhook = "https://discordapp.com/api/webhooks" -- fill here
ScriptContext.Error:Connect(function(Error)
local payload = HttpService:JSONEncode({
username = "Error";
content = Error;
})
HttpService:PostAsync(webhook, payload)
end)
From my experience you need to JSON encode the payload and have two things.
[“username”], which is the name of it.
[“content”], which holds the error.
If I forgot something, oops.
Like this:
As Operatik said, it’s not wise to use Discord webhooks for error reporting. My team uses Sentry, which is a service entirely dedicated to error reporting. I can’t help with the network code because it’s not my area of expertise, but I figured I’d give you the option.
Yeah, if your error logging gets recognized, you will be banned from Discord.
and for your concerns about overloading discord, this system will not run in studio.
Yeah, and when you have an error and multiple servers, you will be spamming that webhook. There are much better solutions that don’t risk your Discord account and provide better resources with analytics on what’s happening.
(I just realized I replied to the wrong person… sorry! This is meant for OP)
I have not seen anything about not being allowed to use discord web hooks for error logging, did you mean you think I will go over discords web hook limits? I have not been able to find anything about allowed use cases for discord web hooks.
Discord previously blocked requests directly to their API from a Roblox server, as seen here: x.com
There were proxies provided that helped limit the abuse of Discord’s API, and eventually Discord let up on it because people still wanted it for other uses. It is still a violation of their ToS.
I would like to kindly suggest you heed the previous posts warnings about using Discord for logging errors and warnings as it has already been officially stated by roblox if you do use discord as your error logging container, you will be disabled.
Please understand this that your Discord account will be in the risk zone of being disabled when violating the ToS as previously mentioned by replies above.
If you create a game and it gets popular, you are certainly going to hit the discord call limit. Even though you seem to not care about getting banned or care about what we say, I still recommend that you go with something such as Sentry. Sentry has the benefit of also organizing your games and the errors it receives. Plus it’s free for a specific number of requests.