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

In the https://t.me/sing_box_community public group,   https://t.me/threecolordummy user is NOT a group member But I found that TA can send stickers in the group

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

在 https://t.me/sing_box_community 公开群中,  https://t.me/threecolordummy 用户 不是 群成员member 但是我发现 TA 可以在群里发送贴纸

Highlight Form Fields with a Tampermonkey Userscript

Preface When purchasing a VPS, you often run into pages that require you to fill in personal information. We usually look for a webpage that generates random American identity info. I had an idea: I wanted a quick and easy way to know which piece of info goes into which field.

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

前言 在购买VPS的时候, 会遇到需要填写个人信息的时候. 我们常常会找一个生成随机美国人信息的网页. 我有一个想法, 希望快速方便的知道哪个信息填写到哪里.

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 手痒, 也想自己整一个.

Cloudflare Snippet Reverse Proxy for Blogspot

Preface Recently I saw someone using cloudflare's snippet to implement node functionality similar to worker.

用Cloudflare Snippet实现反代Blogger/blogspot

前言 最近看到有人应用 cloudflare 的 snippet 实现 像 worker 一样的节点功能.

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.

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

前言 我想促进访问者跳转到更多的博文. 在单篇博文的页面, 我把 标签放在了文章的标题下面. 我想在首页也实现类似的效果.

Build a Podcast Episode Image Extractor with GPT

1. Get the RSS of this podcast Thanks to https://medium.com/彼得潘的試煉-勇者的-100-道-swift-ios-app-謎題/236-利用-apple-podcasts-網站開發有趣的-podcast-app-99b057270be1 First, find the Apple Podcast URL of the podcast https://podcasts.apple.com/cn/podcast/独树不成林/id 1711052890 Pay attention to the id part

下载 独树不成林 播客的全部封面 并做成 电报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了.

Cloudflare Workers Local Dev with Wrangler and Caddy

Preface As is well known, when deploying projects on CloudFlare Workers, the 1101 error may be triggered due to keywords. Of course, the community already has mature code obfuscation solutions. However, for better debugging and development, it's best to have a development environment that is not interfered with by CloudFlare. CloudFlare officially provides a locally running Worker environment solution: Wrangler V3

在VPS上本地运行CloudFlare Worker环境 Wrangler V3

前言 众所周知, CloudFlare 的 Worker 上面部署项目的时候, 有可能因为关键字触发 1101 错误. 当然圈子里已经有成熟的代码混淆方案. 但是为了我们更好的调试和开发, 最好是有一个不受CloudFlare干扰的开发环境. CloudFlare官方就提供了一个本地运行的Worker环境方案 Wrangler V3

Telegram Username Squatting: Ensha Group Risks

https://t.me/homelab520 This used to be a group related to Ensha users, where everyone discussed NAS, soft routers, ... Today I happened to take a look, and this is what it's become. I guess it's because for some reason, the username was released, and then got squatted by someone.

电报 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

电报 Telegram 用户不要使用用户名 群组不要使用公开群 为了对抗广告信息

前言 电报关键字监控机器人 电报关键字反应机器人

Telegram Keyword Bot: Send Sticker via Direct Message

Preface Already implemented: detect a keyword and send a sticker in the group What about sending a direct message to the user directly?

当检测到关键字时 私信发送对应的贴纸 tg-keyword-react-bot

前言 已经实现了 检测到关键字 在群里发送贴纸 如果直接给用户发送私信呢?

Show Hidden Buttons in Blogger Editor Toolbar

Preface Continuing from the previous article, we have already hidden the right sidebar of the Blogger editor But when there is enough space, the toolbar still produces a collapsed split bar. This article aims to solve this problem.

用Stylebot插件 修改Blogger/blogspot编辑器页面 显示被折叠的工具栏按钮

前言 书接上文 我们已经隐藏了bloger编辑器的右栏 但工具栏在空间足够的条件下, 还是产生了折叠分栏. 本文就来解决这个问题.

Maximize Blogger Editor Width with Stylebot CSS

Stylebot https://chromewebstore.google.com/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha The idea is based on the previous post: Modify Blogger editor width with the Stylish extension I had an idea today: when I'm focused on writing, I honestly don't care about the stuff in the right sidebar.

用Stylebot插件 修改Blogger/blogspot编辑器宽度 隐藏右栏

Stylebot https://chromewebstore.google.com/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha 思路基于 上一篇 用Stylish插件修改blogger编辑器宽度 我今天有个想法, 专心写的时候, 右边栏那些 东西我其实不关心. 不如把它们隐藏起来好了.  这样我的编辑区域又能变大一点. 经过一番 F12 工具的使用. 最终结果 www.blogger.com/blog/*/edit/* /* 左栏撑满 */ .fmzcZd {     padding-right: 20px; } /* 编辑区最大化 */ .a89Sje {   max-width: 100%; } /* 右栏隐藏 */ .vW7mGd {   display: none; } 使用效果如下 尾巴 其实对我来说, 还不算 完美.  因为工具栏 还是有个 ...  但实际上的宽度是够的

Telegram Keyword Monitor Bot with Sticker Reply

Requirement Want to run an experiment  When the keyword 三色图 is detected, send a sticker

当检测到关键字 三色图 时 发送贴纸 tg-keyword-react-bot

需求 想做个实验  当检测到关键字 三色图 时 发送贴纸

Build a GitHub Reverse Proxy with Cloudflare Worker

Preface When I saw this DD system project  https://github.com/bin456789/reinstall I was drawn to its installation command.

极简 GitHub Porxy 支持GitHub脚本的无限嵌套调用

前言 当我看到这个DD系统的项目时 https://github.com/bin456789/reinstall 我被它的安装命令吸引了.

Fake curl/wget Wrapper for Offline VPS Script Testing

Introduction The solution we used in the previous post to fix the DD script problem can actually be applied to running scripts in any network-restricted VPS environment  ( Of course, the whole procedure looks rather cumbersome. Moreover, the previous solution only handled the curl case. But common scripts sometimes use curl and sometimes wget for network access. Less experienced readers may not know how to adapt it to handle the wget case. So let's try to build a more general solution. And also think about how to make it easy to use.

在网络受限的VPS上 运行一个脚本 向外访问网络时暂停 使用者进行替代操作

前言 上一篇我们解决DD脚本的问题的方案, 其实就可以用来解决所有网络受限的VPS环境运行脚本的问题  ( 当然整个操作看起来比较繁琐. 而且, 上一篇的方案只处理了curl的情况. 而常见的脚本, 有些是用curl访问网络, 有些是用wget. 能力弱一点的朋友, 不知道怎么改成处理wget的情况. 那么, 我们尝试做一个通用一点的方案. 而且考虑如何方便使用.

Fake Curl Shell for Network-Restricted VPS DD Scripts

Preface In the DD Scripts group https://t.me/reinstall_os A group member encountered the issue that the script's resource downloads tend to get interrupted when the network is bad.

DD脚本 在日志输出curl被调用的序号 输出curl命令和参数 执行预设的命令

前言 在 DD脚本群 https://t.me/reinstall_os 有群友遇到网络不好, 脚本下载资源时容易中断的问题.

Handling Unstable Networks in VPS Reinstall Scripts

Introduction In the DD script group https://t.me/reinstall_os Some group members encountered the problem of unstable networks, where the script easily gets interrupted when downloading resources.

DD脚本 输出所需资源的链接

前言 在 DD脚本群 https://t.me/reinstall_os 有群友遇到网络不好, 脚本下载资源时容易中断的问题.

Hooking getaddrinfo to Test IPv4 Priority on Debian 13

Preface Group members reported that IPv4 priority cannot be set on Debian 13 Analysis Thanks to the group members of the Debian Chinese group for providing the information https://t.me/c/1039975886/766705 Thanks to the group members of the 233 group for providing the information https://t.me/tg233boy/1228524 Now we know that gai.conf controls the behavior of the getaddrinfo system interface /etc/gai.conf How can we prove that a certain program calls getaddrinfo (controlled by gai.conf)?  Hooking to intercept system interface calls Thanks to the inspiration from the group members of the Debian Chinese group https://t.me/c/1039975886/766779 I don't know how to use gdb for debugging, but I know how to compile. I asked GPT, and the library for getaddrinfo is libc.so.6 You can find the getaddrinfo symbol here, e.g. nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep getaddrinfo I originally wanted to find the source code and compile a copy of libc.so.6 myself. The idea was to not affect t...

编译钩子 LD_PRELOAD加载 拦截系统接口调用getaddrinfo 验证socks5和socks5h的区别

前言 群友反馈在Deiban13下不能设置IPv4优先

Map CapsLock to Ctrl on Long Press and Esc on Short Press

The goal is to achieve the Ctrl effect on long press of CapsLock, and the Esc effect on short press of CapsLock The AutoHotKey code inside is as follows: SendMode Input SetWorkingDir %A_ScriptDir% SetCapsLockState, AlwaysOff CapsLock::   Send {Ctrl Down}   KeyWait, CapsLock   Send {Ctrl Up}   if (A_PriorKey = "CapsLock")     Send {Esc} return Walking through the code reveals the problem: whether long-pressed or short-pressed, it sends out Ctrl Down and Ctrl Up signals In most environments, this extra Ctrl signal doesn't matter, but if a certain environment is sensitive to this extra Ctrl signal, ... What I thought of is, a delay should be added to determine whether it's a short press or a long press. While preparing to develop with GPT, I thought, it would be better to give GPT an open-ended question. Analyze what problems this code has, and how it can be improved The result exceeded my expectations. 1. First, let's look at the delay-added solution SendMod...

AutoHotKey 实现 CapsLock 一键双用 长按=Ctrl 短按=Esc

逛B站的时候看到 <告别腱鞘炎!Vim 党必看! CapsLock 一键双用:Ctrl + Esc 全搞定> 目的是 长按CapsLock实现 Ctrl 的效果, 短按CapsLock实现 Esc 的效果 里面的AutoHotKey代码如下: SendMode Input SetWorkingDir %A_ScriptDir% SetCapsLockState, AlwaysOff CapsLock::   Send {Ctrl Down}   KeyWait, CapsLock   Send {Ctrl Up}      if (A_PriorKey = "CapsLock")     Send {Esc} return 走读代码就能发现问题, 不管是长按还是短按, 都会发出 Ctrl Down 和 Ctrl Up 信号 在大部分环境下, 这个多余的 Ctrl 信号没关系, 但是如果某个环境对这个多余的Ctrl信号有关系的话, ... 我想到的是, 应该加个延迟来判断是短按还是长按. 准备面向GPT开发的时候, 我想到, 不如给GPT一个开放的问题. 分析这段代码有什么问题, 可以怎样改进 结果超出我的期望. 1. 首先来看加延迟的方案 SendMode Input SetWorkingDir %A_ScriptDir% SetCapsLockState, AlwaysOff CapsLock::     KeyWait, CapsLock, T0.2  ; 等待释放 等待0.2秒          if (ErrorLevel)  { ; 长按超过0.2秒         Send {Ctrl Down}         KeyWait, CapsLock  ; 等待释放         Send {Ctrl Up}     }     else  { ; 轻按(短于0.2秒)   ...

Telegram Group Member Join Time Tool with Sorted Output

Preface In a previous blog post , our join-group verification bot got a new feature that lets us manually trigger the join-group verification for any group member. The problem it solved was this: when the bot leaves the group (or goes offline abnormally), new members join the group, but those new members never went through the join-group verification. Then a new question pops up — how do I know which members joined during the period when the bot was absent from the group?

电报防广告机器人 telegram antispam bot 相关功能 查询群组内的全部成员 增加入群时间信息

前言 在前面一篇博文中 , 我们的入群验证机器人增加了一个功能, 可以手动启动对某个群成员的入群验证. 解决的问题是, 当机器人离开群组(或异常)的时候, 群组有了新的成员, 但是这些群成员没有经历入群验证. 那么一个新问题就随之而来, 我怎么知道哪些成员是在机器人离开群组的时间段入群的呢?

Telegram Bot: Proactive New Member Verification Command

Background Today while reviewing the bot logs, I found 4 anomalies. The exact cause of the anomaly isn't entirely clear; I suspect it's a network issue where the bot program timed out when asking the Telegram server to set user permissions. This opens a loophole: these 4 new users were never muted and never went through the join-group verification process.

电报防广告机器人 telegram antispam bot 新成员入群时需要人机验证 增加一个命令手动触发

背景 今天在查看机器人日志的时候, 发现有4个异常. 异常的原因不完全清楚, 猜测是网络原因, 机器人程序向Telegram服务器要求设置用户权限时 超时了. 这样就带来一个漏洞, 这4个新用户没有被设置禁言, 没有通过人机验证流程.

My Telegram Anti-Advertising Bot Solution

I don't support pulling various external bots into groups, as this makes the information in the group easier to be scraped. After granting these bots admin permissions, it's hard to guarantee that these bots won't do malicious things. Does anyone still remember the incident of the bidirectional chatbot livegarm bot posting ads? For anti-advertising, there are basically two approaches. One is human verification. The other is analyzing whether the message content is an advertisement. There are many ways to do human verification.  Answering questions, solving problems, using Cloudflare's human verification, etc... The approach I chose is to reply to text. First, it's easy to customize. Second, it's easy to increase the difficulty of the questions. If you want to have meaningful random questions, that's also possible. For example, what is the title of my latest blog post Theoretically, human verification cannot solve the situation where real people are used to a...

关于telegram电报防广告机器人想到的

我不支持把各种外部机器人拉到群里面来, 这样会让群里的信息更容易被抓取. 在给了这些机器人管理权限之后, 很难保证这些机器人会不会作恶. 不知道大家对于 双向聊天机器人livegram bot 发广告的事件还有没有印象. 对于防广告, 基本上是两个思路. 一个是人机验证. 另一个是对消息内容进行分析是否广告.

Telegram Clean Removed Users: Remove Deleted Accounts

A lot of advertising accounts were kicked from the group under the handling of the anti-advertising bot. In other words, they are listed in the group's Permissions - Removed Users list. Because advertising accounts get reported a lot, they actually get banned by Telegram pretty quickly and become Deleted Accounts. The purpose of this project is to clean up this list by removing the accounts that have already been banned.

电报防广告机器人 telegram antispam bot 相关功能 清除群组Removed Users列表

有很多广告账号在防广告机器人处理下, 被踢出了群组. 也就是在群组的 Permissions - Removed Users 列表中. 而广告账号因为被举报得很多, 所以实际上比较快就会被telegram封禁, 成为 Deleted Account 本项目的目的就是清理这个列表, 把已经被封禁的账号移除.

Telegram Tool: Kick Muted Users Lacking Speaking Permission

Preface Some anti-advertising bots, in order to avoid accidentally kicking legitimate users, only mute users who haven't passed verification instead of kicking them out of the group. As a result, these users leave a record in the group's Exceptions list without speaking permission. When there are a huge number of such records, doing it manually one by one is too time-consuming. So let's let a script do the work for us.

电报防广告机器人 telegram antispam bot 相关功能 踢除群组Exceptions列表中没有发言权限的用户

前言 有一些 防广告机器人为了防止误踢用户, 只对未通过验证的用户设置了禁言, 并没有将用户踢出群组. 那么, 这些用户会在 群组Exceptions列表中留下一条没有发言权限的记录. 当这样的记录非常多时, 逐条手工操作太费时. 那么, 我们让程序来帮忙吧.