Need to be informed of notices which are being uploaded on Delhi Technological University(DTU) official website but can't be bothered to keep checking the website regularly? Same. Thus, this bot is here to help you! Simply visit and check out @DTUAlertBot on Telegram to get subscribed for notifications in case of an update on your phone itself!
Please make sure the bot is unmuted and telegram app is allowed to send notification for the bot to function as required!
If you want to create your own bot with customised messages, commands and new functions, make sure to fork and star the repository. You can use the following methods to deploy the bot!
This project has been submitted as a part of Innovative Project Work for degree of BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING, Delhi Technological University, Delhi by Prince Mendiratta (me). Please do not use this project source code without proper citations or reference to avoid infringement of License. See the LICENSE for more details. For reference, I have attached the Project Report itself as well in case someone wants some inspiration.
Since this bot was made keeping in mind that it will be hosted on Heroku mostly, the project follows a multi threaded approach to prevent Heroku dyno idling. The main thread is responsible for handling user events and commands on the Telegram bot and creating child sub threads for checking the website for notice updates.
If the notices are conveyed via webhooks, wouldn't it be a disaster if someone found out the webhook URL and hijack the bot, doing whatever they want?! To prevent such a situation from occuring I have added several preventive measures, some of which are as follows.
Simply Start the bot to get added to Alert List!
termux-setup-storage
. Allow Storage permissions.pkg install python git libxml2 libxslt clang
.python3 -m venv venv
.. ./venv/bin/activate
.cd /sdcard
.git clone https://github.com/Dark-Princ3/DTU-Alert-Bot
.cd DTU-Alert-Bot
.python3 setup.py
.python3 -m bot
.cd code_directory
python3 setup.py
python3 -m bot
TG_BOT_TOKEN
: Create a bot using @BotFather, and get the Telegram API token.
APP_ID
,
API_HASH
: Get these two values from my.telegram.org/apps.
AUTH_CHANNEL
:
Go to @Rose, send /id in the chat to get this value.
MONGO_URL
: You can get this value by creating a cluster on MongoDB and getting the connection url.
TG_BOT_WORKERS
: Number of workers to use. 4 is the recommended (and default) amount, but your experience may vary.
Note that going crazy with more workers won't necessarily speed up your bot, given the amount of sql data accesses, and the way python asynchronous calls work.
COMMM_AND_PRE_FIX
: The command prefix. Telegram, by default, recommeds the use of /
, which is the default prefix. Please don't change this unless you know what you're doing.
START_COMMAND
: The command to check if the bot is alive, or for users to start the robot.
START_OTHER_USERS_TEXT
: The message that your bot users would see on sending /start message.
ONLINE_CHECK_START_TEXT
: The message that the bot administrators can use to check if bot is online.
HELP_MEHH
: The message that bot users would see on sending /help message.
TZ
: Timezone to make sure time related functions work as required.
LOG_FILE_ZZGEVC
: The path to store log files.
REQUEST_INTERVAL
: Time interval between each check.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE for more details.