MCPcopy Index your code
hub / github.com/CodeXBotz/File-Sharing-Bot / new_post

Function new_post

plugins/channel_post.py:37–51  ·  view source on GitHub ↗
(client: Client, message: Message)

Source from the content-addressed store, hash-verified

35
36@Bot.on_message(filters.channel & filters.incoming & filters.chat(CHANNEL_ID))
37async def new_post(client: Client, message: Message):
38
39 if DISABLE_CHANNEL_BUTTON:
40 return
41
42 converted_id = message.id * abs(client.db_channel.id)
43 string = f"get-{converted_id}"
44 base64_string = await encode(string)
45 link = f"https://t.me/{client.username}?start={base64_string}"
46 reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]])
47 try:
48 await message.edit_reply_markup(reply_markup)
49 except Exception as e:
50 print(e)
51 pass

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.90

Tested by

no test coverage detected