Giter Club home page Giter Club logo

fisherman-discord.js's Introduction



fisherman


javascript style guide

Fisherman - Discord.js

npm install --save fisherman-discord.js

Copyright © 2017, Simon Sassi

What is Fisherman

standard-js

a lightweight, fast, and powerful discord command router written in javascript standard style and inspired by expressjs

Fisherman features :

  • Use native RegExp to match with the prefixe(s)

  • Powerful middleware/plugin chain using fastfall

  • Entirely written in javascript language style

  • FisherCodes (status handling) events, same as http codes handling

  • Request/Response/Router prototypes can be edited from everywhere

  • Bunch of middlewares, like bot typing, embed compatibility, command loader etc...here

  • Documentation with a tutorial

  • Inspired by expressjs and klein, express command creation style with request/response statements (see example below), to be simple

  • Promised commands, custom pattern matching with patternCallback option etc...

var bot = new fisherMan.Fisherman({ prefixes: ['fish!'] }) // creating a client, with the prefixe "fish!"
bot.use(middleware) // appending a middleware/plugin to fisherman
var register = bot.createRegister('test', 'test') //creating a register named "test"
console.log('registerCreated')
register.textCommand('test', null, function (req, res) { // registering a new command, named "test"
//This command will be trigerred by "fish!test". It is only available in a text channel.
  res.send(`Command infos:\nName: ${req.command.name}\nRegister name: \`${req.command.register.name}\`\nTotal command count in the fisherman client: ${req.client.commands.size}`, { embed: { description: 'This request was made through the fishman project' } })
})
register.textCommand('ping', null, function (req, res) { //registering a new command named "ping"
  var current = Date.now()
  res.send('Pinging......').then((message) => {
    message.edit((Date.now() - current) + 'ms')
  })
})
bot.init('_token_') //logging in with the token
bot.on('fisherCode', function (router, code, err) { //displaying the fishercodes trigerred
  router.response.send('fisherCode ' + code + '\nError message: ' + err.message)
})

Documentation

Discord server

Quick tutorial

Documentation link

Api docs

Middleware list

The middleware list is available here

fisherman-discord.js's People

Contributors

maxerbox avatar

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.