0

I have asked on the TeamSpeak community forums and either received very rude or cold comments. This is what I have far and have had no success.

function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
    myChannelID = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if myChannelID == 56115 then
        function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
            myID = ts3.getClientID(serverConnectionHandlerID)
            response = [[I'm sorry,
                I can't answer your message right now. If you need my help, please send me  a ticket! I am a bit busy right now and really need to concentrate.
                Thanks! :)]]
            if fromID ~= myID and toID == myID then
                ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, response, fromID)
            end
        end
    end
end

The responder is working just fine. I am trying to set it to reply when I am in a specific channel.

  • Is this not working? In what way? Does redefining functions like that work correctly in this environment? – Etan Reisner Mar 02 '15 at 21:20
  • I wish I could provide more information. It simply isn't working. There is no log for me to check to understand why the function isn't activating on receiving a private text message; I have checked the Channel ID against the server. I am not sure if redefining them works correctly. I am not a professional coder so I am fairly new to this sort of thing. – user3402348 Mar 02 '15 at 21:38
  • Can you add debug logging to your functions to see if they are being called at all? – Etan Reisner Mar 02 '15 at 22:03
  • I'm very new to this. The fact that I got my autoresponder to work WHENEVER someone sent me a message, no matter where I was at, amazed me. I am not sure how to add debug logging at all. – user3402348 Mar 02 '15 at 22:17
  • How does the working code differ from this code exactly? – Etan Reisner Mar 03 '15 at 13:00
  • I added the first "function", the "myChannelID" target, and the first if statement ("myChannelID == 56115 then"). The original one is constant unless manually switched off. – user3402348 Mar 03 '15 at 20:47
  • Instead of redefining the function like that have you tried just *not* doing that? That is remove the inner `function` line (and matching `end` line) and just let the outer function and `if` contain the body of the function. – Etan Reisner Mar 03 '15 at 22:17

0 Answers0