feat: allow custom comment delete delay

This commit is contained in:
2018-11-01 10:50:07 -07:00
parent 0147ab1d9d
commit 5c842eccff

View File

@@ -8,8 +8,10 @@ export default async function createPullComment(repo, number, body, opts = {}) {
const comment = await createComment(repo, number, body); const comment = await createComment(repo, number, body);
logger.debug(`Created comment id ${comment.id}`); logger.debug(`Created comment id ${comment.id}`);
if (opts.delete) { const options = Object.assign({ delete: false, delay: 250 }, opts);
await sleep(100);
if (options.delete) {
await sleep(options.delay);
await deleteComment(repo, comment.id); await deleteComment(repo, comment.id);
} }