Roblox to Discord Bot

Hey there, so I want to make a BOT not a webhook in discord where when I hatch an egg it sends a mesg in the discord chat. Now I make a discord webhook to do it. But I want to implement it to a bot. Can some help me?

3 Likes

Webhooks are the only way currently if I’m not wrong. At least based on my research. Plus, webhooks are much easier to use and is kind of what they are for. Bots are more for helping manage your servers.

how do I create timestamps in webhooks?

1 Like

You can send that information to the webhook when you make a POST request to it.

You can do it with a bot, You would need to create a backend server to recieve the data and then send it.

1 Like

Webhooks are absolutely not the only way to achieve that.

There are several ways to create a Discord bot, but you’ll need a computer (or a virtual instance) running it. You’ll also need a basic understanding of networking and http requests.

I personally recommend Discord.js, a JavaScript library to help you write your bot, w3’s introduction to Node’s http servers to learn how to enable your Roblox game to communicate with your bot and OVH services if you need an affordable virtual instance running the bot.

3 Likes

You would need something like an express server to send the data in the headers, which then you can send the Embed / message with them headers to that certain channel. its just more work to be done.

Next time, please don’t ask people to create entire systems for you.

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category. - About the Scripting Support category


There are a couple ways on how to have a Roblox game server communicate with Discord.

First, you can use webhooks to post data from the game server via HttpService
to post data from the Roblox server to the Discord webhook. There’s a guide on the DevForum to help you get started on it.

Another way is to use a Discord bot via an HTTP server. Using HttpService, the game server sends a request with the data as headers, as @HmmBilly said.

I’d recommend using webhooks instead of a Discord bot, which is much easier to setup. You don’t have to setup an HTTP server so that you can send data to the bot.

2 Likes

If your running your bot on a Node.js vps i suggest you make a request using HttpService to your server and handle it with express.

So I am hosting my bot on heroku. how do I send http requests to heroku?
@spicychilly2 @Jaguar515_YT @HmmBilly @incapaxx @Flubberlutsch

It’s hard to make Discord bot to handle your game requests. I highly recommend you use webhook to get started go here Click here

I have never used heroku before.

I already have a webhook for the hatchings system. But if I want other server to see what pets I hatched then I could just invite the bot.

Use HttpService to send a request to Heroku.

-- This is a little example of how to send a GET request to the Heroku server. It should be used as a reference.
-- If you want to send more than GET requests, you can use HttpService:RequestAsync(). Check out the documentation of it for more details.
-- https://developer.roblox.com/en-us/api-reference/function/HttpService/RequestAsync

local HttpService = game:GetService("HttpService")
local url = "" -- your heroku url here

local response

local success, err = pcall(function()
      response = HttpService:GetAsync(url)
end)

if success then
   print("success")
   print(response)
else
  warn(err)
end

May I just ask what heroku url?

Like this:

[appname].heroku.com (appname will be different since you created an app with a different name)

its says Application Error ? will it still receive http requests

Application Error means that there is an error in your Heroku app code. See this article for more details.

Its not hard to make one, as i said before. Its just not needed work.

The solution u sent didnt work! so my quesions is that can u see send http request to the heroku url? and how would I receive the msg in node.js