GithubHelp home page GithubHelp logo

assimon / captcha-bot Goto Github PK

View Code? Open in Web Editor NEW
193.0 4.0 47.0 1.16 MB

用于Telegram 加群验证机器人

License: MIT License

Go 98.41% Dockerfile 1.59%
telegram bot telegram-bot captcha-bot telegram-captcha

captcha-bot's Introduction

captcha-bot

用于Telegram 加群验证机器人,采用golang编写,支持全平台编译运行。

license MIT Go version 1.17 telebot v3 version 1.0.0

项目初衷

Telegram(简称:小飞机),全球知名的非常方便且优雅的匿名IM工具(比微信更伟大的产品)。
但由于该软件的匿名性,导致该软件上各种加群推广机器人满天飞,我们无法无时无刻的判断加入群组的“某个人”是否为推广机器人。
还好Telegram为我们提供了非常强大的Api,我们可以利用这些Api开发出自动验证的机器人。

如果你是Telegram的群组管理员,你可以直接使用本项目部署私有化的验证机器人。
如果你是开发者,你可以利用本项目熟悉Go语言Telegram的交互式开发,以便后续利用Api开发出自己的机器人!

文档参考:
Telegram Api文档:Telegram Api
机器人开发框架:Telebot

使用方式

一、自行编译

此安装方式多用于开发者,需电脑上安装go语言环境。
go语言官网

下载:

# 下载项目
git clone https://github.com/assimon/captcha-bot && cd captcha-bot

编译:

# 编译
go build -o  captcha-bot
# 给予执行权限
chmod +x ./captcha-bot

配置:

cp .example.config.toml config.toml

执行:

# 调试启动
./captcha-bot
# nohup 
nohup ./captcha-bot >> run.log 2>&1 &

二、下载已经编译好的二进制程序

此方式可以直接使用,用于服务器生产环境。 进入打包好的版本列表,下载程序:https://github.com/assimon/captcha-bot/releases
配置:

cp .example.config.toml config.toml

运行:

# linux
# 调试启动
./captcha-bot

# windows
captcha-bot.exe

三、机器人命令

/ping       #存活检测,机器人若正常将返回"pong"
# 广告相关
/add_ad     #新增一条广告,格式:广告标题|跳转链接|到期时间(带时分秒)|权重(倒序,值越大越靠前),例如:/add_ad 📢广告招租|https://google.com|2099-01-01 00:00:00|100
/all_ad     #查看所有广告
/del_ad     #删除一条广告,例如:/del_ad 1(删除id为1的广告)

四、敏感词词库使用

在项目dict文件夹提供了一些敏感词库,用于机器人反垃圾功能。由于不可描述原因词库不能明文放置于项目仓库。
如需使用,请使用openssl命令进行解密,且文件名必须以dec_开头,否则无法正常加载!
例如:

openssl enc -d -aes256 -pass pass:captcha-bot -in dict/enc_dc1.txt -out dict/dec_dc1.txt

预览

禁言.png 验证.png

captcha-bot's People

Contributors

assimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

captcha-bot's Issues

发布的包有问题, sqlite 需要 CGO 的支持

运行发布的包时报错:
[error] failed to initialize database, got error Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
open datebase err:Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

当违禁词包含!#*()-+={}其中之一时, 消息不会被删除

当违禁词包含!#*()-+={}其中之一时, 会将该用户禁言, 但是他的垃圾广告不会被删除.
已测试违禁词包含@$%^&时没事. 可以封禁的同时正常将该消息删除. 其他的符号未知... 没测试

例如:
违禁词: 日-赚 主-页
如果发送: 日-赚-一-万, 看-主-页. 此时会仅禁言用户. 消息会遗留在群里.

如果设置违禁词为单个字. 误触会有点高.

违禁词可被绕过

近期出现了一批这样发广告的:
/start /settings /config + 广告
可绕过机器人的检查

我试了试
/start + 违禁词
/ping + 违禁词
/add_ad + 违禁词
...............
均可成功发送广告

openssl无法解析,并且程序似乎无法使

`1. openssl解析:
bad decrypt
40778BE7AC7F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:../providers/implementations/ciphers/ciphercommon_block.c:129:

2.程序无法使用:bot添加到群之后 bot为管理员 并且/ping有反应,但是新成员入群之后bot无反应,也没有报任何错误
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.