MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / is_req_subscribed

Function is_req_subscribed

plugins/fsub.py:125–139  ·  view source on GitHub ↗
(bot: Client, user_id: int)

Source from the content-addressed store, hash-verified

123
124
125async 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
142async def get_fsub(bot: Client, message: Message) -> bool:

Callers 1

get_fsubFunction · 0.85

Calls 1

has_joined_channelMethod · 0.80

Tested by

no test coverage detected