async function readCerts(){
const sheets = google.sheets({version: 'v4',auth});
const spreadsheetId = 'myIdHere';
const range = 'Overview!B5:H60';
try {
const response = await sheets.spreadsheets.values.get({
spreadsheetId,range
});
const rows = response.data.values;
return rows;
} catch (error) {
console.error('error',error);
}
}
(async()=>{
const pcc = await readCerts();
if (interaction.commandName === 'stats') {
const maar = new EmbedBuilder()
.setTitle('Statistics for Current Month')
//.setDescription('cool description here')
.setColor('Red')
.setThumbnail('https://i.imgur.com/9GKhYQf.png')
.setFooter({text: 'DroneOS', iconURL: 'https://i.imgur.com/9GKhYQf.png'})
.setTimestamp()
.addFields({
name: `Total AARs: `,
value: `${raar}`,
inline: false,
}
);
interaction.reply({ embeds: [maar]});
}
})()
So im creating a discord bot and whenever i use the command that this is linked to it works. But it displays all the data in all cells in the set range. My question is: How do i get a specific cell out of the range and use it?
The way ive been doing it is replacing the range to a specific cell, but i feel like that isnt the most practical way to do this, can anyone help? Im pretty new to JS so any tips would be greatly appreciated.
famq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.