on("chat:message", function(msg) {
    if (msg.type == "api") {
        if (msg.content.indexOf("!pic") === 0) {
            let picSrc = getObj("graphic", msg.selected[0]._id);
            sendChat(msg.who, "<img src='" + picSrc.get('imgsrc') + "'>");
        }
    }
});

위의 스크립트를 api 스크립트 추가하는 곳에 추가하신 뒤,

토큰을 선택하고 채팅창에 !pic를 입력하시면 해당 토큰의 이미지가 채팅창에 출력됩니다.

+ Recent posts