diff --git a/index.ts b/index.ts index cc62554..6d7c300 100644 --- a/index.ts +++ b/index.ts @@ -22,6 +22,14 @@ app.post( '/', async ( req, res ) => { res.sendStatus( 200 ); } ); +app.post( '/github/', async ( req, res ) => { + console.log( 'received webhook', req.body ); + if (req.body.issue.url =! undefined) { + (await client.channels.fetch("01FE139SQHRFBG5TR8022BECRW")).sendMessage(`**${req.body.sender.login} :**\n> __[${req.body.repository.full_name} - Issue ${req.body.issue.title} was Updated](${req.body.issue.url})`) + } + res.sendStatus( 200 ); +} ); + // client.on('packet', async () => { // (await client.channels.fetch("01FE139SQHRFBG5TR8022BECRW")).sendMessage(`Why am I even logging this? Idk\n\`\`\`js\n{\n"date": "${Date.now()}",\n"a": "${client.users.name_}"\n}`) //});