Giter Club home page Giter Club logo

d-reactor's Introduction

d-reactor's People

Contributors

tguichaoua avatar

d-reactor's Issues

Vote: fulfilled if all users vote

πŸš€ Feature Request

Is your feature request related to a problem? Please describe.
There is no way to submit a vote when all users have voted.

Describe the solution you'd like
Add an option on vote to pass a list of users that must vote or create a new method.
Fulfill the Reactor when all users has voted.

voteCommittee misbehaviour

🐞 Bug Report

Describe the bug
voteCommittee accept vote from anyone.

To Reproduce

client.on("message", async message => {
    const result = await voteCommittee(
        message.channel,
        "TEST",
        ["A", "B", "C"],
        [message.author],
        1
    );
    console.log(result);
});

Expected behavior
Only specified users can vote.

Additional context
The onCollect callback is called even if userFilter return false.

if (
internalOptions.userFilter &&
!internalOptions.userFilter(user)
)
await reaction.users.remove(user).catch(error);
if (internalOptions.onCollect) {
const action = internalOptions.onCollect({
collector,
reaction,
user,
});
if (action) {
if ("value" in action) {
doResolve({
status: "fulfilled",
value: action.value,
});
} else {
await Promise.all([
action.promise?.catch(error),
action.remove
? reaction.users
.remove(user)
.catch(error)
: undefined,
]);
}
}
}

Also voteCommittee accept an empty array for voters, that could create a soft lock of the reator.

Logger

πŸš€ Feature Request

Describe the solution you'd like
Create a logger to redirect all log call with event system.

export VoteElement

πŸš€ Feature Request

Describe the solution you'd like
export VoteElement in index.ts

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.