Telegram Anti-Spam Bot Optimization Strategies

Previously, in order to prevent spam bots, I developed two Telegram bots for GPT. One is for verification when joining a group. https://github.com/crazypeace/tg-join-group-exam-bot The other is for verification when sending messages. https://github.com/crazypeace/tg-send-msg-exam-bot After using them for a while, they indeed work very well at preventing spam.  However, some group members complained that after two consecutive verifications, the bot functionality broke. No one realized that these are two different bots. I thought about it and made a very small optimization. Generally speaking, automatically spamming bots are newly registered, with an ID number greater than 8,000,000,000. Therefore, the message verification bot only requires verification once for these large-ID users. Users with an ID number less than 2,000,000,000 registered for Telegram relatively early, and we trust they won't randomly send messages. Therefore, the group join verification bot exempts these users fr...

电报防广告机器人 新成员入群时ID小于2B免验证 在群内发言时ID小于8B免验证

之前, 为了防广告机器人, 我面向GPT开发了两个电报telegram机器人. 一个是加群时的验证. https://github.com/crazypeace/tg-join-group-exam-bot 一个是发言时的验证. https://github.com/crazypeace/tg-send-msg-exam-bot 用了一段时间, 确实防广告的效果很好.  但是, 也有群友报怨说, 连着验证2次 机器人功能坏了. 没人想到这是两个不同的机器人.

Telegram Bot Sends Stickers Without Group Membership

在 https://t.me/sing_box_community 公开群中,  https://t.me/threecolordummy 用户 不是 群成员member 但是我发现 TA 可以在群里发送贴纸 @sing_box_community 这个群组是公开 member 的, 你可以通过搜索用户ID, 来查证这一点. 你也可以通过查看你与 @threecolordummy 的共同群组, 来查证这一点. (如果你已经加入了 @sing_box_community 群的话) 这个 @threecolordummy 会自动"回应" 关键字 来发送贴纸 naive 三色图 ✌ 这个 @threecolordummy 设置了1小时的冷却时间, 所以如果上一次发贴纸在1小时以内, 那么出现关键字不会触动 发贴纸 的响应. 到 2025/12/14 8:36 为止 @sing_box_community 群里搜索 @threecolordummy 只剩下了1个 2025-11-22 的关于cloudflare的贴纸. 我发送一个 ✌ 作为测试 (测试时刻为 8:48) ======== 相关推荐 《Win环境下编译 Forkgram 安装Visual Studio 2022 C++桌面开发 Python Git》 《通过Giffgaff号码申请Wechat账号 零零碎碎的一些使用体验 2023-11》 《翻墙学习交流群》

电报telegram 不是公开群组的群成员也可以发送贴纸?

在 https://t.me/sing_box_community 公开群中,  https://t.me/threecolordummy 用户 不是 群成员member 但是我发现 TA 可以在群里发送贴纸 @sing_box_community 这个群组是公开 member 的, 你可以通过搜索用户ID, 来查证这一点. 你也可以通过查看你与 @threecolordummy 的共同群组, 来查证这一点. (如果你已经加入了 @sing_box_community 群的话) 这个 @threecolordummy 会自动"回应" 关键字 来发送贴纸 naive 三色图 ✌ 这个 @threecolordummy 设置了1小时的冷却时间, 所以如果上一次发贴纸在1小时以内, 那么出现关键字不会触动 发贴纸 的响应. 到 2025/12/14 8:36 为止 @sing_box_community 群里搜索 @threecolordummy 只剩下了1个 2025-11-22 的关于cloudflare的贴纸. 我发送一个 ✌ 作为测试 (测试时刻为 8:48) ======== 相关推荐 《Win环境下编译 Forkgram 安装Visual Studio 2022 C++桌面开发 Python Git》 《通过Giffgaff号码申请Wechat账号 零零碎碎的一些使用体验 2023-11》 《翻墙学习交流群》

Highlight Form Fields with a Tampermonkey Userscript

Preface When purchasing a VPS, there are times when you need to fill in personal information. We often look for a web page that generates random American information. I had an idea: I wanted to quickly and easily know which piece of information goes where. GPT-Oriented Development There is an HTML page like this The page may contain "first name", or it may contain "first name" in the placeholder attribute of the input element I need to find and highlight these "first name"s Send these requirements to GPT. The result generated by GPT was split into two parts: CSS and JS script. So I made another request to GPT Need to be integrated into a js file that can be executed in the browser's console GPT generated an integrated JS file. Test it in the Console of the browser's F12 Developer Tools. For the RackNerd registration page, the effect is a red border. For the American information page, the effect is yellow text background color * Note: on this page, ...

在 VPS 注册页面 和 美国人信息页面 高亮显示关键字 油猴篡改猴tampermonkey脚本

前言 在购买VPS的时候, 会遇到需要填写个人信息的时候. 我们常常会找一个生成随机美国人信息的网页. 我有一个想法, 希望快速方便的知道哪个信息填写到哪里. 面向GPT开发 有这样一个HTML页面 页面中可能包含 "first name", 也有可能 是在 input元素的 placeholder 属性中包含 "first name" 我需要查找并高亮这些 "first name"  把这些需求发给GPT. GPT生成的结果分为了CSS和JS脚本两部分. 于是再向GPT提要求 需要整合为可以在浏览器的 console 执行的 js 文件  GPT生成了一个整合的JS文件. 在浏览器 F12 开发者工具的Console中进行测试. 对于 RackNerd 的注册页面, 效果为红色边框. 对于美国人信息页面, 效果为黄色文字底色 * 注意, 此页面上, 写的是 Firstname 而不是 First name. 代码需作一点修改. 在有一些 美国人信息页面上, 没有 Firstname 这样的内容, 只有 Full name 所以我们向GPT继续提出修改意见. 把 first name, firstname, full name, fullname, 全名, 姓名 归为一类, 显示同样的高亮颜色或边框颜色. 对于同一类关键字, 边框颜色和文字底色颜色应该一致. 测试, 结果可以了. 接下来, 把这个结果推广到其它信息, 并且要求不同类的信息, 使用不同的颜色. 把 first name, firstname, last name, lastname, full name, fullname, 全名, 姓名 归为一类, 显示同样的高亮颜色或边框颜色. 把 phone number, phone, 电话 归为一类. 把 street address, street, 街道地址, 街道 归为一类. 把 city, 城市 归为一类. 把 full state name, state, 州全称, 州 归为一类. 把 postcode, zip code, 邮编, 归为一类. 以上每一类, 都要使用独特鲜明的颜色, 不应该与其它任何一类颜色相同. GPT返回的结果, 在浏览器console中测试. 效果不错. 用油猴插件...

YouTube Network Speed: Show MB/s with Tampermonkey

Preface Saw a group friend's YouTube video info page where network speed is converted to MB/s My hands are itching, I also want to make one myself. Analysis Open F12 developer tools, select the HTML element of the network speed on the video info panel. Right-click menu, Copy JS path The HTML element path of the text displaying network speed is document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)") Developing with GPT I have an HTML page, in which an element at this position 1) document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)") has content in the format 17085 Kbps, I need to add an element 2) after this element 1), with content showing the value from element 1) converted to the unit MB/s. The number in element 2) should refresh every 10 seconds The result developed by GPT, first teste...

YouTube 视频信息页面 网速换算为 MB/s 油猴篡改猴tampermonkey脚本

前言 看到一个群友的YouTube 视频信息页面 网速换算为 MB/s 手痒, 也想自己整一个. 分析 F12开发者工具, 选择视频信息面板上的网速 HTML元素. 右键菜单 Copy JS path 得到 显示网速的文字 HTML 元素path为 document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)") 面向GPT开发 我有一个html页面, 其中这个位置的元素 1) document.querySelector("#movie_player > div.html5-video-info-panel.ytp-sfn > div > div:nth-child(9) > span > span:nth-child(2)") 内容是  17085 Kbps 这样的格式, 我需要在这个元素 1) 的后面, 增加一个元素 2) , 内容为 元素 1) 的内容换算为 MB/s 的单位. 元素 2) 的数字 应该每10秒刷新 GPT开发的结果, 先在 F12 工具的 console 里面测试效果. 效果正常. 用油猴插件固定此脚本的效果 具体细节步骤略. 油猴插件 https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo 脚本文件名应该为 xxx.user.js @match 中为 https://www.youtube.com/watch* 效果为匹配所有YouTube播放页面url GPT开发的代码填写到 // You code here ... 下面 上传GitHub https://github.com/crazypeace/youtube-MB-per-s ======== 后记 本次使用GPT的过程中, 用到的GPT是 Gemini ======== 相关推荐 《油猴篡改猴tampermonkey 5.4 坏了 扩展程序管理页面 更新 脚本被清空了》

Cloudflare Snippet Reverse Proxy for Blogspot

Preface Recently I saw someone using cloudflare's snippet to implement node functionality similar to worker. Idea It seems, On one hand, free users now have the opportunity to use snippets. On the other hand, the functionality of snippets has been enhanced, making the difference with worker even smaller. So I want to use snippet to implement the reverse proxy for blogspot that I previously did with worker. Practice The syntax in uniproxy is relatively old, it's like this addEventListener('fetch', event => {     event.respondWith(handleRequest(event.request)) }) When used in snippet, it should be changed to this export default {   async fetch(request, env, ctx) {     try {       return await handleRequest(request, env, ctx);     } catch (e) {       return new Response(e.message || "Internal Error", { status: 500 });     }   }, }; I let GPT do the conversion. From the result, apart from this one change, all other code remains exactly the same. Uploaded to Git...

用Cloudflare Snippet实现反代Blogger/blogspot

前言 最近看到有人应用 cloudflare 的 snippet 实现 像 worker 一样的节点功能. 思路 看来,  一方面, 免费用户也有机会使用 snippet 了. 另一方面, snippet 的功能也增强了, 和worker 的区别更小了. 那么我就想用snippet实现之前用worker实现的反代blogspot的效果. 实践 uniproxy里面的语法比较老, 是这样的 addEventListener('fetch', event => {     event.respondWith(handleRequest(event.request)) }) 用在snippet的话, 要改成这样的 export default {   async fetch(request, env, ctx) {     try {       return await handleRequest(request, env, ctx);     } catch (e) {       return new Response(e.message || "Internal Error", { status: 500 });     }   }, }; 我让GPT做了转换.  从结果来看, 就除了这一点变化, 其它代码全部保持原样. 已上传Github https://github.com/crazypeace/cloudflare-workers-uniproxy/blob/master/snippet.js 反代blogspot的worker代码 把需求发给GPT 当我把同样一份代码用于 worker 和  snippet  有没有办法识别当前环境是 worker 还是 snippet, 从而 打开 或关闭 KV相关的代码逻辑? 结果是判断是否存在绑定KV的环境变量. 这个逻辑本身也挺好的, 即使是用于worker, 也可以避免在worker的环境下, 用户没有绑定KV而产生异常. 已上传Github https://github.com/crazypeace/cf-wo...

Show Labels on Blogger Homepage with Simple Fix

Preface I want to encourage visitors to jump to more blog posts. On the single post page, I placed the labels below the article title. I want to achieve a similar effect on the homepage as well. Analysis Open Blogger backend - Theme - Edit HTML Jump to the Blog1 section. Reading the HTML, I found that this is where the labels are displayed and there is logic to determine whether it's a post page. We modified it to   You can notice that  data:view.isSingleItem and   was removed. Result It worked. ======== Recommended Posts 《Using Markdown in Blogger Posts》 《Using the Stylebot Extension to Adjust Blogger Editor Width and Hide the Right Sidebar》 《Using Cloudflare Snippet to Reverse Proxy blogspot》

Blogger/blogspot首页显示博文的标签

前言 我想促进访问者跳转到更多的博文. 在单篇博文的页面, 我把 标签放在了文章的标题下面. 我想在首页也实现类似的效果. 分析 打开 blogger 后台 - 主题背景 - 修改HTML 跳转到 Blog1 段. 阅读HTML, 发现是这里显示标签 并且有逻辑判断是否为博文页面. 我们修改为 <b:includable id='postLabels'> <b:if cond='data:widget.type == &quot;Blog&quot;'>   <b:include name='super.postLabels'/> </b:if> </b:includable> 可以注意到  data:view.isSingleItem and   被删除了. 效果 成功了. ======== 精彩推荐 《在 Blogger 的内容中使用 markdown》 《用Stylebot插件 修改blogger编辑器宽度 隐藏右栏》 《用Cloudflare Snippet实现反代blogspot》

Build a Podcast Episode Image Extractor with GPT

1. Get the podcast's RSS Thanks to https://medium.com/彼得潘的試煉-勇者的-100-道-swift-ios-app-謎題/236-利用-apple-podcasts-網站開發有趣的-podcast-app-99b057270be1 First, find the podcast's Apple Podcast URL https://podcasts.apple.com/cn/podcast/独树不成林/id 1711052890 Pay attention to the id part Then append the id to the end of this link https://itunes.apple.com/lookup?id= Get https://itunes.apple.com/lookup?id= 1711052890 Access it with a browser, and you'll get a JSON-formatted file. Open it with a text tool (you can also use a JSON tool, such as https://www.json.cn/ ) Find feedurl https://feed.xyzfm.space/y9qnpfdrctnx This is the RSS. 2. Find the cover image Open the RSS link with a browser, and find the part that looks like the following—that's the cover image https://image.xyzcdn.net/Fgd_z5yexkQF_GB0LF4Xncqqf8CU.png "/> 3. Develop with GPT Implement an HTML/JS-based tool The page includes the following parts 1) A text box for inputting the podcast's RSS URL 2) A text box that...

下载 独树不成林 播客的全部封面 并做成 电报telegram 贴纸sticker

1. 得到这个播客的RSS 感谢 https://medium.com/彼得潘的試煉-勇者的-100-道-swift-ios-app-謎題/236-利用-apple-podcasts-網站開發有趣的-podcast-app-99b057270be1 我们先找到播客的apple podcast地址 https://podcasts.apple.com/cn/podcast/独树不成林/id 1711052890 注意id的部分 然后把id拼到这个链接的后面 https://itunes.apple.com/lookup?id= 得到 https://itunes.apple.com/lookup?id= 1711052890 用浏览器访问, 得到一个JSON格式的文件. 用文本工具打开(你也可以找JSON工具, 如 https://www.json.cn/ ) 找到 feedurl https://feed.xyzfm.space/y9qnpfdrctnx 这就是RSS了. 2. 找到封面图片 用浏览器打开RSS链接, 找到像下面这样的部分就是封面图片 <itunes:image href=" https://image.xyzcdn.net/Fgd_z5yexkQF_GB0LF4Xncqqf8CU.png "/> 3. 面向GPT开发 实现一个基于HTML JS的工具 页面包含以下几个部分 1) 文本框 可输入podcast的RSS地址 2) 文本框 可从 1) 获取RSS内容, 也可以手工输入RSS内容 3) 文本框 分析 2) 的内容, 列出所有封面图片的地址. 可手工编辑 添加或删除 4) 显示 3) 中的地址对应的图片 举例: https://feed.xyzfm.space/y9qnpfdrctnx 是一个podcast的RSS地址, 会被填写到 1) 1) 可得到RSS数据, xml格式.  会被填写到 2) 2) 中有 <itunes:image href="https://image.xyzcdn.net/Fgd_z5yexkQF_GB0LF4Xncqqf8CU.png"/> 这样的元素, 应该将 https://image.xyzcdn.net/Fgd_z5yexkQF_GB0LF4X...

Telegram Username Squatting: Ensha Group Risks

https://t.me/homelab520 This used to be a group for Ensha (恩山) users, where people discussed NAS, soft routers, and such... Today I happened to take a look, and it turned out like this. I guess it's because for some reason the username was released, and then someone snatched it up. ======== Related Recommendations 《Thoughts on Telegram's Anti-Ad Bots》 《Telegram Users Should Not Use Usernames, Groups Should Not Be Public — To Combat Spam》 《Commercial Telegram Keyword Monitor Bot》

电报 Telegram 用户和群主 要保护好自己的用户名username 不要让别人占了

https://t.me/homelab520 这以前是 恩山用户相关的群, 里面都是讨论 NAS啊, 软路由啊, ... 今天我偶然看一眼, 是这样的了. 我猜是因为某种原因, 用户名username被释放了, 然后就被人占了. ======== 相关推荐 《关于telegram电报防广告机器人想到的》 《电报 Telegram 用户不要使用用户名 群组不要使用公开群 为了对抗广告信息》 《商业化电报关键词提醒机器人 telegram keyword monitor bot》

Telegram Keyword Monitor Bot Experiment & Privacy Tips

Preface Telegram Keyword Monitor Bot Telegram Keyword React Bot Experiment What information can be output in the keyword monitoring channel under different circumstances, which means what information the keyword monitor bot can obtain The monitor bot can obtain  Links to group messages, e.g. https://t.me/testbot/5678 or https://t.me/c/3101361513/1234 The group's username or userid The user's username or userid User has a username, group is a public group #FOUND (https://t.me/tteessttbboottt/487) "✌️" IN test公开群(@tteessttbboottt) FROM 小 白龙(@hakuhakoo) ✌️ User has a username, group is a private group #FOUND (https://t.me/c/3101631513/3) "✌️" IN test私有群(3101631513) FROM 小 白龙(@hakuhakoo) ✌️ User has no username, group is a public group #FOUND (https://t.me/tteessttbboottt/486) "✌️" IN test公开群(@tteessttbboottt) FROM icd yct(7809800531) ✌️ User has no username, group is a private group #FOUND (https://t.me/c/3101631513/2) "✌️" IN test私有群(310163...