WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Edit received message (https://www.wowinterface.com/forums/showthread.php?t=54838)

Loranzo 11-19-16 02:34 PM

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)

Phanx 11-19-16 03:03 PM

What kind of messages? Chat messages from other players? Chat messages from NPCs? Mail messages? Data messages from addons? Something else?

Loranzo 11-19-16 03:37 PM

Sorry, Guild chat :)

SDPhantom 11-19-16 03:48 PM

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);

Loranzo 11-19-16 05:10 PM

Nice, thank you :)


All times are GMT -6. The time now is 05:01 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI