Compare commits

..

No commits in common. "90f74110a934b815ed562b2b1cbba92940f41748" and "f54243f7ded0a63be0cc52b3821765593ee43ce9" have entirely different histories.

4 changed files with 4 additions and 8 deletions

View File

@ -8,6 +8,4 @@ COPY config.py config.py
COPY make_celery.py make_celery.py COPY make_celery.py make_celery.py
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
RUN mkdir /sessions
RUN pip install -r requirements.txt RUN pip install -r requirements.txt

View File

@ -10,9 +10,9 @@ class Session(db.Model):
name: Mapped[str] = mapped_column(unique=True) name: Mapped[str] = mapped_column(unique=True)
authorized: Mapped[bool] authorized: Mapped[bool]
users: Mapped[List[User]] = relationship("User", cascade="all, delete-orphan", back_populates="session") users: Mapped[List[User]] = relationship("User", back_populates="session")
tasks: Mapped[List[Task]] = relationship("Task", cascade="all, delete-orphan", back_populates="session") tasks: Mapped[List[Task]] = relationship("Task", back_populates="session")
def has_depending_tasks(self): def has_depending_tasks(self):
tasks = Task.query \ tasks = Task.query \

View File

@ -24,8 +24,6 @@ services:
env_file: env_file:
- .env - .env
command: gunicorn --bind 0.0.0.0:5000 "app:create_app()" command: gunicorn --bind 0.0.0.0:5000 "app:create_app()"
volumes:
- ./sessions:/sessions
ports: ports:
- 5000:5000 - 5000:5000
depends_on: depends_on:

View File

@ -28,8 +28,8 @@ from telethon.errors.rpcerrorlist import (
class PaperClient(TelegramClient): class PaperClient(TelegramClient):
def __init__(self, session: str | Session) -> None: def __init__(self, session: str | Session) -> None:
api = API.TelegramAndroid.Generate("paper") api = API.TelegramDesktop.Generate("linux", "paper")
super().__init__(f"sessions/{session}.session", api) super().__init__(session, api)
async def invite_self(self, group: Entity | EntityLike): async def invite_self(self, group: Entity | EntityLike):
group = await self.__cast_to_entity(group) group = await self.__cast_to_entity(group)