View Single Post
05-24-21, 12:29 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The function for a slash commands has a single string parameter you can use for different actions:

Lua Code:
  1. SLASH_MYSLASHFUNCTION1 = "/ms"
  2. SlashCmdList.MYSLASHFUNCTION = function(msg)
  3.     local name  = UnitName("player")
  4.     if msg:upper() == "HI" then
  5.             print("Nice day to you " .. name)
  6.     elseif msg:upper() == "BYE" then
  7.             print("Time to go " .. name)
  8.         end
  9. end

Code:
/ms hi
/ms bye
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-24-21 at 02:30 AM.
  Reply With Quote