GithubHelp home page GithubHelp logo

mieuxvoter / majority-judgment-bot-nimda-discord Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 0.0 374 KB

Discord bot to create polls using majority judgment.

License: GNU Lesser General Public License v3.0

Shell 0.98% PHP 97.18% Dockerfile 1.83%
discord bot majority-judgment majority-vote majority-judgement-voting poll

majority-judgment-bot-nimda-discord's People

Contributors

domi41 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

majority-judgment-bot-nimda-discord's Issues

Permissions & Roles

Right now the bot will happily serve anyone.

This task is open and consists of two parts:

  1. Describe what we need/want
  2. Implement it

Logging System

A bot needs a proper logging system.

We could also add a command hash for each command, to help peruse logs.

We'll ensure the docker image configures logrotate, and perhaps we'll switch to Monolog.

Docker configuration

We can probably go with FROM php:7.4-fpm-alpine and some docker-ext-install.

If anyone wants to take on the Dockerfile, or you have requirements, suggestions… please share !

Using Buttons instead of Reactions

That would be nice. It would enable private ballots and rapid curation (making sure there's no duplicates, see #5 ).

The Button feature is pretty recent, and I've not yet found it in third party libs.

Would require updating the discord driver ourselves or changing it altogether.
Or waiting a bit…

If anyone has more info about this, or want to take this on, go for it!

Curate the tallies of reactions

Right now the tally collector is naive and does not check duplicate participation, which can happen even with our toggle enforcer. (the bot may have been offline while reactions were added).

The !result command will need many (paginated) requests to Discord in order to get all the participants to each of the reactions (grades) of each of the proposals. As you may guess, this scales horribly.

In the end we may need two commands (or options), one for the "fast" result that may be a little wrong (what we have now), and one for the "curated" result that will be correct but may take a long time to collect.

Note that using Discord's Buttons instead of Discord's Reactions will probably make this issue moot. This is why we have not spent too much time on this. Our stack does not readily support Buttons at the moment, but Buttons are a very recent addition.

Publication of our bot URL to add it to any server

This bot is libre, so anyone may make their own, provided they jump through Discord's hoops to create a bot on their platform, and they manage to install and run this codebase.

The bot is not very resilient, in its current state.
Even without abuse intents, there will be crashes and failures to address.

So the bots needs to be used and prodded by trusted and forewarned users for a little while,
It's hard to guess for how long, or how many uses.

I suggest the following plan :

Private Alpha

The bot URL to install it is given by members of MieuxVoter to select collaborators, with their word not to share it.

Public Beta

The bot URL is available, and channel restrictions are in-place to avoid flooding and crashing the bot for everyone.

Release

We're confident the bot can sustain the load, and release it on Twitter or something.

Commands cooldowns

The !result command will need many requests to Discord in order to get all the participants to each of the reactions (grades) of each of the proposals. As you may guess, this scales horribly.

A poll with thousands of participants may take many minutes to collect.

Right now the tally collector is naive and does not check duplicate participation, which can happen even with our toggle enforcer. (the bot may have been offline while reactions were added)
But it is also fast, and it scales much better.

In any case, expensive commands such as !result should be constrained by a cooldown, since it is a building brick for better tally curation.

Configuration Command

That would be nice.

!config set grades πŸŒ‘ πŸŒ’ πŸŒ“ πŸŒ” πŸŒ•
!config set defaultGrade [0-N]|worst|best|median|normalized

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.