Is it possible to kick / ban a player in your roblox game from using a discord command?

As said in the title, I’m looking if is it possible to kick/ban a player from my game through a Discord command or something like that! Help appreciated. Thanks!

No, this is probably not a good idea.

1 Like

Why thou? Like is it against the Roblox Tos or smth?

Yes, because it’s maybe Off-Topic to Roblox…

Edit: Edited.

1 Like

Ooh, oof then…I didn’t know that sorry. Thanks, Ig!

It is allowed in the TOS. You are allowed to send external HTTP requests. They even have a feature for that. It is just not allowed to mention that link to other players. However, it is indeed allowed.

2 Likes

Can you help me with how I can make one of those? I tried some Roblox API methods which didn’t seem to work.

I said:

Not fully Off-Topic…

30 letters thing

Everytime, when we don’t have enough space to the posts you want (Which is 30 letters) we always use this method.

Or we can just blur the text.

2 Likes

Ahhh, Lol noice method u got there to go under limit xD!

What you are searching for is messaging service Announcing Messaging Service API for Open Cloud, using a request from the already hosted bot you can send messages to servers in roblox. The information is all on that post

1 Like

Nice method.

So, you mean that when I’m sending the request from discord, In Roblox it’s gonna use the Messaging API to ban/kick the player??

To send a message to the server. However, the kicking and banning needs to be done manually. It should be fairly easy since you just need a simple DataStore storing all the banned names. Then when a player joins you need to check if their name is there and if it is kick them.

You send request to the following link:
https://apis.roblox.com/messaging-service/v1/universes/{universeId}/topics/{topic}

Then, in roblox you do the following (This is an example, not related to what you want to do specifically):

local MessagingService = game:GetService("MessagingService")
local Players = game:GetService("Players")

local MESSAGING_TOPIC = "FriendServerEvent"

Players.PlayerAdded:Connect(function(player)

	-- Subscribe to the topic
	local subscribeSuccess, subscribeConnection = pcall(function()
		return MessagingService:SubscribeAsync(MESSAGING_TOPIC, function(message)
			print(message.Data)
		end)
	end)
	if subscribeSuccess then
		-- Unsubscribe from topic upon player ancestry change
		player.AncestryChanged:Connect(function()
			subscribeConnection:Disconnect()
		end)
	end
end)

I got the datastore part, Don’t worry about that. Just can’t figure out how to send the request from Discord to Roblox.

Ima try this: Announcing Messaging Service API for Open Cloud

Thanks for the help!

1 Like

If you are wondering here is the API: Messaging Service API | Roblox Creator Documentation

1 Like