GDSC CU Assignment Bot
This is a telegram bot for sending daily reminders to a group chat of an assignment set by the admin. Bot must also be an admin to work properly.
- Bot must be added as an admin to the group where it will be sending reminders to.
- An assignment is created by using the command 'addassignment' on the group. This command should be registered with botfather to see it in the menu. This command can only be used by admins in the chat.
- Bot replies with format for creating a new assignment. See format below. Bot message must be replied to (that is rght in the message and select reply) for the assignment to be saved.
- Command 'getassignments' is used to list all assignments created in that chat group. Command restricted to admins. List returned would contain inline buttons for editing, deletion and viewing. The list is returned in the form of replies to the message that sends the command.
- Assignment reminders sent everyday by 12pm
Deployment works easily on any platform that allows python deployments. Most platforms run the pip install requirements.txt command automatically. If not that must be done manually.
It's coded to run off a firebase real-time database. Head over to firebase.io and create a new project. You can learn more here Firebase Docs Once you have gotten your database up. Create some access rules for 'assignments, like so
{
"assignments" : {
".read" : true,
".write" : true,
}
Simply add that snippet under the default "rules" that you'll see there. If you don't do this you'll get access errors. You're essentially giving permission for everything under assignments to be accessed by those with the right credentials.
Once the database is setup, navigate to your project settings and go to service accounts and setup a new private key. Copy these details and set them in your deployment provider as ENV variables.
Please adhere to this format strictly in creating assignments.
Course Code: course code
Title: assignment title
Deadline: dd/mm/yy Description: assignment description
- '/start' - Starts the bot in the private chat. Just an introduction message.
- '/addassignment' - Adds an assignment to the database. Only works in groups. Must be an admin to use. Include assignment details in the same message as the command.
Example of telegram message:
/addassignment Course Code: MTH 101 Title: Assignment 1 Deadline: 12/12/2020 Description: This is a test assignment
- '/getassignments' - Lists all assignments in the group. Only works in groups.
- '/manageassignments' - Lists all assignments in the group with inline buttons for editing, deletion and viewing. Only works in groups. Must be an admin to use.
- '/help' - Lists all commands and their descriptions. (Not implemented yet)