久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

運行 discord.js 節點不斷返回 ReferenceError: Intents

Running a discord.js node keeps returning ReferenceError: Intents is not defined(運行 discord.js 節點不斷返回 ReferenceError: Intents is not defined)
本文介紹了運行 discord.js 節點不斷返回 ReferenceError: Intents is not defined的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我是制作 Discord.js 機器人的絕對初學者.目前我正在嘗試第一次運行教程機器人,但我不斷收到 ReferenceError: Intents is not defined for the following source code.

I am an absolute beginner to making a Discord.js bot. Currently I'm trying to run a tutorial bot for the first time but I keep getting ReferenceError: Intents is not defined for the following source code.

const Discord = require('discord.js');

const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.DIRECT_MESSAGES, Discord.Intents.FLAGS.GUILD_MESSAGES] });

client.once('ready', () => {
    console.log('Ready!');
});

client.login('token here');

這是我的完整錯誤日志:

Here's my full error log:

ReferenceError: Intents is not defined
    at Object.<anonymous> (C:UsersduybasourceDiscordBotmain.js:2:47)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47

感謝您的關注.

推薦答案

目前版本為 13.1.0.您必須從包中導入標志.

In version 13.1.0 at this date. You must import the flags from the package.

const { Client, Intents } = require('discord.js');

如圖所示

這篇關于運行 discord.js 節點不斷返回 ReferenceError: Intents is not defined的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 一区二区三区四区国产 | 午夜精品一区二区三区在线视 | 日韩av成人| 国产一区二区不卡 | 国产精品美女久久久久久免费 | 日韩插插 | 国户精品久久久久久久久久久不卡 | 超碰最新在线 | 97色在线观看免费视频 | 精品日本中文字幕 | 久久久免费| 精品国产18久久久久久二百 | 九九久久精品视频 | 亚洲精品久久久久中文字幕欢迎你 | 中文字幕不卡视频在线观看 | 久久久久久91 | 亚洲精品亚洲人成人网 | 日本免费一区二区三区 | 精品粉嫩aⅴ一区二区三区四区 | 日韩av看片| 剑来高清在线观看 | 淫片一级国产 | 国产免费a视频 | 精品成人一区 | 日本午夜在线视频 | 中文字幕 国产 | 久草新在线 | av激情在线| 欧美中文一区 | av片免费观看 | 99精品欧美一区二区三区综合在线 | 欧美色图另类 | 日韩三级一区 | 国产精品美女久久久免费 | 亚洲欧美一区二区三区在线 | 欧美一区二区三区国产精品 | 精精国产xxxx视频在线播放7 | 亚洲精品久久久久久下一站 | 欧美一区二区三区在线 | 精品国产乱码久久久久久丨区2区 | 99婷婷|