(bot: Client, user_id: int)
| 123 | |
| 124 | |
| 125 | async def is_req_subscribed(bot: Client, user_id: int): |
| 126 | missing = [] |
| 127 | for channel_id in Config.AUTH_REQ_CHANNELS: |
| 128 | if await tb.has_joined_channel(user_id, channel_id): |
| 129 | continue |
| 130 | try: |
| 131 | chat = await bot.get_chat(channel_id) |
| 132 | invite = await bot.create_chat_invite_link(channel_id, creates_join_request=True) |
| 133 | missing.append((chat.title, invite.invite_link)) |
| 134 | except ChatAdminRequired: |
| 135 | logging.error(f"Bot not admin in request channel {channel_id}") |
| 136 | except Exception: |
| 137 | pass |
| 138 | |
| 139 | return missing |
| 140 | |
| 141 | |
| 142 | async def get_fsub(bot: Client, message: Message) -> bool: |
no test coverage detected