Source code for twtb.logic.telegram.setup_shared_chat
"""Setup shared chat.
Because the user can't know, what ID has the channel
we ask them to send a random generated token into the
chat where bot and client are, so in that way we get the
ID for both of those.
"""
import asyncio
import dataclasses
import random
import string
import typing as t
from loguru import logger
if t.TYPE_CHECKING:
from twtb.logic.shared.db.sharing_message import SharingMessageInDB
[docs]MESSAGE_TOKEN = "".join(random.choices(string.ascii_letters, k=8)) # random 8 chars length string
@dataclasses.dataclass