GithubHelp home page GithubHelp logo

phpmx / phpmxbot Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 7.0 904 KB

A Slack bot for the PHP Mexico Community.

Dockerfile 0.02% PHP 99.66% Shell 0.33%
hacktoberfest php sqlite botman slack docker ngrok adminer flyway

phpmxbot's Introduction

phpmx/phpmxbot

A Slack bot for the PHP Mexico Community.

This project, built by the community and for the community, uses the following languages, tools, and services:

You can start contributing to this project by following the Quick Start guide below, or read the Wiki for a more detailed description and documentation.

Quick Start

  1. Clone this repo in your computer.
  2. Run ./bootstrap.sh
  3. Start the local bot and ngrok processes with docker-compose up.
  4. (Only the first time) Setup your Slack Application.

Contribute

Please feel free to submit pull requests or open issues.

Code of Conduct

Help us keep this project open and inclusive. Please read and follow our Code of Conduct.

Run tests

Once the container of bot it's running on background please type the next command:

docker-compose exec bot ../vendor/bin/phpunit ../tests

phpmxbot's People

Contributors

dmouse avatar eruizdechavez avatar gueroverde avatar iscrivera91 avatar jashk avatar javleds avatar manuelojeda avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

phpmxbot's Issues

Add a web leaderboard

Similar to what we have with plusplus today, we should have a web version of the leaderboard where we can see points, and maybe some other stats (monthly, yearly, all time).

Log all leaderboard changes to a table

Instead of just adding or subtracting points to the leaderboard entries, we would also like to keep a history of changes in an independent table. This will allow us to extract some statistics on the points, historic trends, etc.

Hosting / CI / CD

I am happy to host the bot on my VPS while we figure out a proper place to host it and deploy it.

I would love to have a staging and prod setup. Also, at some point I would also want to have some testing in place.

Ideas?

  • Hosting
  • CI / CD

Add Greeter functionality

I believe someone mentioned that we could use the bot also to welcome new members that join the community. This can be done very easily by adding an event handler for workspace join, or simply by adding a channel join listener for #general (all members must be at the very least in this channel.

Some highlights that can be useful:

  • Message can be setup in a new options table in the DB.
  • This could also be helpful to add special greetings for special channels, like #bolsadetrabajo, #ayuda-tecnica, #meetup, etc.

Restrict self ++

Users must not be able to add points (++) to themselves, but they can remove points from themselves (--).

Reorganize and autoload routes

Currently, index.php has all the "routes" in it. To improve reusability and extensibility this should be done in route files that get loaded and initialized automatically (like plugins).

Update reactions handler

Positive reactions (👍🏻, 👏🏻, ✋🏻, 🙋🏻‍♂️, 🙋🏻‍♀️, 🙋🏻) ( ➕ )

If a user adds any of the positive reactions to a message with one or more point changes (++, --) the bot will repeat the action in the message as if the user adding the reaction had written the same message.

Negative reactions (👎🏻, 🙃) ( ➖ )

If a user adds any of the negative reactions to message with one or more point changes (++, --) the bot will repeat the action in the message as if the user adding the reaction had written the same message, BUT the points will be inverted (that is, all ++ become --, and -- become ++).

Inappropriate reactions (🖕🏻)

If a user adds any of the inappropriate reactions to a message, the user will be penalized with -100 points for inappropriate behavior.

Removing reactions

If a user decides to remove one of the above reactions, the bot must effectively undo the changes done when the reaction was added by the user (with the exception of the inappropriate reactions).

Configuración del Bot

¡Que tal, equipo!

En el PR #34 se habla de una tabla de configuración en SQL para almacenar los diferentes mensajes de respuesta en la conversación de PlusPlus, se sugiere una columna por cada tipo de mensaje en vez de tener una tabla dedicada para puros mensajes.

Suena genial, pero antes de crear esta tabla de configuraciones, me gustaría saber lo siguiente:

  • ¿Cuál es la idea original de la configuración del Bot?
  • ¿Cuántas/Qué cosas se van a poder configurar en el Bot?
  • ¿De que manera se van a realizar las modificaciones de esta configuración, es decir, habrá una interfaz de usuario, será a través de pull request o será a través de comandos del mismo Bot?

Me gustaría hacer algunas sugerencias dependiendo de las respuestas que se tengan.

Document Slack setup

Document Slack setup details in the Wiki so others can follow those steps. I'll add in a follow up comments my current setup (oauth scopes, etc.) so we can write a good documentation page.

Reset leaderboard

Once we have the changes log in place, we need to automatically (or via bot or slash command) reset the leaderboard after X time. This will allow new members to climb the score board as opposed to be nearly imposible pass oldest members.

Discover and list PlusPlus functionality

In order to get the points handler in the bot to a good state, I would like to have a list of all existing functionality on the existing PlusPlus bot so that we can decide if we want all of it, or if we want to deprecate certain pieces.

So far some bits and pieces have surfaced over discussions in Slack, but I do not have a comprehensive list.

As far as I know these are missing on the new points handler:

  • Self ++ and --
  • Special case: ++--
  • Responses by PlusPlus when adding or removing points
  • Ignore inline code and code blocks (this could get a bit tricky)

Am I missing others?

Update points notification

When a user performs an action that adds or subtracts points, the bot will send a message to the channel where the change was originated.

To avoid spam in the channel, when other uses repeat the action via reactions, the bot should try to update its own message instead of adding multiple notifications.

Update notification messages

Add randomly selected messages when the bot notifies about ++ or -- changes.

++ messages:

    '¡Felicidades!',
    '¡Lo tienes!',
    'Bravo.',
    'Bien hecho.',
    '¡Gran trabajo!',
    'Exquisito.',
    'Encantador.',
    'Soberbio.',
    '¡Clásico!',
    'Notorio.',
    '¡Bien, bien!',
    'Bien jugado.',
    'Mis más sinceras felicitaciones.',
    'Delicioso.',
    ':nice:',
    ':nyan:',
    ':party'

-- messages:

    '¿De verdad?',
    'Oh :slightly_frowning_face:.',
    'Ya veo.',
    'Ouch.',
    'Eso duele.',
    'Oh.',
    'Que mal.',
    'Mis condolencias.',
    'Suerte para la próxima',
    ':trollface:',
    ':sadpanda:'

Self messages (depends on #22)

    'Hahahahahahaha no.',
    'Nope.',
    'No. Simplemente no.',
    ':facepalm:',
    ':wat:'

Add Unit Tests

We need to have some basic unit test coverage at the very minimum.

I have no previous experience with any test framework on PHP, so any help is really appreciated!

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.