GithubHelp home page GithubHelp logo

ericthelemur / votebot Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 6.0 166 KB

Discord bot for polls and votes including STV. Supports hiding results and is written with Discord.py

License: GNU General Public License v3.0

Python 100.00%
discord discord-py python voting stv vote

votebot's Introduction

VoteBot

Discord voting bot capable of standard polls, as found in many other bots; anonymous polls, where votes are hidden and totals are only displayed at the end; and STV (Single Transferable Vote) polls, where users rank their choices, which is combined to find your set of winning options. This all supports up to 256 options, though due to Discord's message and API restrictions, large numbers of options are discouraged due to the time it will take to post the messages and add the reactions. This bot also supports limiting votes per user and a variable number of winners for STV.

I plan to support other voting methods (including STV variants) in the future. Currently, the STV ruleset supported is taken from Scottish Local Elections. I also plan to improve handling of reaction counting, as multiple simultaneous votes can lead to some being ignored.

Quick Poll Example

image

Anonymous Poll Example

image

image

STV Poll Example

image

image

votebot's People

Contributors

ericthelemur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

votebot's Issues

On Start: TypeError: 'type' object is not subscriptable

Hi,
thank you for this work! It looks exactly like what i need.
Unfortunately I running into an issue trying to run it. It happens after the bot connected to the database.

~/VoteBot % python3 votebot.py                                                                                             
PG Ran ./db/build.sql                                                                                                                     
Traceback (most recent call last):                                                                                                        
  File "votebot.py", line 10, in <module>                                                                                                 
    from voting import voteDB                                                                                                             
  File "/home/discord/VoteBot/voting/voteDB.py", line 21, in <module>                                                                     
    def addVote(creator: discord.User, question: str, options: list[str], limit: int, guild: discord.Guild, channel: discord.TextChannel, 
stage: int = 0, type: int = 1, num_win: int = 1, title_pre: str = "Poll") -> tuple[int, str]:                                             
TypeError: 'type' object is not subscriptable                                                                                             

I am running Python 3.8.10. Is there any specific versino required? Or maybe special setting or something that i need to consider?

Thank you!

OperationalError | Help please

I am trying to integrate your VoteBot commands to my personal server bot. Upon running though, I encounter this error:

image

Seems the error is on db. I have no prior experience with handling databases so I don't quite know what to ask or what to Google for. What can I do please or if you can't help personally, could you maybe link some resources that might help me out?

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.