Skip to content

List, Cancel and Close Handlers

Miguel Tenorio edited this page Nov 10, 2020 · 1 revision

List

The /list group command shows the names of the users who has voted.

Cancel

/cancel has a private and a group handler.

Private

As is stated in the config wiki, the use of /cancel stop the discussion's configuration process.

Group

Using /cancel in a group as an administrator cancels the current discussion if there is one, deleting all the data related to it.

Close

This handler gets the votes of the users who voted in the current discussion, selects the current model, and sends the result of processing the votes using the model to the group. Let's get into the details:

  1. Line 19 gets the votes:
votes = [v for v in context.chat_data['voters'].values() if v]
  1. Line 20 selects the current model:
model = context.chat_data.get('model')
  1. Line 21 get the result of processing the votes using the model.
solution = use_model(votes, model)

This handler also delete all the data related to the discussion once the result is send.