TeamNovaSoft / discord-bot

Un bot de discord para automatizar algunas cosas en nuestros servidores
MIT License
2 stars 0 forks source link

Make a command for create polls using the bot #2

Closed heliomar-pena closed 2 weeks ago

heliomar-pena commented 3 months ago

Explanation

The bot should be listening to a command /vote-points.

When this command is called the bot should start a discord native poll with the title: "¿Cuantos puntos de esfuerzo le pondrías a esta tarea?", and should have 8 options: 1, 2, 3, 4, 5, 6, 7, 8 image.

It should also change the icon on the thread's title to an abacus: 🧮, so other users can see that in this thread is a poll in progress.

Screenshots

image

Checklist

This issue can be closed when the following tasks are complete:

@1 @test-user
@1 @test-user
@1 @test-user
@1 @test-user
@1 @test-user
@TaskCompleted

Blocked by

heliomar-pena commented 2 weeks ago

Currently the bot start a new votation with /vote-points.

Investigation:

Set the bot for listening when the poll is ended for changing the icon to a check icon when the poll has ended:

It is possible using the Event MessagePollVoteAdd, but seems like you have to set up the bot permissions properly to make it work

image

Mention the role @1 and mention the user one time for each point. For example if result if 5 Effort Points, then the bot should write: @addPoint @user in 5 messages

It is possible sending multiple messages, about the user that will be mentioned I think the easiest way is to fetch the thread main message description and get it with a regexp, other option is to pass it in the /vote-points command and then save it in the votation message, so you can only take it

Should be easy configure what role to call for add points and what role to call for mark task as ended

Better way is to move it to the .envs or a config file, .envs sounds more adecuate

At the end the bot should put @TaskCompleted

Also should be moved to .env file

heliomar-pena commented 2 weeks ago

Completed with investigation for further steps