tuhuebot
is a Telegram bot written in Go that offers various functionalities for interacting with users on Telegram. It is designed to be easily deployable and maintainable, with support for building and running through a Makefile
and a systemd
service for automatic management.
- Clone the Repository:
git clone https://github.com/yeungon/tuhuebot.git
cd tuhuebot
- Install dependencies:
go mod tidy
- Build the binary:
make build
- Configure the service file yourselt and copy to system:
Change the content of tuhuebot.service if needed (location of the code, for example).
sudo cp tuhuebot.service /etc/systemd/system/
- Enable and Start the Service:
sudo systemctl enable tuhuebot
sudo systemctl start tuhuebot
- Check Service Status: Verify that the bot is running correctly:
sudo systemctl status tuhuebot
Currently @tuhuebot
is using sqlite and postgresql database. Cache implemented via bigCache.
Here’s a short guide for updating and redeploying your tuhuebot
project:
-
Pull Latest Changes
Login to your server, go to the folder where the code is put. First, we update your local repository with the latest code from GitHub:sudo git pull
-
Build the Project
Compile the code and prepare it for deployment:make build
-
Restart the Service
Usemake
to restart the systemd service for the changes to take effect:make restart
This process will update your repository, build the project, and restart the service to apply any new changes.