Re-send in SendChatMessage

Is there a way to mimic the /r or “resend” functionality in a SendChatMessage() script?

Specifically, I know I need SendChatMessage (“MyMessage”, “WHISPER”, nil, ???).

It’s that ??? part I don’t quite get.

How would I discover the toon that would ordinarily receive a message sent to /r?

local lastTell, lastTellType = ChatEdit_GetLastTellTarget()

2 Likes

Thanks, Fizzy.

Is there a way to mark something as a solution?

This is what I ended up with in my startup addon. It’s a “I’m in the middle of something. I’ll get back with you as soon as I can.” message. I’ve added it to my handled slash command args. If the first argument is “busy” and the control key is held down, it sends as a re-whisper. If the first argument is “busy” otherwise, it sends to GUILD.

elseif argList[1] == "busy" and IsControlKeyDown() then
 local who, how = ChatEdit_GetLastTellTarget()
 SendChatMessage("I am currently in a Raid, an Instance, Combat, or some other situation when I cannot take time out to respond to you properly. I will get back with you as soon as I am clear.", how, nil, who)
elseif argList[1] == "busy" then
 SendChatMessage("I am currently in a Raid, an Instance, Combat, or some other situation when I cannot take time out to respond to you properly. I will get back with you as soon as I am clear.", "GUILD")