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

import com.yutou.qqbot.Annotations.UseModel;
import com.yutou.qqbot.models.Model;
import com.yutou.qqbot.models.audio.QQAudio;
import com.yutou.napcat.event.MessageEvent;
@UseModel
public class Audio extends Model {

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

    @Override
    public String[] getUsePowers() {
        return new String[]{
                QQGroupCommands.QQ_AUDIO,
                QQGroupCommands.QQ_AUDIO_OPEN_LAMP,
                QQGroupCommands.QQ_AUDIO_OPEN_AIR
        };
    }

    @Override
    public String getModelName() {
        return "音频播放";
    }

    @Override
    public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
        super.onMessage(qq, event, isGroup);
        switch (msg){
            case QQGroupCommands.QQ_AUDIO_OPEN_LAMP -> QQAudio.playText("小爱同学，开灯");
            case QQGroupCommands.QQ_AUDIO_OPEN_AIR -> QQAudio.playText("小爱同学，开空调");
            default -> {
                if(msg.startsWith(QQGroupCommands.QQ_AUDIO)){
                    QQAudio.playText(msg.replace(QQGroupCommands.QQ_AUDIO, ""));
                }
            }
        }
    }
}
