This may be impossible soon, be weary!
Big thanks to @Noah for making the Discord to Heroku tutorial! (You MUST follow this tutorial before I begin.)
The script:
local HttpsSerivce = game:GetService("HttpService")
local Server_Url = "" --Put your App_URL here.
local Api_Key = "" --API key we made here.
local Complete_Url = Server_Url.. "discord"
local groupID = 8873606
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
local MessageLower = string.lower(Message)
local args = Message:split(" ") -- Splits arguments.
if Player:IsInGroup(groupID) and Player:GetRankInGroup(groupID) > 18 then
if args[1]:lower() == "/announce" then -- Checks if the command was used.
local announcemsg = Message:sub(args[1]:len() + 2,-1) -- Announce message in a variable.
local function SendDiscord(DscMsg)
local Req_Url = Complete_Url .."?Key=" ..Api_Key.. "&Message=" ..DscMsg
print(Req_Url)
local Request = HttpsSerivce:GetAsync(Req_Url)
local data = HttpsSerivce:JSONDecode(Request)
end
SendDiscord(announcemsg) --Send a message, customize by editing the string!
end
end
end)
end)
Thank you for following this tutorial! Tell me if you need any assistance.