我正在编写一个 Discord 机器人。当我尝试运行节点时,我在CMD中收到此消息窗口中看到以下内容:
\n\nC:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\discord.js\\src\\client\\Client.js:544\n抛出新的 TypeError(\'CLIENT_MISSING_INTENTS\');
\n
\n^类型错误 [CLIENT_MISSING_INTENTS]:必须为客户端提供
\n
\n有效意图。
\nat Client._validateOptions (C:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\\xe2\x86\x90[4mdiscord.js\xe2\x86\x90[24m\\src\\client\ \Client.js:544:13)
\nat 新客户端 (C:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\\xe2\x86\x90[4mdiscord.js\xe2\x86\x90[ 24m\\src\\client\\Client.js:73:10)
\nat 对象。(C:\\Users\\utente\\Desktop\\bouncerBot\\main.js:2:16) \xe2\x86\x90[90m at
\nModule._compile (internal/modules/cjs/loader.js:1072) :14)\xe2\x86\x90[39m \xe2\x86\x90[90m
\nat Object.Module._extensions..js
\n(内部/模块/cjs/loader.js:1101:10)\xe2\x86 \x90[39m \xe2\x86\x90[90m 在 Module.load
\n(内部/模块/cjs/loader.js:937:32)\xe2\x86\x90[39m \xe2\x86\x90[90m 在
\nFunction.Module._load (内部/modules/cjs/loader.js:778:12)\xe2\x86\x90[39m
\n\xe2\x86\x90[90m 在 Function.executeUserEntryPoint [as runMain]
\n(内部/模块/run_main.js:76:12)\xe2\x86\x90[39m \xe2\x86\x90[90m 在
\ninternal/main/run_main_module.js:17:47\xe2\x86\x90[39m {
\n[\xe2\x86\x90[32mSymbol(代码)\xe2\x86\x90[39m]: \xe2\x86\x90[32m\'CLIENT_MISSING_INTENTS\'\xe2\x86\x90[39m } \\C:\\Users\\utente\\Desktop\\bouncerBot>node 。
\n
\nC:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\discord.js\\src\\client\\Client.js:544
\n抛出新的 TypeError(\'CLIENT_MISSING_INTENTS\');
\n^ \\类型错误 [CLIENT_MISSING_INTENTS]:必须为客户端提供
\n有效意图。
\nat Client._validateOptions (C:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\\xe2\x86\x90[4mdiscord.js\xe2\x86\x90[24m\\src\\client\ \Client.js:544:13)
\nat 新客户端 (C:\\Users\\utente\\Desktop\\bouncerBot\\node_modules\\\xe2\x86\x90[4mdiscord.js\xe2\x86\x90[ 24m\\src\\client\\Client.js:73:10)
\nat 对象。(C:\\Users\\utente\\Desktop\\bouncerBot\\main.js:3:16) \xe2\x86\x90[90m at …
我正在尝试使用 disocrd 的 oauth2 创建登录系统。
这是我的代码:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', 'XXXXXXXXXXXXXXXXXXXXXX'); //Your client Id
define('OAUTH2_CLIENT_SECRET', 'XXXXXXXXXXXXXXXXXXXXXX'); //Your secret client code
$authorizeURL = 'https://discordapp.com/api/oauth2/authorize';
$tokenURL = 'https://discordapp.com/api/oauth2/token';
$apiURLBase = 'https://discordapp.com/api/users/@me';
session_start();
// Start the login process by sending the user to Discord's authorization page
if(get('action') == 'login') {
// Redirect the user to Discord's authorization …Run Code Online (Sandbox Code Playgroud) 您好,我正在尝试在我的网站中实现 firebase 实时数据库 API,我正在遵循此文档: https: //firebase.google.com/docs/database/admin/save-data#node.js但我收到此错误:
这是我的代码:
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.8.3/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.8.3/firebase-analytics.js";
import { getDatabase } from "https://www.gstatic.com/firebasejs/9.8.3/firebase-database.js";;
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "xxxxxxxxxxxxxxxxxxxxx",
authDomain: "xx.x.xxx",
databaseURL: "xxxxxxxxxxxxxxxx", …Run Code Online (Sandbox Code Playgroud)