This is a Telegram bot developed by me, intended for selling in-game items such as in-game currency for games like Fortnite, Brawl Stars, Fall Guys, etc. The primary purpose of this bot is for commercial use. It is currently operational, and you can use it via the following link: https://t.me/fnshophokagebot
Warning
My code may be shity and work unstable sometimes, it is my first big project
/start
/admin_panel
Important
To run the bot, follow the instructions.
- docker
- ubuntu
Caution
You can only run this repository with Docker
BOT_TOKEN=YOUR_TOKEN
POSTGRES_HOST=db
POSTGRES_PORT=5432
POSTGRES_DB=DB
POSTGRES_USER=YOUR_USERS
POSTGRES_PASSWORD=YOUR_PASSWORD
POST_CHANNEL=CHANNEL_ID
PAYMENT_CHANNEL=CHANNEL_ID
2. Create Telegram bot via BotFather and get API TOKEN
- Create bucket for images
- Create service account
- Donwload and save sotrage-key.json to project directory
docker-compose.yml
version: "3"
services:
redis:
image: redis:alpine
env_file: .env
restart: on-failure
ports:
- "6379:6379"
db:
image: postgres:16.3
env_file: .env
user: postgres
environment:
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- POSTGRES_DB=$POSTGRES_DB
volumes:
- pgdata:/var/lib/postgresql/data
restart: on-failure
ports:
- "5432:5432"
bot:
build: .
env_file: .env
command: sh -c "python3 main.py"
restart: always
depends_on:
- db
- redis
volumes:
pgdata:Dockerfile
FROM python:3.12.1
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade setuptools
RUN pip3 install -r requirements.txt
RUN chmod 755 .
COPY . .
sudo docker-compose up -d --build
docker ps
CONTAINER ID IMAGE COMMAND
aa00b4c2364e hokageshopdeployversion-bot "sh -c 'python3 main…"
9ac877208f00 postgres:16.3 "docker-entrypoint.s…"
7203ab11afc9 redis:alpine "docker-entrypoint.s…"
sudo docker exec -it 9ac877208f00 bash
psql -U postgres -d -DB
CREATE USER your_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE your_database TO your_user;
psql -U your_user -d DB
INSERT INTO admins
VALUES
(1, 'your_telegram_username', 'your_telegram_firstname', your_telegram_id);
check_subscription = InlineKeyboardMarkup(inline_keyboard=[
[InlineKeyboardButton(text='Підписатись', url='URL TO YOUR CHANNEL')],
[InlineKeyboardButton(text=emojize('Перевірити підписку :check_mark_button:'), callback_data='check_sub')]])



