Giter Site home page Giter Site logo

Comments (7)

diamondburned avatar diamondburned commented on June 6, 2024

What is this check API? Is it similar to middlewares for individual commands?

from arikawa.

ks129 avatar ks129 commented on June 6, 2024

Check is basically individual command middleware yes. This will be run before command execution and check must return boolean. true means the command will be executed, false means that no permissions and command will be not executed.

from arikawa.

diamondburned avatar diamondburned commented on June 6, 2024

Check feels very niche. Is there a reason why you're not doing it for only one command?

The router already has middleware support for the entire subcommand, if you want to use one middleware for multiple commands.

from arikawa.

ks129 avatar ks129 commented on June 6, 2024

@diamondburned I think this should be useful for cooldowns, and however, current most used libraries provide ways to make check, so I think this should be useful in here too. Like there is a group of commands, but one command of these is for only for VIP users, so you have to make a request to DB and fetch info about user, and this should not apply to every command in a group.

from arikawa.

diamondburned avatar diamondburned commented on June 6, 2024

I'm saying to just append the check at the start of the function. Other libraries don't take an approach like this, so doing such a feature is as easy as another condition check. This library is reflect-based, meaning it's already complex as it is.

I do plan on implementing command aliases soon, but I'll leave this issue open for aliases. PRs welcomed.

from arikawa.

diamondburned avatar diamondburned commented on June 6, 2024

Custom checks or middlewares to be implemented in #24, funnily enough.

I'll do aliases later, I suppose.

from arikawa.

ks129 avatar ks129 commented on June 6, 2024

Aliases are done in #107

from arikawa.

Related Issues (20)

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.