Ok yes this sounds very confusing. But let me explain a bit more. I'm sure my method of sending text/info to my node.js bot is really bad. That's why I'm wondering if somebody can help me. Currently it can only send one piece of information.
This is my roblox code:
script.Parent.Text = math.random(1, 9999)
local HttpService = game:GetService("HttpService")
local options = {
Url = "http://localhost:8462", -- or whatever url. this is mainly for example purposes.
Method = "POST",
Headers = {
["Content-Type"] = "text/plain"
},
Body = script.Parent.Text,
}
local success, msg = pcall(function()
local response = HttpService:RequestAsync(options)
if response.Success then
print("Status code:", response.StatusCode, response.StatusMessage)
print("Response body:\n", response.Body)
else
print("The request failed:", response.StatusCode, response.StatusMessage)
end
end)
if not success then
print(msg)
end
And this is my node.js code which receives the info and stores it for a user runs the code.
const express = require('express')
const bodyparser = require('body-parser')
const prefix = ''
const fs = require('fs');
const Discord = require ('discord.js');
const app = express()
var port = 8462
app.use(bodyparser.text())
app.post('/', (request, response) => {
response.send("Gotten POST request")
const code = request.body
console.log(code)
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
// All the commands.
if(command === `/testEmbed`){
const CurrentEmbed = new Discord.MessageEmbed()
.setColor(0x8721ed)
.setTitle(`It worked`)
message.channel.send(CurrentEmbed)
// message.channel.send(texto)
}
else if (command == code){
const CurrentEmbed = new Discord.MessageEmbed()
.setColor(0x8721ed)
.setTitle(`Code recieved.`)
.setDescription(`One last thing, is this you? ||${plr}||`)
message.channel.send(CurrentEmbed)
}
});
})
app.listen(port, function(){
console.log(`started server at http://localhost:${port}`)
})
const client = new Discord.Client({
presence: {
status: 'online',
activity: {
name: 'new products',
type: 'LISTENING'
}
}
});
// client.once('ready', () => {
// });
client.login('Obviously not showing you.)
I hope somebody can help me. As it can currently only send the "request.body" Thanks in advance!

2 comments
I know this isn't an answer but you should be filtering text. ANY USER INPUT NEEDS TO BE FILTERED! https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering
Not actually. It's just numbers. And these numbers are sent to the discord bot. And users who use the discord bot and discord itself MUST be 13+ to use the application.