    void GetChan(const CString& sLine) {
        const CString sVar = sLine.Token(1).AsLower();
        CString sUsername = sLine.Token(2);
        CString sNetwork = sLine.Token(3);
        CString sChan = sLine.Token(4, true);

        if (sChan.empty()) {
            PutModule(
                t_s("Usage: GetChan <variable> <username> <network> <chan>"));
            return;
        }

        CUser* pUser = FindUser(sUsername);
        if (!pUser) return;

        CIRCNetwork* pNetwork = FindNetwork(pUser, sNetwork);
        if (!pNetwork) {
            return;
        }

        std::vector<CChan*> vChans = pNetwork->FindChans(sChan);
        if (vChans.empty()) {
            PutModule(t_f("Error: No channels matching [{1}] found.")(sChan));
            return;
        }

        for (CChan* pChan : vChans) {
            if (sVar == "defmodes") {
                PutModule(pChan->GetName() + ": DefModes = " +
                          pChan->GetDefaultModes());
            } else if (sVar == "buffersize" || sVar == "buffer") {
                CString sValue(pChan->GetBufferCount());
                if (!pChan->HasBufferCountSet()) {
                    sValue += " (default)";
                }
                PutModule(pChan->GetName() + ": BufferSize = " + sValue);
            } else if (sVar == "inconfig") {
                PutModule(pChan->GetName() + ": InConfig = " +
                          CString(pChan->InConfig()));
            } else if (sVar == "keepbuffer") {
                // XXX compatibility crap, added in 0.207
                PutModule(pChan->GetName() + ": KeepBuffer = " +
                          CString(!pChan->AutoClearChanBuffer()));
            } else if (sVar == "autoclearchanbuffer") {
                CString sValue(pChan->AutoClearChanBuffer());
                if (!pChan->HasAutoClearChanBufferSet()) {
                    sValue += " (default)";
                }
                PutModule(pChan->GetName() + ": AutoClearChanBuffer = " +
                          sValue);
            } else if (sVar == "detached") {
                PutModule(pChan->GetName() + ": Detached = " +
                          CString(pChan->IsDetached()));
            } else if (sVar == "key") {
                PutModule(pChan->GetName() + ": Key = " + pChan->GetKey());
            } else {
                PutModule(t_s("Error: Unknown variable"));
                return;
            }
        }
    }
    void GetChan(const CString& sLine) {
        const CString sVar = sLine.Token(1).AsLower();
        CString sUsername = sLine.Token(2);
        CString sNetwork = sLine.Token(3);
        CString sChan = sLine.Token(4, true);

        if (sChan.empty()) {
            PutModule(
                t_s("Usage: GetChan <variable> <username> <network> <chan>"));
            return;
        }

        CUser* pUser = FindUser(sUsername);
        if (!pUser) return;

        CIRCNetwork* pNetwork = FindNetwork(pUser, sNetwork);
        if (!pNetwork) {
            return;
        }

        std::vector<CChan*> vChans = pNetwork->FindChans(sChan);
        if (vChans.empty()) {
            PutModule(t_f("Error: No channels matching [{1}] found.")(sChan));
            return;
        }

        for (CChan* pChan : vChans) {
            if (sVar == "defmodes") {
                PutModule(pChan->GetName() + ": DefModes = " +
                          pChan->GetDefaultModes());
            } else if (sVar == "buffersize" || sVar == "buffer") {
                CString sValue(pChan->GetBufferCount());
                if (!pChan->HasBufferCountSet()) {
                    sValue += " (default)";
                }
                PutModule(pChan->GetName() + ": BufferSize = " + sValue);
            } else if (sVar == "inconfig") {
                PutModule(pChan->GetName() + ": InConfig = " +
                          CString(pChan->InConfig()));
            } else if (sVar == "keepbuffer") {
                 
                PutModule(pChan->GetName() + ": KeepBuffer = " +
                          CString(!pChan->AutoClearChanBuffer()));
            } else if (sVar == "autoclearchanbuffer") {
                CString sValue(pChan->AutoClearChanBuffer());
                if (!pChan->HasAutoClearChanBufferSet()) {
                    sValue += " (default)";
                }
                PutModule(pChan->GetName() + ": AutoClearChanBuffer = " +
                          sValue);
            } else if (sVar == "detached") {
                PutModule(pChan->GetName() + ": Detached = " +
                          CString(pChan->IsDetached()));
            } else if (sVar == "key") {
                PutModule(pChan->GetName() + ": Key = " + pChan->GetKey());
            } else {
                PutModule(t_s("Error: Unknown variable"));
                return;
            }
        }
    }