A simple Telegram bot written in Go that responds with "hi" to any incoming message.
- Go 1.20 or higher
- A Telegram Bot Token (get it from @BotFather)
- Clone this repository
- Install dependencies:
go mod download
-
Set your Telegram bot token as an environment variable:
export TELEGRAM_TOKEN=your_telegram_bot_token -
Run the bot:
go run main.go -
Send any message to your bot, and it will respond with "hi".
The bot uses the gotgbot library to interact with the Telegram Bot API. It sets up a message handler that responds to all incoming messages with the text "hi".