Recently, I don’t even know which guy is bored enough to specifically target bots for advertising. That’s how I came across this project: a bidirectional bot with verification.
Project URL: GitHub - iawooo/ctt: 这是一个基于Cloudflare实现的Telegram消息转发机器人,专注于将用户消息安全、高效地转发到后台群组每个用户独立群组中的分话题,直接话题中发送信息而无需再艾特回复,适用于客服、社区管理等场景。
If you don’t like the project content that appears after each verification, you can modify the following.
Open the _worker.js file in your Cloudflare Workers editor and make these changes:
Step 1: Modify the getVerificationSuccessMessage function (remove project promotion)
This function retrieves the message shown after a successful verification, which currently includes project promotion.
Locate the code (around line 588):
JavaScript
async function getVerificationSuccessMessage() {
const userRawEnabled = (await getSetting('user_raw_enabled', env.D1)) === 'true';
if (userRawEnabled) return '验证成功!您现在可以与我聊天。';
const response = await fetch('https://raw.githubusercontent.com/iawooo/ctt/refs/heads/main/CFTeleTrans/start/success.md' );
if (!response.ok) return '验证成功!您现在可以与我聊天。';
const message = await response.text();
return message.trim() || '验证成功!您现在可以与我聊天。';
}
Replace it with the following code (remove remote fetching and return a default welcome message directly):
JavaScript
async function getVerificationSuccessMessage() {
// Remove the logic that fetches remote promotional information
// Default to returning a concise verification success message
return '验证成功!您现在可以与我聊天。';
}
Step 2: Modify the onMessage function (change the final welcome text)
This function handles incoming messages and, when a user sends the /start command and verification succeeds, concatenates the result of getVerificationSuccessMessage with the final welcome text before sending.
Locate the code (around line 415):
JavaScript
// ... (onMessage function body)
const successMessage = await getVerificationSuccessMessage();
await sendMessageToUser(chatId, `${successMessage}\\n你好,欢迎使用私聊机器人,现在发送信息吧!`);
// ...
Replace it with the following code (change the final welcome text to whatever you want, e.g., an empty string):
JavaScript
// ... (onMessage function body)
const successMessage = await getVerificationSuccessMessage();
// Change the final welcome text to whatever you want, e.g., an empty string ""
// If you want to keep “你好,欢迎使用私聊机器人,现在发送信息吧!” you don’t need to modify this line.
await sendMessageToUser(chatId, `${successMessage}\\n`);
// Or if you want to customize, for example:
// await sendMessageToUser(chatId, `${successMessage}\\n欢迎回来!`);
// ...
Recommended modification:
If you want to completely remove all promotional content and welcome text, sending only a concise prompt after verification, change the onMessage code to:
JavaScript
// ... (onMessage function body)
const successMessage = await getVerificationSuccessMessage();
await sendMessageToUser(chatId, successMessage); // Only send the verification success message, without additional welcome text
// ...