feat: allow custom comment delete delay
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user