Skip to content

lexuanquynh/telegram-random-quotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telegram-random-quotes

About

How it work:

Thanks for the random quotes which generate by the zenquotes API.

Get telegram-bot

https://telegram.me/BotFather

build

GOOS=linux GOARCH=amd64 go build <your parth of project>/cronJobProject/cronjob.go

upload to host:

scp cronjob root@your_ipaddress:/usr/local/src/telegram-bot/

create service:

vi /etc/systemd/system/telegram_bot.service

then add code:

[Unit]
Description=Telegram-bot  service
After=multi-user.target

[Service]
User=root
Group=root
Type=simple
Restart=always
RestartSec=5s
ExecStart=/usr/local/src/telegram-bot/cronjob

[Install]
WantedBy=multi-user.target

run

sudo systemctl start telegram_bot.service
sudo systemctl enable telegram_bot.service
sudo systemctl status telegram_bot.service

LICENSE

This project is licensed under the MIT license. You're free to use it.