steem-js의 deleteComment api를 다음과 같이 사용하면 글 삭제가 되는 것 같습니다.
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
<script>
steem.api.setOptions({ url: 'https://api.steemit.com' });
const wif = 'your private posting key';
const author = 'chghl';
const permlink = '3zyrqg';
steem.broadcast.deleteComment(wif, author, permlink, function(err, result) {
console.log(err, result);
});
</script>
다만 제가 위 api를 이용해서 이 글을 삭제하려고 했으나 아래와 같은 에러가 발생하며 삭제가 되지 않네요..
Assert Exception:comment.net_rshares <= 0: Cannot delete a comment with net positive votes.
net_rshares는 글에 누군가 투표했을 때 +되는 값인데요, 지금 보니 한분이 이 글에 voting을 해 주셨네요.
잠깐사이에 테스트로 올린글에 voting을 해주시다니.. ^^;;
이것으로 누군가 투표한 글은 삭제할 수 없다는 사실을 알게되었습니다.
참고하세요~
Congratulations @chghl! You received a personal award!
Click here to view your Board of Honor
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @chghl! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit