1.1.0 • Published 3 years ago

laffey v1.1.0

Weekly downloads
22
License
MIT
Repository
github
Last release
3 years ago

Laffey

:office: | Webhook handler for discord.boats

Example

const { Server } = require('laffey');

const handler = new Server(7700, '/webhook', {
  token: 'youshallnotpass'
});

handler
  .on('vote', (voter, bot) => console.log(`${voter.username} has voted ${bot.name}`))
  .on('listen', () => console.log(`Listening on port ${handler.port}`))
  .listen(); // It listens and emits the listen event /\

Express Example

const { express: laffey } = require('laffey');
const express = require('express');

const app = express();
app.use(express.json());
app.use(laffey({
  callback: (error, bot, voter) => {
    if (error) return console.error(error);

    // vote logic is here
  },
  token: 'any random token you wanna set',
  path: '/votes'
}));

app.listen(3000, () => console.log('localhost:3000'));

License

laffey is released under the MIT License. Read here for more information.

1.1.0

3 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago