https://github.com/mahdadghasemian/telegram-bot
A simple telegram bot with golang
https://github.com/mahdadghasemian/telegram-bot
Last synced: 2 months ago
JSON representation
A simple telegram bot with golang
- Host: GitHub
- URL: https://github.com/mahdadghasemian/telegram-bot
- Owner: MahdadGhasemian
- Created: 2023-12-26T04:32:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-07T04:13:13.000Z (over 1 year ago)
- Last Synced: 2025-02-04T16:14:49.035Z (4 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Telegram Bot
# Hot to run
```bash
# Create .env file and fill the TG_API_BOT_TOKEN# Run the main application
go run main.go
```# How to create a new project
```bash
# Initialize the Go module for the Telegram bot
go mod init telegrambot# Install the required packages
go get -u github.com/go-telegram-bot-api/telegram-bot-api/v5
go get github.com/joho/godotenv# Run the main application
go run main.go
```# Register a new bot
To register a new bot and obtain a token, follow this steps:
1. Go to **@botfather** on Telegram
2. Send **/newbot** command
3. Choose a _**botname**_ and a _**username**_
- Note: The username should be unique and end with **_bot**, such as testbot1000_bot.