I was wondering if there is a way to make it so when an announcement is made in a Discord channel it would appear in the Roblox chat in some way?
Help is appreciated!
I was wondering if there is a way to make it so when an announcement is made in a Discord channel it would appear in the Roblox chat in some way?
Help is appreciated!
I’ve been experimenting with API, Webhooks, and other stuff so I have some knowledge…
You can’t use webhooks for this.
You’ll need to make your own bot that is capable of posting messages and check constantly in your game to see if any posts were made. You should probably also use MessagingService to prevent API exhaust.
Webhooks will be no use for this. Instead, you could send requests to your own server, which has a bot that listens to messages in a certain discord channel. The server can then respond with a message ID and the message content
Pseudocode:
local latestId = 0
while true do
local resp = http:GetAsync("...") -- the url
local content = http:JSONDecode(resp)
if content.id ~= latestId then -- it can be the message id or a guid
latestId = content.id -- updates the latest id
sendMessage(content.message) -- sends the message to the game
end
wait(2) -- to avoid spamming requests
end