Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit 7a11495

Browse files
committed
修改天行机器人回复
1 parent f2c0415 commit 7a11495

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

superagent/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ async function getReply(word) {
9696
});
9797
let content = JSON.parse(res.text);
9898
if (content.code === 200) {
99+
let res = content.newslist[0]
99100
let response = '';
100-
if (content.datatype === 'text') {
101-
response = content.newslist[0].reply
102-
} else if (content.datatype === 'view') {
101+
if (res.datatype === 'text') {
102+
response = res.reply
103+
} else if (res.datatype === 'view') {
103104
response =`虽然我不太懂你说的是什么,但是感觉很高级的样子,因此我也查找了类似的文章去学习,你觉得有用吗<br>《${content.newslist[0].title}${content.newslist[0].url}`
104105
} else {
105106
response = '你太厉害了,说的话把我难倒了,我要去学习了,不然没法回答你的问题';

0 commit comments

Comments
 (0)