1.0.7 • Published 6 years ago

fisherman-discord.js v1.0.7

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

Fisherman - Discord.js

npm install --save fisherman-discord.js

Copyright © 2017, Simon Sassi

What is Fisherman

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

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0-k

7 years ago

1.0.0-j

7 years ago

1.0.0-i

7 years ago

1.0.0-h

7 years ago

1.0.0-g

7 years ago

1.0.0-f

7 years ago

1.0.0-e

7 years ago

1.0.0-d

7 years ago

1.0.0-c

7 years ago

1.0.0-b

7 years ago

1.0.0-a

7 years ago

1.0.0

7 years ago