Quantcast
Edit received message - WoWInterface
Thread Tools Display Modes
11-19-16, 02:34 PM   #1
Loranzo
A Defias Bandit
Join Date: Nov 2016
Posts: 3
Edit received message

Hi, I am learning and I have a problem. I can edit messages before sending them, but I don't know how to edit received messages before showing them to player, is it possible to do? Thanks! (sorry for my english)
  Reply With Quote
11-19-16, 03:03 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
What kind of messages? Chat messages from other players? Chat messages from NPCs? Mail messages? Data messages from addons? Something else?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Donít message me about addon bugs or programming questions.
  Reply With Quote
11-19-16, 03:37 PM   #3
Loranzo
A Defias Bandit
Join Date: Nov 2016
Posts: 3
Sorry, Guild chat
  Reply With Quote
11-19-16, 03:48 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,965
You can use ChatFrame_AddMessageEventFilter() to modify incoming messages.

Lua Code:
  1. ChatFrame_AddMessageEventFilter("CHAT_MSG_GUILD",function(self,event,msg,...)
  2. --  Do something with message
  3.     return false,msg,...;-- True blocks the message from displaying, if changing any event args, we need to return all of them
  4. end);
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-19-16, 05:10 PM   #5
Loranzo
A Defias Bandit
Join Date: Nov 2016
Posts: 3
Nice, thank you
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Edit received message

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off