質問編集履歴
1
getMessageContentを使用した
title
CHANGED
File without changes
|
body
CHANGED
@@ -51,4 +51,27 @@
|
|
51
51
|
|
52
52
|
app.listen(PORT);
|
53
53
|
console.log(`Server running at ${PORT}`);
|
54
|
+
```
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
(追記)
|
59
|
+
|
60
|
+
getMessageContentを使用して以下のように★付近のコードを変更しました。
|
61
|
+
```python
|
62
|
+
|
63
|
+
if (event.message.type == "image"){
|
64
|
+
|
65
|
+
return client.getMessageContent(event.message.id).then((stream) => {
|
66
|
+
stream.on('data', (chunk) => {
|
67
|
+
//console.log(chunk);
|
68
|
+
fs.writeFile("./out/test.jpg",chunk,"binary",(error)=>{
|
69
|
+
if(error){
|
70
|
+
console.log("error");
|
71
|
+
}
|
72
|
+
})
|
73
|
+
})
|
74
|
+
})
|
75
|
+
|
76
|
+
|
54
77
|
```
|