In my previous post or topic, I was wondering how I could edit a message in roblox studio, now what I want to know is how to delete a message, what I got is that in Chat > ChatScript > ChatMain > MessageLogDisplay, there’s a method called RemoveLastMessage and well… All I have for now is
Chat > ChatScript > ChatMain
EventFolder.DeleteMessageRequest.OnClientEvent:Connect(function(messageData)
local channelObj = ChatWindow:GetChannel(messageData.OriginalChannel)
if channelObj then
channelObj:RemoveMessage(messageData)
print(messageData.ID)
end
end)
Chat > ChatScript > ChatMain > ChatChannel
function methods:RemoveMessage(messageData)
table.remove(self.MessageLog, messageData.ID+2)
if self.Active then
self.MessageLogDisplay:RemoveMessage(messageData)
end
end
Chat > ChatScript > ChatMain > MessageLogDisplay
function methods:RemoveMessage(messageData)
self:WaitUntilParentedCorrectly()
local Message = self.MessageObjectLog[messageData.ID+2]
Message:Destroy()
table.remove(self.MessageObjectLog, messageData.ID+2)
self:ReorderAllMessages()
end
And well, It works fine but… sometimes the ID is wrong and doesnt delete the message or delete another message
So, can somebody help me, pleasee? I’ve read another topics in the forum, but I don’t think any of those works for what I want
Oh, I forgot, what I want is to make a music bot as discords bots and well, I got everything right, but what I want is, when a player sends the command “?play song’s name” it will sent 5 results and then the player has to select it sending the command “?play” and the number of the song, and when the player sends the command, the message that contains the command will be deleted and the message of the bot showing up the results will be edited by something like " “Song’s name” is added into the queue"