The function for a slash commands has a single string parameter you can use for different actions:
Lua Code:
SLASH_MYSLASHFUNCTION1 = "/ms"
SlashCmdList.MYSLASHFUNCTION = function(msg)
local name = UnitName("player")
if msg:upper() == "HI" then
print("Nice day to you " .. name)
elseif msg:upper() == "BYE" then
print("Time to go " .. name)
end
end