1. Hello, im still new to lua programming, and ive been messing around with an outdated and abandoned addon, it still works fine, i just want to add a chat channel option feature either through a slash command or through the interface menu. ive tried looking at other addons coding but havent seen something i could use yet. The code below has the chat input and output as guild chat, if i change GUILD in the two lines to PARTY, it will then only work in party chat.

    local __wgg = {}
    setmetatable(__wgg, wgg)
    local frame = CreateFrame("Frame")
    frame:SetScript("OnEvent", function(_, _, text, author)
        __wgg:onGuildMessage(text, author)
    end)
    frame:RegisterEvent("CHAT_MSG_GUILD")
    
    function wgg:spam(text)
    SendChatMessage(text, "GUILD")
    end
    

    I hope someone can point me in the right direction on what to read or suggest some code.

    Thank you for your time in reading this.

    I'd suggest you read the book I wrote about this topic, since that's primarily what I'm here to help with. Didn't I already answer this question in another forum? I'm not entirely sure what you're trying to do.

    only place i have posted this question was on curse-forged.com forums, but haven't gotten a reply on there about it. ill look into the book more. Basically what i trying to do is make the addon have an option window for the game addon to work in. it currently can only work in one channel hard coded into the lua file set to one chat channel, for someone to use the addon in another channel they must change it the lua and the game/ui reloaded. I want to have option with in game addon menu to have a drop-down menu, to select the chat channel the addon will work in.