RGlobal Discord Bot - Send Announcements into your Games using Discord

RGlobal Discord Bot

Send Messages, Data, and more into your games with one command
using this simple Discord Bot

Invite the bot here :point_down:
:link: Invite the RGlobal Discord Bot to your server

About RGlobal

RGlobal is a Discord bot that uses Roblox’s MessagingService to send messages, data, announcements and more into Roblox by using one command on Discord!
This bot is completely safe and won’t log any data.

This is my first time ever making a Discord bot.

By using RGlobal Discord bot you agree that you have read and agree to our Privacy Policy below:

Privacy Policy

Tutorial

In this tutorial I will be showing you how to make a Global Announcement system using the RGlobal bot, our goal is to run one command and have all servers in our game notified with an announcement. Although, keep in mind you can use this tutorial to make so much more with this bot. We will cover this soon

I’ve made a video showing you how to go through the process of making this, but we will cover it in more depth in this tutorial. You can watch it here :point_down:

:link: RGlobal - Roblox Studio Tutorial

This was my first video with my voice, so I sound very nervous lol

Step One - UI

Our first step in making our Global Announcement system is to create our announcement UI to display our Global Messages
image
All my UI has is a Frame, Image Label and Text Label. All we really need is the text label and the Frame.

Step Two - Client

Lets make a local script inside our Frame. This will held us display our message. In order for our message to be activated however, we need a Remote Event. So I’ve made a RemoteEvent in ReplicatedStorage called SetGlobalMessage.

Now all we need to do is listen for our event to be fired, then display the message. Keep in mind the msg argument will be a string holding our message.

local messageBox = script.Parent.Parent.Globalmessage

game.ReplicatedStorage.Admin.SetGlobalMessage.OnClientEvent:Connect(function(msg)
	messageBox.Visible = true
	messageBox.Text.Text = msg
	wait(10)
	messageBox.Visible = false
end)

Now if we fire this event and pass in a string with our message, it will be displayed.

Step 3 - Server

Now, if we want to fire our event, we need to fire it on the server. So lets create a Script in ServerScriptService. In this script we will be using MessagingService and subscribing to a topic.

local MessagingService = game:GetService("MessagingService")

MessagingService:SubscribeAsync("Announcement", function(message)
	game.ReplicatedStorage.Admin.SetGlobalMessage:FireAllClients(message.Data)
end)

The first argument of our SubscribeAsync function is our Topic, this is very important, think of it as the name of our event. So every time we run our command from our bot, we will use the topic to help send the message.

Step 4 - API

Next we need to get our API Key, this is crucial when sending data between Discord and Roblox. Luckily, Roblox allows us to do this very easily using API Extensions
:link: Create your API Extension here

Give your API and name and a description.

Open the Select API System Drop down and select Messaging Service API then type your experience’s name in the search bar. If you are going to use this bot in a public discord channel PLEASE only use this API for MessagingService


Next, allow access to the IP 0.0.0.0/0, we are using this IP because the bot is hosted by Discloud, the IP that Discloud has access to is 0.0.0.0/0.

Generate and COPY Your Key. Keep this key safe AND DON’T SHARE IT!
Sharing your API key can allow others to use your API extension.

Step 5 - Discord

The hard part is finally over, now we can run the command to activate our announcement. Invite the RGlobal Discord Bot to your server, once you’ve done that get the Universe ID for your experience. Make sure you also have your API Key and Subscription Topic we mentioned earlier with you.

Now we need to run the /sendmsg command in our server


By filling in the needed data, we can now send the message, and all servers will see the announcement “This is a Test Message!” in game, live!

Conclusion

Not only can you use this bot for global announcments but you can also use it for so much more! Such as a command to kick a player, Lower a player’s health, give player’s items etc. In order to do this, change the code within the SubscribeAsync function as this function will run when your command is sent. Make sure to change your topic to something different for each command.

If you have any questions don’t be afraid to ask down below as I’d be happy to help!

Code Review

Thank you for reading :slight_smile:

10 Likes

Can this be used with Google Chat?

1 Like

This is a Discord bot, which means it can only be used in Discord Servers. I do not believe Google Chat supports any kinds of bots.

I was reading the Google api documentation the other day, since i just plugged into Google Workspace. It looks like they allow use of their Api in cloud functions. Its just alot of work to create the UI so people can log in and authorize a google app.

Recreating the backend of this bot to potentially work with Google Workspace could be possible, although I am not too familiar with their platform.

1 Like

Well if you decide to integrate, message me and Ill be happy to help.
Im looking to build relationships with fullstack roblox developers.

2 Likes

The only issue with this is that the bot is public and you could be logging users API keys, so if you are going to use this be careful.

If you are going to use this PLEASE be sure to not grant any extra permissions except MessagingService.

2 Likes

When you run a command the bot doesn’t show or send any personal info, and since this bot uses application commands they will not be visible to others in chat, although it is recommended to use the bot in a private channel. And no, this bot does not log any APIs.

1 Like

Yes but we have no way of knowing if the bot does not log information sent via application commands, you may say it doesn’t but you can’t exactly trust somebody else’s word on that kind of thing.

If somebody wants to use this I am not trying to stop them, just warning them that their API key could be logged and make sure to grant no more permissions except the one MessagingService API.

3 Likes

I should probably edit the post letting people know it doesn’t log anything. Thank you for reminding me. And yes, I totally respect those who have fear of getting their data logged

1 Like

I just added the extra warnings you had mentioned into the post, thank you

1 Like

Do you have a privacy policy that governs the collection of API keys by your application? According to the Discord Developer Terms of Service, it is required for your application to have a privacy policy in place if it collects any information from its users.

2 Likes

I actually do not, thank you for sending me this. I will take a look and add one as soon as I can.

1 Like

A privacy policy has been added, thank you for letting me know. I do not have much experience with making privacy policies so please let me know If I forgot anything.

Do you have a github for a code review?

I was originally going to do that but had trouble setting one up, let me try again now.

I just uploaded my files to github not sure if this is a way to do it, I barley use git but I should start to. If you find anything please let me know as this is my first time doing this.

1 Like

Your app doesnt save Api keys. :grinning:
You should post the link to your guthub in the description.

1 Like

I appreciate it, thank you for confirming

2 Likes

I’m new to scripting and I’d like to understand better. Why is there two “end)” in the local script? In the output, it says “Expected eof, got ‘end’