haecker-felix/hebbot

Editor can issue a report as a message

thibaultamartin opened this issue · 1 comments

When receiving the command !report message in the administrator room, the bot tries to read the template. If it cannot find the template, it answers with:

I could not find or read the template

If it finds the template, it reads it and replaces the {{report}} string with the generated report. It then answers with the generated report in the template.

The report is created as follows:

  1. The bot lists all sections that have at least one approved news
  2. For each section, the bot adds ## {{section title matching the emoji}} then for each news:
    1. [{{displayName of the reporter}}](https://matrix.to/#/{{matrixID of the reporter}}) reports that
    2. > {{message of thenews}}
    3. a line break
  3. Then the bot adds ## TO SORT
  4. For each approved news that doesn't have a section, the bot adds:
    1. [{{displayName of the reporter}}](https://matrix.to/#/{{matrixID of the reporter}}) reports that
    2. > {{message of thenews}}
    3. {{link to the message}}
    4. a line break

The bot then issues the report as a message in the admin room

Implemented ✔️