Skip to content

Commit

Permalink
quick fix (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Kopylov authored Feb 22, 2024
1 parent bfb6307 commit 4a217c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ services:
bot:
build: .
environment:
- SQLITE_DB_FILE_PATH=${SQLITE_DB_FILE_PATH}
- SQLITE_DB_FILE_PATH=/database/db.sqlite
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- DEVELOPER_CHAT_ID=${DEVELOPER_CHAT_ID}
volumes:
- sqlite_data:/database
entrypoint: ["/bin/sh", "-c"]
command:
- |
python -m sqlite3 ${SQLITE_DB_FILE_PATH} < src/sql/init.sql
python src/__main__.py
python -m sqlite3 ${SQLITE_DB_FILE_PATH} < src/sql/init.sql;
python src/__main__.py;
restart: always

sqlitebrowser:
Expand Down
11 changes: 0 additions & 11 deletions src/services/db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ async def save_playroom(playroom: Playroom) -> None:
logging.info(f"Playroom {playroom.name} already exists in the database")


async def save_playroom(playroom: Playroom) -> None:
"""Add a game room to the bot_data"""
try:
await execute(
"INSERT INTO playrooms (id, name) VALUES (?, ?)",
(playroom.telegram_chat_id, playroom.name),
)
except sqlite3.IntegrityError:
logging.info(f"Playroom {playroom.name} already exists in the database")


async def save_player(player: Player) -> None:
"""Add a player to the bot_data"""
try:
Expand Down

0 comments on commit 4a217c5

Please sign in to comment.