Giter Site home page Giter Site logo

keyword_alert_bot's Introduction

🤖Telegram keyword alert bot ⏰

Telegram关键字提醒机器人,用于实时监测频道/群组中的关键字消息。

确保普通Telegram账户能够在不需要验证的情况下加入指定群组。

原理:通过Telegram命令行客户端监听消息,使用机器人向订阅用户发送消息提醒。

👉 Features:

👉 Todo:

  • 私有群组订阅和提醒
  • 私有频道消息提醒完整内容预览
  • 多账号支持
  • 扫描退出无用频道/群组

DEMO

http://t.me/keyword_alert_bot

image

USAGE

普通关键字匹配

/subscribe   免费     https://t.me/tianfutong
/subscribe   优惠券   https://t.me/tianfutong

正则表达式匹配

使用类似JavaScript正则语法规则,用/包裹正则语句,目前可以使用的匹配模式:i,g

# 订阅手机型号关键字:iphone x,排除XR,XS等型号,且忽略大小写
/subscribe   /(iphone\s*x)(?:[^sr]|$)/ig  com9ji,xiaobaiup
/subscribe   /(iphone\s*x)(?:[^sr]|$)/ig  https://t.me/com9ji,https://t.me/xiaobaiup

# xx券
/subscribe  /([\S]{2}券)/g  https://t.me/tianfutong

BUILD

1. config.yml.default --> config.yml

Create Telelgram Account & API

开通api 建议使用新注册的Telegram账户

Create BOT

访问https://t.me/BotFather 创建机器人

2. RUN

运行环境 python3.7+

首次运行需要使用Telegram账户接收数字验证码,并输入密码(Telegram API触发)。

$ pipenv install

$ pipenv shell

$ python3 ./main.py

3. crontab (optional)

  • update telethon

依赖库telethon可能存在旧版本不可用的情况或其他BUG,建议通过定时任务执行依赖更新。

e.g.

0 0 * * * cd /home/keyword_alert_bot && pipenv  telethon > /dev/null 2>&1

BUG Q&A

  • 查看日志发现个别群组无法接收消息,而软件客户端正常接收

请尝试更新telethon解决问题🤔,我也很无助。

  • 订阅群组消息,机器人没任何反应 Hootrix#20

  • ModuleNotFoundError: No module named 'asyncstdlib', No module named '...'

$ pipenv  install

BOT HELP


目的:根据关键字订阅频道消息

支持多关键字和多频道订阅,使用英文逗号`,`间隔

关键字和频道之间使用空格间隔

主要命令:

/subscribe - 订阅操作: `关键字1,关键字2 https://t.me/tianfutong,https://t.me/xiaobaiup`

/unsubscribe - 取消订阅: `关键字1,关键字2 https://t.me/tianfutong,https://t.me/xiaobaiup`

/unsubscribe_all - 取消所有订阅

/list - 显示所有订阅列表

---

Purpose: Subscribe to channel messages based on keywords

Supports multiple keyword and channel subscriptions, separated by commas.

Separate keywords and channels with a space.

Main commands:

/subscribe - subscribe operation: `keyword1, keyword2 https://t.me/tianfutong,https://t.me/xiaobaiup`

/unsubscribe - unsubscribe: `keyword1, keyword2 https://t.me/tianfutong,https://t.me/xiaobaiup`

/unsubscribe_all - unsubscribe from all subscriptions

/list - display all subscription lists.

License

LICENSE

Buy me a coffee

[USDT-TRC20]:TDELNhqYjMJvrChjcTBiBBieWYiDGiGm2r

wechat pay alipay paypal

keyword_alert_bot's People

Contributors

hootrix avatar crazypeace avatar dependabot[bot] avatar

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.