1. Hello,

    I'm making a chat addon (my first addon), and I have found the functions:

    ChatFrame_AddMessageEventFilter("event", filterFunc)

    ChatFrame_RemoveMessageEventFilter("event", filterFunc)

    filterFuncList = ChatFrame_GetMessageEventFilters("event")

    However these appear to modify what you see and not what is sent to propagate to other players listening.

    So 2 questions: 1. Is it possible to alter the outgoing message? 2. If so, what's the function or what is an example of how to change what someones says to someone else prior to sending the message to another player.

    Example of what I want to happen:

    /whisper someotherguy hello, would you like to group for a random?

    (now pretend your are someotherguy)

    [playername]: hello, would you like to group for a dungeon?

    ^^^ notice how i changed the word random to dungeon. I understand string find/gsub etc.. as they are listed in wowwiki wow api function lists. But how do i change the message before it gets sent without replacing the chat frame?

    Hello,

    I'm making a chat addon (my first addon), and I have found the functions:

    ChatFrame_AddMessageEventFilter("event", filterFunc)

    ChatFrame_RemoveMessageEventFilter("event", filterFunc)

    filterFuncList = ChatFrame_GetMessageEventFilters("event")

    However these appear to modify what you see and not what is sent to propagate to other players listening.

    So 2 questions: 1. Is it possible to alter the outgoing message?

    Universally.. not really. You'd need to hook the SendChatMessage() function.

    1. If so, what's the function or what is an example of how to change what someones says to someone else prior to sending the message to another player.

    Example of what I want to happen:

    /whisper someotherguy hello, would you like to group for a random?

    (now pretend your are someotherguy)

    [playername]: hello, would you like to group for a dungeon?

    ^^^ notice how i changed the word random to dungeon. I understand string find/gsub etc.. as they are listed in wowwiki wow api function lists. But how do i change the message before it gets sent without replacing the chat frame?

    You'd need to hook the SendChatMessage function.. not for the light hearted.

    It didn't even hit me to look for "hooking" as this is a term commonly used in other programming environments as well. Here's an example for anyone interested that i found on wowace.com, I also ran across some old blizzard forums about people doing approximately the same thing and they all did the following:

     --First backup the blizzard send chat function into another var so you can use it later if you want.
    
     wowSendChatMessage = SendChatMessage
    
     --Then redo the function, be sure to include the ..., i would assume if you overload the arguments you won't get the desired effect.
    
     function SendChatMessage(msg, chatType, ...)
          wowSendChatMessage (msg, chatType, ...)
     end
    

    Anyway, i haven't tried this yet as i am at work. But if you have anymore thoughts, please post.

    Thanks

    No, that's how you would do it =)