This is a simple Telegram bot implemented in Golang.
-
Clone the repository:
git clone https://github.com/ashcherbatyi/kbot.git cd kbot -
Install dependencies:
go mod tidy -
Create a Telegram bot using BotFather:
Open Telegram and find BotFather. Use the command /newbot to create a new bot.Name should be _bot Save the token provided by BotFather.
-
Add your token to the environment:
export TELE_TOKEN="your-telegram-bot-token" -
Modify
main.go:import "github.com/<yourname>/kbot/cmd" -
Run the bot:
go build -ldflags "-X=github.com/<yourname>/kbot/cmd.appversion=v1.0.2" ./kbot start
You can interact with the bot at https://t.me/YourBotName_bot.
Then push message:
/start hello
You will receive a response with the current version of the bot.