Skip to content

폭탄 도배는 처리 못하나요? #363

Answered by raravel
ggoek34 asked this question in Q&A
Discussion options

You must be logged in to vote

저는 해당 이슈때문에 한 번 삭제한 메시지는 저장합니다.
그리고 다른 카톡방 이용자가 가려지지 않은 메시지를 답장으로 !삭제명령어를 입력하면 해당 메시지를 한 번 더 가리도록 하는 명령어를 추가했었습니다.

V3 버전을 사용했었을 때 코드입니다.

https://github.com/raravel/kakao-bot-node/blob/65fb47122eeff7730e44d0937106c6a65bd914ec/modules/cmd.js#L139-L184

...
"삭제": async (chat, sender, client) => {
    let rtn = '';
    switch ( chat.channel.getMemberType(sender) ) {
        case kakao.OpenMemberType.OWNER:
        case kakao.OpenMemberType.MANAGER:
        default:
            if ( chat.Type === kakao.ChatType.Reply ) {
                const logId = chat.Reply.SourceLogId;
                const idx = global.hideStack.findIndex((c) => c.id === logId.toString());
                const rmChat = g…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@ggoek34
Comment options

Comment options

You must be logged in to vote
1 reply
@ggoek34
Comment options

Comment options

You must be logged in to vote
1 reply
@ggoek34
Comment options

Answer selected by ggoek34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants