Skip to content

Commit

Permalink
Poll retract handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Kopylov committed Feb 6, 2024
1 parent e2881f6 commit 09998fb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/services/db_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import logging
import sqlite3

from src.data_models.Playroom import Playroom
import logging
import sqlite3

from src.data_models.Game import Game
from src.data_models.Player import Player
from src.data_models.Playroom import Playroom
Expand Down Expand Up @@ -33,6 +37,17 @@ 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 09998fb

Please sign in to comment.