Send a message from your Roblox game to Discord!

Hello World!
I realise there is a lot of YouTube tutorials on this, yet wouldn’t it be easier not to deal with all of this HTTPService stuff? This is specifically aimed at people who are new to the world of scripting but everyone is welcomed to use this.

It is also my first asset so I will appreciate some feedback!

:scroll: | Require the asset
In any script you wish to include the module put the code below:

local Discord = require(11780461670)

:white_check_mark: | Set up the webhook
After requiring the script, set the webhook you wish to use

  • Substitute YOUR_WEBHOOK_HERE with your webhook/proxy
Discord.SetWebhook("YOUR_WEBHOOK_HERE")

If you are unsure if your setup is correct, include Discord.Check() below this line. This is not necessary and your code will work without this.

:left_speech_bubble: | Send a message
This will send a simple message with the webhook you set earlier

  • Substitute MESSAGE_TEXT with your message
Discord.Send("MESSAGE_TEXT")

:sparkles: | Spice things up with an embed
You can send an embed too! Who doesn’t like nice formatting…?

  • Substitute MESSAGE_TEXT with a desired message. This CANNOT be nil. If you don’t want to include a message, set it as “”
  • Substitute EMBED_TITLE with your embed’s title
  • Substitute EMBED_DESCRIPTION with the embed’s text content
  • Substitute EMBED_COLOR with the color code in HEX value with following format: 0xFFFFFF. You can choose any color and substitute the Fs with your code, make sure to include the 0x in front of the code and do not use the #
Discord.Embed("MESSAGE_TEXT", "EMBED_TITLE", "EMBED DESCRIPTION", "EMBED_COLOR")

EDIT: This is the Roblox model if you wish to check the code or modify it to your needs: MainModule - Roblox

27 Likes

Thank you this is very usefull

1 Like

Great tutorial. So much stuff can be done with this :smile:

Simple and useful resource!

It’s important to note that Discord will reject direct requests from Roblox; you must find some sort of proxy for this to work. (Although it seems to work fine in studio, it doesn’t work in live games)

2 Likes

You should put the source code on the post so people can check it out before actually using it.

1 Like

If this is a resource then you should share the resource not just the asset id so that way people won’t get suspiscious of your work.

You’re right, I will include the link to the model

1 Like

Really REALLY cool! You should make a way to send messages back to Roblox (Discord to Roblox) so that the mods (If your making a report system) to take immediate action. Or just a chat system lol.

Nice module, if you want a more advanced one though, look at ‘WebhookService’ it’s something simmilar to this but much more complex and allows for much more.

1 Like

super easy to use. Great resource!!