second commit

This commit is contained in:
itismadness
2018-11-06 04:55:32 +06:00
parent a22717d951
commit 5f5ae61975
3 changed files with 22 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
node_modules/
settings.json

View File

@@ -1,4 +1,17 @@
const fastify = require('fastify')();
const irc = require('irc-upd');
const settings = require('./settings');
const client = new irc.Client('irc.orpheus.network', settings.username, {
channels: settings.channels
});
client.addListener('registered', () => {
if (settings.nickserv) {
client.say('nickserv', `IDENTIFY ${settings.nickserv}`);
}
});
fastify.get('/', async (req, reply) => {
return { hello: 'world' }
@@ -7,6 +20,7 @@ fastify.get('/', async (req, reply) => {
fastify.post('/', async (req, reply) => {
console.log(req.body['test']);
console.log(req.headers);
client.say('#develop', `New Github Event from ${sender.login}`);
return { message: 'posted' };
});

7
settings.json.sample Normal file
View File

@@ -0,0 +1,7 @@
{
"username": "GithubBot",
"nickserv": "some_long_string",
"channels": [
"#develop"
]
}