Skip to content

Commit

Permalink
stub for kick.com
Browse files Browse the repository at this point in the history
  • Loading branch information
bralbral committed Sep 27, 2024
1 parent 6c937f6 commit 1245678
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/bot/dialogs/user/channel/add/on_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Button,
)

from src.db.models.channel_type import ChannelType


async def on_finish(
callback: CallbackQuery, button: Button, manager: DialogManager
Expand All @@ -26,6 +28,13 @@ async def on_select_channel_type(
manager: DialogManager,
item_id: str,
):
# temporary stub
# wait for https://github.com/bralbral/telegram-stream-notifier/issues/114
if item_id == ChannelType.KICK:
await callback.answer(
"Notifications from Kick.com do not implemented. Try later."
)
return

manager.dialog_data["selected_channel_type"] = item_id
await manager.next()
Expand Down
2 changes: 1 addition & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SQLITE_DATABASE_FILE_PATH: str = os.environ.get(
"SQLITE_DATABASE_FILE_PATH", os.path.join(ROOT_DIR, "youtube-notifier-bot.db")
)
VERSION: str = "2024-09-26.11"
VERSION: str = "2024-09-27.04"

__all__ = [
"CONFIG_FILE_PATH",
Expand Down
2 changes: 1 addition & 1 deletion src/db/dao/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, session: AsyncSession, model: Type[T]):

@property
def __prepare_select_statement(self):
statement = select(self.model)
statement = select(self.model).order_by(self.model.id.desc())
return statement

@abstractmethod
Expand Down
6 changes: 0 additions & 6 deletions src/db/dao/message_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Sequence

from sqlalchemy.ext.asyncio import AsyncSession
from sqlmodel import select

from .base import BaseDAO
from src.db.models import MessageLogModel
Expand All @@ -12,11 +11,6 @@ class MessageLogDAO(BaseDAO[MessageLogModel]):
def __init__(self, session: AsyncSession):
super().__init__(session, MessageLogModel)

@property
def __prepare_select_statement(self):
statement = select(self.model).order_by(self.model.id)
return statement

async def get_first(self, *args, **kwargs) -> Optional[MessageLogModel]:
return await super().get_first(*args, **kwargs)

Expand Down

0 comments on commit 1245678

Please sign in to comment.