Skip to content

Commit

Permalink
fix: 修复超限后消息发送失败
Browse files Browse the repository at this point in the history
  • Loading branch information
fengxiang.zfx committed Feb 18, 2023
1 parent a44519b commit de19079
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ const AI_THINKING_MESSAGE = '我已经在编了,请稍等几秒后复制原文
const LIMIT_AI_TEXT_COUNT = 10;
const LIMIT_AI_IMAGE_COUNT = 5;

const LIMIT_COUNT_RESPONSE =
'VG4Da7eC09_44p8iG0ChFWp_KIfIC1sF9K3gJz49yajrc30qWhqPYXMzcakSK-qC';
const LIMIT_COUNT_RESPONSE = '对不起,因为ChatGPT调用收费,您的免费使用额度已用完~'

const configuration = new Configuration({
apiKey: '##your api key##',
Expand Down Expand Up @@ -226,20 +225,6 @@ router.post('/message/post', async ctx => {
getAIMessage({ Content, FromUserName }),
]);

// 如果超额了,发送关注图片
if (message === LIMIT_COUNT_RESPONSE) {
ctx.body = {
ToUserName: FromUserName,
FromUserName: ToUserName,
CreateTime: +new Date(),
MsgType: 'image',
Image: {
MediaId: message,
},
};
return;
}

ctx.body = {
ToUserName: FromUserName,
FromUserName: ToUserName,
Expand Down

0 comments on commit de19079

Please sign in to comment.