回答編集履歴

2

 

2023/01/21 14:18

投稿

退会済みユーザー
test CHANGED
@@ -18,7 +18,12 @@
18
18
  ```
19
19
  としてしまうと、変数 GatewayIntentBits には discord.js が エクスポートしているオブジェクトがバインドされてしまうので、うまく動作しません。
20
20
 
21
+ なので最初のように
22
+ ```js
23
+ const { GatewayIntentBits } = require("discord.js")
24
+ ```
21
- いは
25
+ とすか、
26
+ あるいは(冗長ですが)
22
27
  ```js
23
28
  const a = require("discord.js");
24
29
  const GatewayIntentBits = a.GatewayIntentBits;

1

2023/01/21 14:17

投稿

退会済みユーザー
test CHANGED
@@ -16,8 +16,7 @@
16
16
  ```js
17
17
  const GatewayIntentBits = require("discord.js")
18
18
  ```
19
- としてしまうと、変数 GatewayIntentBits には discord.js が エクスポートしているオブジェクト
19
+ としてしまうと、変数 GatewayIntentBits には discord.js が エクスポートしているオブジェクトがバインドされてしまうので、うまく動作しません。
20
- がバインドされてしまうので、うまく動作しません。
21
20
 
22
21
  あるいは
23
22
  ```js