我想在我的bot中实现代码,但当我运行索引时,它会给出此错误:ReferenceError: client is not defined
我的来源:
const discordTranscripts = require('discord-html-transcripts');
const { QuickDB } = require('quick.db')
const db = new QuickDB;
const Discord = require('discord.js');
client.on("interactionCreate", async interaction => {
if (interaction.isSelectMenu()) {
let choice = interaction.values[0]
const member = interaction.member
const guild = interaction.guild
我已经尝试了很多解决方案!他在V14!我将不发布整个代码,因为错误在这部分
我做了研究,想找到一个解决办法,但没有一个奏效
你需要制作一个客户端
const Discord = require(`discord.js`);
const client = new Discord.Client({
intents: [/*intentsArrayHere*/],
partials: [/*partialIntentsArrayHere*/]
});