Discord Integration: A guide on using Discord through Roblox [UPDATED]

I actually replied & asked if it was b/c of resources, but he just responded with this:

My best guess would be that they allow webhooks for stuff meant for Discord (like bots), and not people using it to send stuff.

23 Likes

That makes sense I guess. I’ll remove the error monitoring part.

7 Likes

You can leave it up there since it’d still help people out, but I had one logging errors for Survivor (which got 29k players at once), so I’m assuming the high amount of http requests made them look into what it was for. As long as your game doesn’t have a lot of players at once, they probably won’t ever check it.

7 Likes

Can definitely agree with @repotted that lower traffic is probably fine. My game had 3k players on at once sending reports without any problems.

7 Likes

Yeah, that’s probably why :grimacing:. I’ll put it back up there with a warning so people don’t get their discords terminated.

11 Likes

I talked to a few of the Discord developers about this and it would seem that the main issue was certain developers not being meticulous about how many requests they were sending. For example, if you have an error that triggers multiple times per second because of some unchecked bug, you would basically be DDoSing Discord with POST requests. I’d say they likely mitigate this by checking certain headers that were present in the request that would reveal it was sent from a ROBLOX server.

There are several very high-profile servers that actively use Discord to log important errors, so I’m going to guess they aren’t completely opposed to error logging on the platform but ban it in the case of ROBLOX due to the very high potential of API abuse.

Then again, some people are still sending webhook messages through ROBLOX; perhaps this is because they’re only going after people causing trouble or they have a certain check setup like “if sent from ROBLOX and channel name includes ‘error’…”

TLDR: Use Sentry, it’s awesome and actually made for error logging.

19 Likes

Please do not spam discord. If too many people do this they may just blacklist roblox server IPs in general and that would ruin it for everyone who doesn’t abuse it.

25 Likes

Would it be better to just remove the monitor in general? Some people with malicious intent might be viewing this.

4 Likes

It’s kind of unavoidable. Worst case scenario those who use it responsibly can set up a proxy for very cheap (cheap because they aren’t overloading it!!)

4 Likes

Alright. Thanks for the feedback all of you by the way.

5 Likes

I haven’t used webhooks in a while, but I think you can send multiple embeds in one HTTP request. You could group several messages (each as a separate embed) into one request.

Actually lemme test:

{
  const url = 'https://canary.discordapp.com/api/webhooks/343362987622662144/z6r8217KiNVhWxf3SbnOaX8fQ4__TptWNvApVM3VqgybOXdQOE5-sgy00D4nMio7g89-';

  function embed(title, desc, color, author) {
    return {
      timestamp: "2017-07-11T17:27:07.299000+00:00",
      title,
      desc,
      color,
      author: {
        name: author,
        icon_url: 'https://cdn.discordapp.com/emojis/339896242211389450.png'
      },
      fields: [
        {
          name: 'A',
          value: 'B',
          inline: true
      },
        {
          name: 'A',
          value: 'B',
          inline: true
      },
        {
          name: 'A',
          value: 'B',
          inline: true
      },
        {
          name: 'A',
          value: 'B',
          inline: true
      },
    ]
    }
  }

  console.log(embed('a', 'b', 0xFFFFFF, 'einsteinK'));

  $.post(url, JSON.stringify({
    embeds: [
    embed('Title1', 'Description1', 0xFF0000, 'einsteinK'),
    embed('Title2', 'Description2', 0x00FF00, 'einsteinK'),
    embed('Title3', 'Description3', 0x0000FF, 'einsteinK'),
  ]
  }), console.log);
}

I already deleted the webhook to prevent spam. thanks to antonio6643#8700 for pointing that out

16 Likes

We actually attempted to do that with the egg hunt this year and did not get such a message. We hit like all rate limits though so we had to remove it after a few hours.

4 Likes

Honestly depends on what you’re using it for, and if your game is constantly printing things in the console.

2 Likes

:pray: A user some months back linked me to Tigerism’s stuff, tons of coolness. This tutorial will hopefully spread the neat usage of Discord integration in ROBLOX.

3 Likes

Have you integrated Sentry with Roblox? If so, could you make a tutorial on that maybe?

4 Likes

I haven’t yet, however I’ll be sure to take a look!

3 Likes

Im working on a large RPG so if you make a tutorial for good error logging you’ll be my hero.

2 Likes

I’m gonna explore other options(Like Sentry) and then maybe post a tutorial on which to use for what games, and how to use each one. I’ll be sure to contact you when/if it’s released!

3 Likes

I glanced through Sentry documentation for a few languages and concluded that it probably is not possible to support sentry directly. You might need to have a middle man such as a node.js/php server (node.js is probably better for this tbh.)

Main reason for this is because their api uses http verbs that roblox doesn’t support, such as delete and put.

Authenticating will be a bit more annoying, as it doesn’t follow the easy methods.

So in conclusion, the best and fastest way is to make a middleman connect to sentry for you. You can host a reliable web server on openshift, but it’s a hassle to set up a node.js server. Php might be easier to set up.

3 Likes

I’m currently working on a Sentry module. Most things are possible through POST/GET, and authentication is done through the Authorization header, though it requires a specific format.

3 Likes