Telegram push notifications based on Team/Team Member

hello @maimoonak ma’am

I have been exploring openmrs-module-team for quite some time. Here are few initial ideas that I would like to discuss

(i) We would be needing contact number of team members to add them to appropriate groups/broadcasting channel on the telegram. - Currently, openmrs-module-team does not support the feature for adding phone number of team members and has to be added as part of this project.

  • the database changes will be made in person table and all it will look like this:

(ii) As mentioned in ideas pages, each team can be associated with a bot. This can be done using telegram-API and JTele-bot orjava-telegram-bot-api. ((Please let me know other api that i should explore)

Telegram gives us three options to manage teams. (A)Groups( up to 200 members can be added in a group) (B)Supergroups (up to 1000 members can be added) ©Channels (unlimited amount of members can be added) We can decide to create any of these depending on requirements. (I am not sure how many members can be on a team)

(iii) Privileges: The openmrs-module-team comes with three privileges (A) Add Teams. (B) Edit Teams. © View Teams.

Add Teams Privilege can be given all the team members since the idea is to manage users in a hierarchy. The main team may have subteams thus, leader(may be decided by the main team) of subteam can have privileges to add his own team.

Edit Team privilege can be given to only team leaders.

View Team privilege can be given all the team members. This is for a reason that all the members can see members of another group so that if need be they can contact the right person in any team.

I am not sure if this feature has already been implemented, but if not then it would be good idea to implement it. The above privileges can be added manually, but if we automate it then this would save some time for team leaders and make our module more smart.

(iv) Since telegram provides a magnificent feature of sharing files (doc, zip, mp3, etc.) of up to 1.5 GB. We can use it to send files to the team, for instance, documents like minutes of a meeting etc. I guess that this feature will be used extensively.

Query: (1) As the messages should schedulable, you mentioned about IHS`s smstarseel module, I searched for it but could not find it, can you please attach a link so that I can explore it to get this feature. (2) As you mentioned in wiki page about messages to be on demand and also configurable . I did not understand it completely, can you please explain it ? :slight_smile:

I would love to refine these ideas. This project is very interesting as it connects people. Collaborating with other team members have helped me learn stuffs and I believe this project will benefit other people learn and do things effectively. These positive effects inspires me to do this project. :slight_smile:

Looking forward to refine these ideas and discussion.

Thank You, Pralay

3 Likes

(i) We would be needing contact number of team members to add them to appropriate groups/broadcasting channel on the telegram.

Yeh, we would require some sort of contact number mnagement. The person is core openmrs table we can not make changes to it. Also in openmrs we can add such attributes by using PersonAttributes model. We can add a global property to refer to contact number attribute that would be used as primary number.

(ii) As mentioned in ideas pages, each team can be associated with a bot. This can be done using telegram-API and JTele-bot or java-telegram-bot-api. (Please let me know other api that i should explore)

java-telegram-bot-api seems to be well documented and I would suggest going with that as we may not want be in a situation where lack of resources becomes a blocker.

Telegram gives us three options to manage teams.

We can make it configurable based on team size. i.e. if team is bigger it would be in corresponding group. It could then be changed from configuration page of module

(iii) Privileges: The openmrs-module-team comes with three privileges

The current privileges model is more of a native openmrs user-permssion management. We can create the model you suggested by adding three Roles i.e. Team Admin, Team Lead, Team Member which would have permissions according to your model, but openmrs allows to change permissions at any point of time. I would not suggest to get into much details of this part as role mangement is one of the trickiest part. We would have basic authentication and permissions to carry out specific task for each member. We can also add this as additional feature if other functionality is completed

(iv) Since telegram provides a magnificent feature of sharing files (doc, zip, mp3, etc.) of up to 1.5 GB. We can use it to send files to the team, for instance, documents like minutes of a meeting etc.

Perfect. Telegram also allows you to do surveys. We can look into it if we have time.

Query:

(1) As the messages should schedulable, you mentioned about IHS`s smstarseel module, I searched for it but could not find it, can you please attach a link so that I can explore it to get this feature.

Would share it within this week.

(2) As you mentioned in wiki page about messages to be on demand and also configurable . I did not understand it completely, can you please explain it ?

Say a team manager wants to send a message to all of his team members to stop data entry immediately, he should be able to do so instantly (simple message to his team) We may also want scheduled message those are sent automatically on specific events like notifications for public holidays, or reminder to submit monthly report to nearest community center, or to be ready for field visit happening every quarter…

Thank you @maimoonak ma’am for the reply.

One way to do it is, if a group is created then she/he can just type in the message in telegram group through telegram app. We may as well create support for sending message from openmrs-module-team. This privilege will only be given to Team Admin and Team Lead role.

Ma’am Regarding proposal, what are you expecting in it? I have few ideas regarding UI of openmrs-module-team after integrating telegram-api. I have few simple UI mockups in my mind. Regarding backend, i am exploring telegram-api, and trying to figure out how we can create group and add the members to it.

Please let me know any additional requirements that you have in mind so that i can add it in UI mockups and i can explore it’s implementation.

Thank You Pralay

1 Like

Thats cool. We may also want to revamp module UI for better experience.

If you could share mockups I would be able to provide feedback based on that. Since this is first version data support and functionality is more important.

For proposal important points are:

  • Why you are doing this project (problem statement)
  • What you are going to do (solution)
  • Features list
  • What currently exists
  • What is missing
  • How you are going to achieve that i.e. changes in model, new tables/bridges etc (diagrams recommended)
  • Basic features
  • Additional enhancement if we have time…
  • Timeline…

Hello @maimoonak Ma’am here are few UI mockups.

Home Page Of current openmrs-module-team, with added support of telegram.

Telegram Home Screen:

Create Telegram Groups of existing teams.

Support for sending message. Black Tick appears when all members are selected, green when only few are selected.

Support for sending message to specific team members

Support for scheduling message(not confirm as it depends on IHS`s smstarseel module as well)

Support for Viewing Scheduled Messages.

Support for Deleting Groups.

Please let me know your feedbacks on these. While making the UI I have tried to keep current openmrs-module-team functionalities seperate from new functionalities.

1 Like

Hello @maimoonak ma’am The problem statements states that > Each team can be registered as a “bot” which can send message to all members registered via UI in Team Management module. From backend point of view,after we add support of collecting contact numbers to our current openmrs-module-team, we have few teams and we have access to their contact numbers.

From here we can proceed in two ways:

1: We can create a separate telegram group for each team and add team members to it. The leader of the team can send message to his group/s from his openmrs instance using our module. In this way, no bot is necessary.

2: We associate a bot to each team. Whenever the team leader sends message to his team from our module, the bot gets the message and forward it to it’s team members. In this way, no group is created. (I think this is what is in your mind and this is what requirement says)

The above mockups are based on first approach.

I have explored telegram-api and bot-api, none of these provide any method to create groups or bot. I have used telegram-cli and it helps in creating groups and doing all types of stuffs, thus I am exploring it’s api. Currently I am not crystal clear with how to implement either of the above mentioned approaches. Please let me know the approach that we may take. Once the approach is decided then I can explore the ways to implement it with full force.

hello I have done some research on implementation plan of this project.

Brief idea of Objective: Create a bot who has ability to forward messages to team members. (OR) Create Telegram group of team members and support to send messages.

I found that https://github.com/rubenlagus/TelegramBots api might be helpful along with telegram-API and bot api to create bot on demand and forward messages. @michael As you are well experienced in this field please give me some insight on technologies that I can explore. Please redirect me where I can find the work on telegram bots used in irc.

I am trying to get in touch with Telegram Community as well.

Thank You.

Hi @pralay,

As we already have discussed and have finalized few features, I would recommend to prepare (or if done share link) a proposal (googledoc) and share link here so that I can provide comments inside doc. This would make managing edits easier.

hi @maimoonak i am also interested in this project i have a doubt will TeamAdmin be a different person other than Team Lead if that is the case then he will have a different registration form and privileges to access the messages etc… ?.Team Admin is not in Team management module so we would add it ?. correct me if i am wrong.

Here’s the Telegram-IRC bot code we’re running:

1 Like

@mnagasowmya . We donot have any role called as Team admin. Rightnow the permissions are based on openmrs Role/Permissions module where any one having permission to View/Edit/Add Team can perform management irrespective of their association with team…