A Telegram bot to index Chinese and Japanese group contents, works with @lilydjwg/luoxu.

Overview

luoxu-bot

luoxu-bot 是类似于 luoxu-web 的 CJK 友好的 Telegram Bot,依赖于 luoxu 所创建的后端。

测试环境

  • Python 3.7.9
  • pip 21.1.2

开发中使用到的 Telethon 需要 Python 3+

配置

  • 前往 luoxu 根据相关内容配置并运行 luoxu,等待消息索引完毕

由于 Telegram 的消息样式问题,建议修改 luoxu 项目中的 luoxu/db.py 文件,将 SEARCH_LIMIT 修改为 10

  • 克隆 本项目 , 并使用 pip3 install -r requirements.txt 等方式安装依赖
  • 前往 My Telegram ,获取 API development tools 中的 api_idapi_hash
  • 在 Telegram 中向 @BotFather 申请 Bot,获取 bot token(由数字:数字字母构成,如1111122222:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  • 在 Telegram 中向 @getidsbot 发送 /start 以获取你的 Telegram 账号 ID(my_id
  • 打开 config.py 并填写相关字段(如果你在 luoxu 中修改了接口的端口或者前缀等,请同步修改)
  • 使用 python3 main.py 运行项目,当出现 开摆 时代表项目已启动,可以向自己的 Bot 尝试发送指令(请提前向自己的 Bot 激活 /start

使用

  • /list 获取已索引群组的列表和相关信息

https://s2.loli.net/2021/12/18/KDh76ai2O5ENqwS.png

  • 直接发送关键词,如 我是垃圾,其后通过点选对应的群组或「所有已索引群组」

https://s2.loli.net/2021/12/18/JP3FVSzOAHofuYD.png

  • 搜索结果,点击「查看群组原消息」可以直接跳转到对应消息位置:

https://s2.loli.net/2021/12/18/s6Xl4kNmLYDiMja.png

另外简单测试了一下,luoxu 作者提供的搜索字符串的功能应该是工作正常的(毕竟我没去注意过 URL 里的空格啥的……)

搜索消息时,搜索字符串不区分简繁(会使用 OpenCC 自动转换),也不进行分词(请手动将可能不连在一起的词语以空格分开)。

搜索字符串支持以下功能:

1.以空格分开的多个搜索词是「与」的关系

2.使用 OR(全大写)来表达「或」条件

3.使用 - 来表达排除,如 落絮 - 测试

4.使用小括号来分组

其他

  • 搜索结果只有一页时,可能会有多余的「下一页」按钮,问题不大,懒得修了
  • 部分数据量过大的消息可能会让 Bot 一直保持在「少女祈祷中…」,建议换个详细点的词。一般是搜什么 test 之类的很容易出现在一条长消息里的(有人在群里直接粘贴发带了关键词的 log 之类的)
  • 请使用 screen 等程序保持 Bot 在终端关闭后亦持续运行
  • 可以使用已经配置在公网上的 API 吗?当然可以,但是这个项目出现的原因就是因为不想公开在公网上
  • 本项目没有代理字段的配置。经过各方面的考虑以及我懒得再改,我认为一般需要部署此项目的机器都已经能正常连接 Telegram

为什么会有这个项目

luoxu 是一个很棒的项目,在此感谢 @lilydjwg

luoxu 提供了 API 接口以供前端使用,但这也带来一个问题,如果索引的内容存在不想公开的私密群组,那么要不就将整套前后端部署在自己的内网上,要不就需要通过设置 Base Auth 等方式在保护接口(

所以最后我选择摸一个 Telegram Bot((((

鸣谢

You might also like...
Telegram vc - A bot that can play music on telegram group's voice call

Telegram Voice Chat Bot A bot that can play music on telegram group's voice call

Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat
Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music

ELiza music is a telegram music bot project, allow you to play music on voice chat group telegram.
ELiza music is a telegram music bot project, allow you to play music on voice chat group telegram.

❤️ 𝗘𝗹𝗶𝘇𝗮 𝗠𝘂𝘀𝗶𝗰 ❤️ Unmaintained. The new repo of @MrsElizaRobot is private. (It is no longer based on this source code. The completely rewrit

szrose is an all in one group management bot made for managing your group effectively with some advance security tools & Suit For All Your Needs ❤️
szrose is an all in one group management bot made for managing your group effectively with some advance security tools & Suit For All Your Needs ❤️

szrose is an all in one group management bot made for managing your group effectively with some advance security tools & Suit For All Your Needs ❤️

Force-Subscribe-Bot - A Telegram Bot to force users to join a specific channel before sending messages in a group

Introduction A Telegram Bot to force users to join a specific channel before sen

A group management bot written in python3 using the python-telegram-bot library.

Chika Fujiwara A modular telegram Python bot running on python3 with an sqlalchemy database. Originally a Marie fork, Chika was created for personal u

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live strams, YouTube videos and telegram media.

Telegram VCVideoPlayBot An Telegram Bot By @ZauteKm To Stream Videos in Telegram Voice Chat. NOTE: Make sure you have started a VoiceChat in your Grou

Owner
TigerBeanst
¯\_(ツ)_/¯
TigerBeanst
An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord.

Danganronpa Killing Game Archiving Bot An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord. The final format is meant to look

Astrea 1 Nov 30, 2021
One of Best renamer bot with python

🌀 One of Best renamer bot repo Please Give a ☆ if You like This Open Source and Don't Forget to Follow Me On Github For More Repos And Codes. Scrappe

1 Dec 14, 2021
A discord.py code generator program. Compatible with both linux and windows.

Astro-Cord A discord.py code generator program. Compatible with both linux and windows. About This is a program made to make discord.py bot developmen

Astro Inc. 2 Dec 23, 2021
Google scholar share - Simple python script to pull Google Scholar data from an author's profile

google_scholar_share Simple python script to pull Google Scholar data from an au

Paul Goldsmith-Pinkham 9 Sep 15, 2022
SongBot2.0 With Python

SongBot2.0 Host 👨‍💻 Heroku 🚀 Manditary Vars BOT_TOKEN : Get It from @Botfather Special Feature Downloads Songs fastly and less errors as well as 0

Mr.Tanaji 5 Nov 19, 2021
A simple Discord bot that can fetch definitions and post them in chat.

A simple Discord bot that can fetch definitions and post them in chat. If you are connected to a voice channel, the bot will also read out the definition to you.

Tycho Bellers 4 Sep 29, 2022
An automated, headless YouTube Uploader

An automated, headless YouTube Uploader Authors: Christian C., Moritz M., Luca S. Related Projects: YouTube Watcher, Twitch Compilation Creator, Neura

127 Dec 23, 2022
Python API client library for phpIPAM installations

phpypam: Python API client library for phpIPAM installation As we started to develop phpipam-ansible-modules we used an existing python library for ph

codeaffen 3 Aug 03, 2022
An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail.

Amazon Price Tracker An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail. Installing Download t

Aytaç Kaşoğlu 2 Feb 10, 2022
A Anything goes Discord bot written in python and uses the wrapper Discord.py

GerardTheWizard A Anything goes Discord bot written in python and uses the wrapper Discord.py What can he do? Allow users to level up through typing,

1 May 05, 2022
Fortnite Dumper for anyone's Save the World profiles.

Anyone's Fortnite Save the World Profile Dumper This program allows you to dump anyone's Fortnite Save the World Profiles. How to use it? After starti

PRO100KatYT 6 Apr 13, 2022
💰 Import your ING Germany bank statements via FinTS into YNAB.

Import your ING Germany bank statements via FinTS into YNAB. Setup Before setting this up, please register your FinTS product – it's free and takes on

Arne Bahlo 23 Jan 21, 2022
Fairstructure - Structure your data in a FAIR way using google sheets or TSVs

Fairstructure - Structure your data in a FAIR way using google sheets or TSVs. These are then converted to LinkML, and from there other formats

Linked data Modeling Language 23 Dec 01, 2022
The system to host your files on the Discord application

Distorage The system to host your files on the Discord application Documentation Documentation Distorage How to use the package You can install it wit

6 Jun 27, 2022
A Powerful Telethon Based Telegram Spam Bot.

Yukki Multi Spam Bot 🚀 Deploy on Heroku You can Use these API ID and API HASH while deploying String Session No Requirement of API ID and API HASH Ge

46 Dec 23, 2022
Official python API for Phish.AI public and private API to detect zero-day phishing websites

phish-ai-api Summary Official python API for Phish.AI public and private API to detect zero-day phishing websites How it Works (TLDR) Essentially we h

Phish.AI 168 May 17, 2022
A Discord bot for viewing any currency you want comfortably.

Dost Dost is a Discord bot for viewing currencies. Getting Started These instructions will get you a copy of the project up and running on your local

Baran Gökalp 2 Jan 18, 2022
A Discord/Xenforo bot!

telathbot A Discord/Xenforo bot! Pre-requisites pyenv (via installer) poetry Docker (with Go version of docker compose enabled) Local development Crea

Telath 4 Mar 09, 2022
Flask-SQLAlchemy API for daisuki-web

💟 Anime Daisuki! API API de animes com cadastro de usuários. O usuário autenticado pode avaliar e favoritar animes, comentar episódios e verificar o

Paulo Thor 1 Nov 04, 2021
AWS SQS event redrive Lambda With Python

AWS SQS event redrive Lambda This repository contains one simple AWS Lambda function in Python to redrive AWS SQS events from source queue to destinat

1 Oct 19, 2021