(node:13696) UnhandledPromiseRejectionWarning: TypeError: GoogleSpreadsheet is not a constructor
目前在尝试定义 GoogleSpreadsheet 时出现此错误。不确定这里可能出现什么问题。
async function accessSpreadsheet() {
const doc = new GoogleSpreadsheet('166SrAlBzhYXLxxIrHCQR333y_w3pcxeG7rV3bkjAp2U');
await promisify(doc.useServiceAccountAuth)(creds);
const info = await promisify(dox.getInfo)();
const sheet = info.worksheets[0];
const input = {
transcript: data,
ticket: message.channel.name
}
await promisify(sheet.addRow);
}
accessSpreadsheet();
上面是我的代码,不是全部,而是与谷歌电子表格有关的所有内容。
如果您使用的是版本 3,您可能需要像这样导入它:
const { GoogleSpreadsheet } = require('google-spreadsheet');
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)