A Safe Space was created as a platform for USP students to hold conversations on mental health issues. This simulates a group chat where students can share experience or advice, while remaining completely anonymous. The telegram bot can be accessed here.
When registered, any message that you sent to the bot will be sent to all other students that are also registered on the bot. Your message would be accompanied by your username, allowing others to identify messages that are sent. No other personal information would be shared with anyone in the group.
Below are a list of available commands for students that can be used in the Telegram bot.
Returns a general welcome message.
Returns a bot description, along with the sign up link, FAQ link, and admins’ Telegram handles.
Registers the student into the system. After being registered, students can send and receive messages. The password is specific to each student, and will be provided by a Love, USP admin.
Shows the student's username.
Unregisters the student from the system. Afterwards, students will no longer be able to receive messages that are sent. All details of the student that are stored in the system would also be deleted.
These commands would only work if the user is an admin.
Broadcasts the admins message as uspadmin
to all students in the system.
This could be used to convey messages about downtime, or promotions for Love, USP events.
Unregisters the student with a certain NUSNET ID. This is to ensure that admins can easily remove any student that may be causing distress in the chat.
Creates a registration command for a student. This is to simplify the registration process, where the admin can send the entire command to the student.
The FAQ for the bot can be found here.
The following outlines the procedure for debugging.
- In asafespace/main.py, ensure
ADMIN_CHAT_ID
is accurate on line 17. - In the same file, change
DEBUG_MODE
toTrue
on line 18. - In the command line, execute
severless deploy
. - From now on, all message metadata would be sent to the admin for debugging.
- Students who sends messages to the bot will also receive an "under maintenance" response.
- After debugging, change
DEBUG_MODE
in asafespace/main.py back toTrue
. - In the command line, execute
severless deploy
again. - Admins can use the
/admin
command in the bot to broadcast a message to all students.
# Clone the repository into your local drive
# Open the command window in the bot file location
# Install the Serverless Framework
$ npm install serverless -g
# Install the necessary plugins
$ npm install
# Update AWS CLI in .aws/credentials
# Deploy it!
$ serverless deploy
# With the URL returned in the output, configure the Webhook
$ curl -X POST https://<your_url>.amazonaws.com/dev/set_webhook
- From the AWS Console, select AWS Lambda.
- In AWS Lambda, select "a-safe-space-bot-dev-webhook".
- Select "Permissions" and select the Lambda role under "Execution role"
- In AWS IAM, select "Attach policies" under "Permissions" and "Permissions policies"
- Search for and select "AmazonDynamoDBFullAccess" and "Attach policy"
- Run the Telegram bot with
/start
and register with/register
- From the AWS Console, select AWS DynamoDB.
- Under "Tables", ensure that the "ASafeSpaceTable" table has been created.