package com.yutou.qqbot.models.Commands.System;

import com.yutou.qqbot.Annotations.UseModel;
import com.yutou.qqbot.QQBotManager;
import com.yutou.qqbot.models.Model;
import com.yutou.qqbot.utlis.AppTools;
import com.yutou.napcat.event.MessageEvent;
@UseModel
public class Restart extends Model {
    @Override
    public boolean isUserPublic() {
        return false;
    }

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

    @Override
    public String getModelName() {
        return "重启服务(NAS)";
    }

    @Override
    public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
        super.onMessage(qq, event, isGroup);
        if(msg.equals(QQGroupCommands.QQ_SYSTEM_RESTART)){
            QQBotManager.getInstance().sendMessage(qq,"正在重启服务");
            AppTools.exec("cd /home/yutou/public/servier/tools && ./start.sh",null,true,false);
        }
    }
}
