Discord bot help

So I want a discord bot that can run commands in game. for example:

ingame I say "!d say hi people"

and the bot create a message in #general saying

"hi people"

I also want the bot to be able to read messages in a channel like #staff-bot-commmands and return back to the game and print out all the messages sent there when I say for example:

!d getstafflogs

Now I already got a sample bot setup and node.js setup to host the bot on a old computer I have.

What I really want to know is how I can communicate with my bot and the game to do commands!

(also I want all the code to be client sided)

In #scripting-support you cannot ask for whole scripts or systems.

I want example code or tips on how I can do this

This is asking for a script to help you make the commuication

Sending messages from Roblox to Discord is easy as all you need is to use the HTTP Service and a Discord Webhook. Having messages go from Discord to Roblox is something that’s harder and I’m unsure how to do. (It requires a web server and a Discord bot but I’m really unsure how to make these)

You can only send and receive HTTP Requests on the server because of how Roblox’s server/client boundary is made.

This post will help explain how to add Discord Webhook integration!

so I just said it again so you can see it in case you didnt

First you will want to parse the message. There are tutorials on making commands such as this one.

You will want to make that d command. Get everything after the first space, then use HttpService:PostAsync to send a POST request to a webhook. I don’t know about doing this with bots tho

local http = game:GetService(“HttpService”)
webhook = “URL”
local Data = {
[“content”] = “Hey! This is a message sent from roblox!”
}

Data = http:JSONEncode(Data)

http:PostAsync(webhook, Data)

CODE FROM Discord Integration: A guide on using Discord through Roblox [UPDATED]