Skip to content

Commit bde8f72

Browse files
committed
update worker/src/worker.js
1 parent b202146 commit bde8f72

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

worker/src/worker.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,16 @@ async function handleHelpCommand(BOT_TOKEN, chatId) {
159159
🔍 <b>Available Commands:</b>
160160
• /start - Welcome message and setup guide
161161
• /help - Show this help message
162+
• /setup - Configure your channel settings
163+
• /post - Create a new content post
164+
• /search - Find movies/series to share
162165
163166
📝 <b>How to Use:</b>
164167
1. <b>Add me to your channel</b> as admin with post permissions
165168
2. <b>Go to our website</b> and explore the features
166169
3. Tap the <b>settings button (⚙️)</b> to configure
167170
4. <b>Add your channel ID</b> and save your configuration
171+
5. Use <b>/search</b> to find content and post directly to your channel
168172
169173
💡<b><i>Example Post Preview:</i></b>
170174
@@ -180,10 +184,10 @@ async function handleHelpCommand(BOT_TOKEN, chatId) {
180184
{ text: "👤 Owner", url: "https://t.me/SLtharindu1" },
181185
{ text: "🎥 Tutorial", url: "https://example.com/tutorial" }
182186
],
183-
// [
184-
// { text: "🆘 Support", url: "https://t.me/SLtharindu1" },
185-
// { text: "🐛 Report Issue", url: "https://t.me/SLtharindu1" }
186-
// ],
187+
[
188+
{ text: "🆘 Support", url: "https://t.me/SLtharindu1" },
189+
{ text: "🐛 Report Issue", url: "https://t.me/SLtharindu1" }
190+
],
187191
[
188192
{ text: "🌐 Visit Website", url: "https://imdb-tg-post-font.pages.dev" }
189193
]
@@ -594,21 +598,24 @@ async function sendTextMessage(BOT_TOKEN, CHANNEL_ID, message, buttons) {
594598
function truncatePlot(overview, media_type, tmdb_id) {
595599
if (!overview) return 'No plot available';
596600

597-
const maxChars = 265; // Approx. 3 lines in Telegram
598-
const readMoreLink = `https://www.themoviedb.org/${media_type}/${tmdb_id}`;
599-
601+
// const maxChars = 265; // Approx. 3 lines in Telegram
602+
// const readMoreLink = `https://www.themoviedb.org/${media_type}/${tmdb_id}`;
603+
600604
// Escape HTML special characters
601605
const safeOverview = overview
602606
.replace(/&/g, "&amp;")
603607
.replace(/</g, "&lt;")
604608
.replace(/>/g, "&gt;");
605609

606-
if (safeOverview.length <= maxChars) {
607-
return `<blockquote expandable>${safeOverview}</blockquote>`;
608-
}
610+
// Always show full plot in expandable block
611+
return `<blockquote expandable>${safeOverview}</blockquote>`;
609612

610-
const truncated = safeOverview.slice(0, maxChars).trim();
611-
return `<blockquote expandable>${truncated}... <a href="${readMoreLink}">Read more</a></blockquote>`;
613+
// if (safeOverview.length <= maxChars) {
614+
// return `<blockquote expandable>${safeOverview}</blockquote>`;
615+
// }
616+
//
617+
// const truncated = safeOverview.slice(0, maxChars).trim();
618+
// return `<blockquote expandable>${truncated}... <a href="${readMoreLink}">Read more</a></blockquote>`;
612619
}
613620

614621
// Helper to escape markdown characters

0 commit comments

Comments
 (0)