We wanted to make use of telegram as a social app, and develop things that people could do (or do lesser) through an online platform. Many times when people are involved in the game "Angel and Mortal", it has to be done manually and there's the problem of having to rack your brains to write something secretive to your mortal. Now, it can be easily achieved using just one line of command. ;) Also, you can tell your angel anything. It will be like making friends without knowing who the other half is. This allows one to type like who they are instead of being in fear of who the person is.

What it does

In this bot, we would help you and your friends assign a mortal and angel to everyone. What's special is that, you can communicate your wishes to your angel and you can tell your mortal what you want them to know (anonymously! - It will only be between you and the mortal and all conversations would be held in the bot.). When the game ends, the roles will be revealed to everyone.

Here are some guiding commands:
(ps. Most commands require the gameID (to identify the game you are in) typed beside them)
/creategame - creates a new game with a gameID to be indicated beside the command
/joingame - join the game with the gameID
/startgame - for the creator to click, only when everyone is ready to be assigned a mortal with
/messageangel - communicate with your angel through this platform
/messagemortal - grant your mortals some wishes
/endgame - the game has ended, the roles will be revealed

How we built it

We built it using Telegram API, node.js to run our server. For the back-end data, we store it in PHP's database. We stored each gameID as a new table, each row would be the information about the player who join game. Each row includes the player's telegram ID, their telegram name, their designated mortal's and angel's ID and date. We retrieve the data from the table of gameID and then we use the ids to get telegram bot to send message.

We also built it on lots of frowning over the bugs that we've never seen before.

Challenges we ran into

We had to learn how to function using Telegram API, node.js and PHP from scratch. SQL with node.js has some looping issues, so we had to think of different methods in order to make the functions work.

There are many case scenarios that we have to place a diversion for. eg. if they place the command without anything behind, we would have to prompt them. If table does not exist, cannot join.

The randomiser to make sure that everybody has a different angel and mortal took us some time to figure and code out.

Accomplishments that we're proud of

Being beginners at building from nodejs and using telegram, we are glad that we managed to get this working product in the end. It's also something that everyone can use when it's deployed! We are really proud to see the final product and for every bug we solved!! :)

What we learned

We've learnt how to operate node.js and how to get it working, given that we had no prior experience with it. We've learnt to manage our time to create a bot in 24hours!! And this is done when we only wanted to join this for an experience. To come up with a working product is what we are really excited about. We also learnt that debugging is not our cup of tea, but once debugged, we would drink any tea.

What's next for Angel Mortal

Angel and Mortal would like to be more developed in the future by having a deadline for each game. This is to ensure that no time is wasted and that there would be an actual interaction going on. /setdeadline - set deadline of 5, 7 or 10 days The date will be taken when the date is set and then it will countdown to the deadline selected and /endgame will be played.

Currently, most commands require an input of gameid beside the command which is more troublesome. Angel Mortal could probably prompt people to choose the game they want to respond to, followed by the action that they want to partake afterwards. This increases the convenience for them and it is easier to use.

In addition, currently groups would have to communicate to know whether everyone is in the chat alr. Therefore, there could be a function called setnumber, once the correct number of players joingame, then game could automatically start. there could also be an indication of the players who are in so that the game could be started more promptly.

At this stage, during /enggame, the bot would send multiple messages to everyone to reveal the roles, we hope that only the final revelation would be sent once instead. After /endgame command, the functions would still work. Therefore, the table of game should be deleted so the relations would be gone and the commands wouldn't work.

Lastly, we hope to deploy so anyone can use this magic portal too!

Built With

Share this project: