teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

 

2023/01/21 14:18

投稿

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

1

2023/01/21 14:17

投稿

退会済みユーザー
answer 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