Code:
local eventframe = CreateFrame("frame")
local mymessages = {"Wazzup", "Yo", "Hello"}
local function mychatfunc(self,event,...)
local messg, sender = ...
SendChatMessage(mymessages[random(1,3)].." "..sender.."!","WHISPER",nil,sender)
end
eventframe:SetScript("OnEvent", mychatfunc)
eventframe:RegisterEvent("CHAT_MSG_WHISPER")
Note that this is just example code for you to study.
In actual practice it would reply to any whisper with the same automated reply regardless if it's the first time someone sends a tell or the 10th.
It would lead to some very nonsensical conversations.
If you want everyone that /w you to get a predefined message it's easier to just set your dnd or away message with
/dnd your message here
/afk your message here