Code Monkey home page Code Monkey logo

webhooks-node's Introduction

DEPRECATED

The website this module is for has shutdown.

Laffey

๐Ÿข | 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.

webhooks-node's People

Contributors

davidcralph avatar renovate-bot avatar roeelupo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

webhooks-node's Issues

[Proposal]: Move to JavaScript

The only reason is because of lightweight (even tho TS, Node types, and wumpfetch are lightweight but I wanna add Storages)

error with null coalescing on v0.1.2

I got this on laffey 0.1.2

/opt/eventbot/node_modules/laffey/build/Laffey.js:27
        this.storage = options.storage ?? new MemoryStorage_1.default();
                                        ^
SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:891:16)
    at Module._compile (internal/modules/cjs/loader.js:941:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)
    at Module.load (internal/modules/cjs/loader.js:822:32)
    at Function.Module._load (internal/modules/cjs/loader.js:730:14)
    at Module.require (internal/modules/cjs/loader.js:864:19)
    at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/opt/eventbot/node_modules/laffey/build/index.js:13:34)
    at Module._compile (internal/modules/cjs/loader.js:971:30)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.