package com.yutou.qqbot.models.Commands;

import com.yutou.qqbot.Annotations.UseModel;
import com.yutou.qqbot.QQBotManager;
import com.yutou.qqbot.data.baidu.ResponseMessage;
import com.yutou.qqbot.models.Model;
import com.yutou.qqbot.utlis.BaiduGPTManager;
import net.mamoe.mirai.event.events.MessageEvent;

@UseModel
public class BaiduGPT extends Model {

    @Override
    public boolean isUserPublic() {
        return true;
    }

    @Override
    public String[] getUsePowers() {
        return new String[]{
                QQGroupCommands.GPT,
                QQGroupCommands.GPT_CLEAR
        };
    }

    @Override
    public String getModelName() {
        return "百度文言一心GPT";
    }

    @Override
    public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
        super.onMessage(qq, event, isGroup);
        if (msg.equals(QQGroupCommands.GPT_CLEAR)) {
            BaiduGPTManager.getManager().clear();
            QQBotManager.getInstance().sendMessage(qq, "已经失忆捏");
        } else if (isAt()) {
            if(msg.contains("省流")|| msg.contains("总结")){
                return;
            }
            ResponseMessage message = BaiduGPTManager.getManager().sendMessage(String.valueOf(user), msg.replace("@2476945931", "").trim());
            QQBotManager.getInstance().sendMessage(qq, message.getResult());
        }
    }
}
