This commit is contained in:
syuilo
2018-06-18 09:54:53 +09:00
parent a766faeae9
commit 80e5645a84
150 changed files with 305 additions and 2334 deletions

View File

@ -11,7 +11,7 @@ const handler = new EventEmitter();
let bot: IUser;
const post = async text => {
const post = async (text: string) => {
if (bot == null) {
const account = await User.findOne({
usernameLower: config.github_bot.username.toLowerCase()
@ -90,7 +90,7 @@ handler.on('push', event => {
case 'refs/heads/master':
const pusher = event.pusher;
const compare = event.compare;
const commits = event.commits;
const commits: any[] = event.commits;
post([
`Pushed by **${pusher.name}** with ?[${commits.length} commit${commits.length > 1 ? 's' : ''}](${compare}):`,
commits.reverse().map(commit => `・[?[${commit.id.substr(0, 7)}](${commit.url})] ${commit.message.split('\n')[0]}`).join('\n'),