From 5a51e4009de443f091ccc327d8e8367d6dfea490 Mon Sep 17 00:00:00 2001 From: tatoberres Date: Sat, 15 Oct 2022 20:37:11 +0200 Subject: [PATCH] added behaviors documentation on README.md --- README.md | 12 +++++++++++- src/behaviors/fto.js | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2412e63..2580bd7 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,20 @@ Prints out the help messages of the modules whose names have been specified. If ### First Timers Only `trigger` **message** -`keyword` **fto** +`keyword` **fto repo-name** Prints out all the issues in the specified publiclab repositories labelled 'first-timers-only'. If no repositories are mentioned, the user is asked to do so. +### Approve +`trigger` **message** +`keyword` **approve nickname** +Moderators only: sends an unquiet command so a user can post messages, and a voice confirmation. + +### Version +`trigger` **message** +`keyword` **version** +Prints out Plotsbot package version. + ## Submitting Behaviors If you want to submit your own behavior, your pull request needs to be self-contained. That is, it requires the following essential components: diff --git a/src/behaviors/fto.js b/src/behaviors/fto.js index 8870f89..994ea9e 100644 --- a/src/behaviors/fto.js +++ b/src/behaviors/fto.js @@ -23,7 +23,22 @@ module.exports = ({ github }) => { if (options.length > 0) { return Promise.all(options.map(ftoRepo)).then(repos => repos.join('\n\n')); } else { - return 'You need to mention the name of a repository.'; + let answer = 'You need to mention the name of a repository.'; + + // github.repos.getForOrg({org: 'publiclab',}) + // .then(data=>{ + // let names = ''; + // data.data.map(repo=>{ + // if (repo.visibility === 'public' && repo.has_issues) { + // names += repo.name + // // Promise.all(repo.map(ftoRepo)).then(repo => console.log('repo', repo)); + // answer += `\n${repo.name}: ${repo.description}`; + // } + // }) + // }).catch(err => { + // console.log(err) + // }); + return answer; } };