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

Function is_subscribed

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

Source from the content-addressed store, hash-verified

103 await message.reply("**⚙ Successfully join request cache deleted.**")
104
105async def is_subscribed(bot: Client, user_id: int):
106 missing = []
107 expire_at = datetime.datetime.utcnow() + datetime.timedelta(minutes=Config.FSUB_EXPIRE) if Config.FSUB_EXPIRE > 0 else None
108 for channel_id in Config.AUTH_CHANNELS:
109 try:
110 await bot.get_chat_member(channel_id, user_id)
111 except UserNotParticipant:
112 try:
113 chat = await bot.get_chat(channel_id)
114 invite = await bot.create_chat_invite_link(channel_id, expire_date=expire_at)
115 missing.append((chat.title, invite.invite_link))
116 except ChatAdminRequired:
117 logging.error(f"Bot not admin in auth channel {channel_id}")
118 except Exception:
119 pass
120 except Exception:
121 pass
122 return missing
123
124
125async def is_req_subscribed(bot: Client, user_id: int):

Callers 1

get_fsubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected