Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

109
Visualizações
Discord bot acceses google sheet but its fetching an older version of it

So my discord bot has a command for doing something based on info from a google sheet. Now the problem is its reading an older version of the sheet rather than reading the live version. Code:

await doc.useServiceAccountAuth({
    // env var values are copied from service account credentials generated by google
    // see "Authentication" section in docs for more info
    client_email: process.env.CLIENT_EMAIL,
    private_key: process.env.PRIVATE_KEY.replace(/\\n/g, "\n"),
});
await doc.loadInfo();
const clanappsheet = doc.sheetsByIndex[1];
await clanappsheet.loadCells(`A1:Q${clanappsheet.rowCount}`);
const id = interaction.options.getString('id');
let row1 = 1;
let memberid = clanappsheet.getCell(row1, 11);
let member = memberid.formattedValue;
let memberclanassignment = clanappsheet.getCell(row1, 12);
while (memberid != null && member != id) {
    row1++;
    memberid = clanappsheet.getCell(row1, 11);
    member = memberid.formattedValue;
}
memberclanassignment = clanappsheet.getCell(row1, 12);

I want it to always read the live version of the sheet.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda