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

質問編集履歴

3

エラーメッセージの貼り付けミス

2021/01/27 11:07

投稿

LimHK
LimHK

スコア0

title CHANGED
File without changes
body CHANGED
@@ -6,8 +6,7 @@
6
6
  ### 発生している問題・エラーメッセージ
7
7
 
8
8
  ```
9
- (node:16908) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
10
- (node:16908) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
9
+ (node:18295) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
11
10
  ```
12
11
 
13
12
  ### 該当のソースコード

2

ソースコードの修正

2021/01/27 11:07

投稿

LimHK
LimHK

スコア0

title CHANGED
File without changes
body CHANGED
@@ -13,9 +13,11 @@
13
13
  ### 該当のソースコード
14
14
 
15
15
  ```js
16
- client.on("message", message => {
16
+ client.on("message", async message => {
17
17
  if (message.content === "!del") {
18
+ const messages = await message.channel.messages.fetch({ limit: 10 })
18
- message.channel.bulkDelete(100);
19
+ message.channel.bulkDelete(messages)
20
+ }
19
21
  }
20
22
  });
21
23
 

1

????マークの追加

2021/01/27 11:05

投稿

LimHK
LimHK

スコア0

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,7 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
3
  Discord.jsで以下のコードが動きません。
4
- テストのために一番シンプルにしてもどこが悪いのかわかりません
4
+ テストのために一番シンプルにしてもどこが悪いのかわかりません
5
5
 
6
6
  ### 発生している問題・エラーメッセージ
7
7