GithubHelp home page GithubHelp logo

pollmaubot's Introduction

Archiving since Matrix/Element have had poll support for a few years now

Poll Maubot

A plugin for maubot that creates a poll in a riot room and allows users to vote

Usage

'!poll new "Question" "Choice1" "Choice2" "Choice3"' - Creates a new poll with given (at least 1) choices

The user can now also create polls with line-breaks:

!poll new What is my question?
Choice1
Choice2
Choice3

'!poll results' - Displays the results from the poll

'!poll close' - Ends the poll

Users vote by adding the matching emoji to the poll (i.e. if the first choice has a ๐Ÿ‘ then in order to pick that choice the user has to react with ๐Ÿ‘)

Version 3.0 (Latest release)

  • Made emoji options more accessible
  • Bot now reacts to itself with emoji options
  • The user can now define emoji options
  • User can define answers with line-breaks rather than quotes

Older Releases:

Version 2.0

  • Changed voting format to reactions (instead of '!poll vote')

Version 2.0.1

  • Allows every room to have unique poll

Wish List

  • Add user configuration to only allow certain users to create polls
  • Add auto-timing ability
  • Make emojis configurable
  • Add placeholder emojis on each poll (to let users just click one)

pollmaubot's People

Contributors

bertiebaggio avatar jojoob avatar tomcasavant avatar williamkray avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pollmaubot's Issues

Reaction-based polls

Reactions now landed in all Riot releases, so will be good to implement mode for vote to poll via reactions to initial message. So bot check poll items and add reactions via emoji symbols: 1๏ธโƒฃ 2๏ธโƒฃ 3๏ธโƒฃ and as results - count number of same reactions from other users.

Option to not randomize the emojis?

By using random emojis each time a poll is created, the user is burdened with the task of finding the emojis each time.
It would be good to have the option to always use the same (quick reaction) emojis, for example.

Exception in MessageEvent reply()

Last Maubot update seems to have changed the reply() params.
I got this error:

Traceback (most recent call last):
  File "/home/pi/mxbots/lib/python3.7/site-packages/mautrix/client/client.py", line 188, in dispatch_manual_event
    await handler(data)
  File "/home/pi/mxbots/lib/python3.7/site-packages/maubot/handlers/command.py", line 105, in __call__
    ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
  File "/home/pi/mxbots/lib/python3.7/site-packages/maubot/handlers/command.py", line 122, in __call_subcommand__
    remaining_val=remaining_val)
  File "/home/pi/mxbots/lib/python3.7/site-packages/maubot/handlers/command.py", line 113, in __call__
    return await self.__mb_func__(self.__bound_instance__, evt, **call_args)
  File "/home/pi/mxbots/plugins/casavant.tom.poll-v1.0.0.mbp/poll.py", line 85, in handler
    await evt.reply(response, html_in_markdown=True)
TypeError: reply() got an unexpected keyword argument 'html_in_markdown'

from maubot/matrix.py repo:

def reply(self, content: Union[str, MessageEventContent],
		  event_type: EventType = EventType.ROOM_MESSAGE, markdown: bool = True,
		  allow_html: bool = False) -> Awaitable[EventID]:
	return self.respond(content, event_type, markdown=markdown, reply=True,
						allow_html=allow_html)

commit which made the changes:
maubot/maubot@1d03fd8#diff-ba5078c6c9a3d6373e6d25edb3a77bca

Use line break as alternative items separator

Now bot parse poll title and items via quotes, this is not so user friendly. Will be good to have alternative mode via line breaks, so first line is topic, each second line is option:

!poll new Poll topic text
Choice 1
Choice 2 long text
Choice 3 longer longer text

And for multiline text we may still use quotes:

!poll new "Poll topic text
second line of topic"
Choice 1
"Choice 2 multiline
item
text"
Choice 3 longer longer text

Or \ at end of line (for programmers ๐Ÿ™‚):

!poll new Poll topic text\
second line of topic
Choice 1
Choice 2 multiline\
item\
text
Choice 3 longer longer text

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.