phpmx / phpmxbot

A Slack bot for the PHP Mexico Community.
3 stars 7 forks source link

Add greeter functionality #28

Closed eruizdechavez closed 3 years ago

eruizdechavez commented 3 years ago

Adds dynamic Greeter functionality by creating an event listener for member_joined_channel and registering the messages in the DB in a new greeter table.

The greeter table consists of the following fields:

Field Drescription
channel The channel where a new user joins. If we want to greet new Slack users, we can add a message to #general.
message The message to send to the user. Supports 2 dynamic replacements: {user} and {channel} which will be replaced with the actual user and channel handles.
order An event can have 2+ messages associated with it (send channel and dm, or multiple messages). This field is used to determine the order in which messages are sent.
method The message is send as private message unless the value of method is set as channel.

This pull request requires a migration. To run migrations, execute ./migrate.sh in the project folder.

Resolves #14.

dmouse commented 3 years ago

@javleds @gueroverde le pueden echar un ojo?

javleds commented 3 years ago

@javleds @gueroverde le pueden echar un ojo?

@dmouse @eruizdechavez El PR se ve bien, solo tengo una duda, me he perdido los meetings de planificación.

El bot solo va a tener soporte para SQLITE o se pretende que sea "flexible"?

En caso de ser flexible, probablemente valga la pena comenzar a crear interfaces y repositorios para almacenar queries, de lo contrario, todo bien.

eruizdechavez commented 3 years ago

@javleds de momento no tengo planes de darle soporte a otro motor de DB, pero si consideran necesario que se cambie, con gusto lo empezamos a planear.

jashk commented 3 years ago

Yo lo veo bien, si a futuro soportamos otras DB en ese momento hacemos el refactor, no creo que ahora haga falta adelantarnos.