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
veez music bot is a telegram music bot project, allow you to play music on voice chat group telegram.

?? Veez Music Bot Music bot for playing music on telegram voice chat group. Requirements ?? FFmpeg NodeJS nodesource.com Python 3.7+ PyTgCalls ?? Get

levina 143 Jun 19, 2022
An Telegram Bot By @AsmSafone To Stream Videos in Telegram Voice Chat. This is Also The Source Code of The Bot Which is Being Used In @SafoTheBot Group! ❤️

Telegram Video Player Bot (Beta) An Telegram Bot By @AsmSafone To Stream Videos in Telegram Voice Chat. Special Features Supports Live Streaming From

SAF ONE 206 Jan 3, 2023
Video Bot: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

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

null 5 Jan 26, 2022
A simple bot that lives in your Telegram group, logging messages to a Postgresql database and serving statistical tables and plots to users as Telegram messages.

telegram-stats-bot Telegram-stats-bot is a simple bot that lives in your Telegram group, logging messages to a Postgresql database and serving statist

null 22 Dec 26, 2022
Rocks vc Userbot: A Telegram Bot Project That's Allow You To Play Audio And Video Music On Telegram Voice Chat Group

⭐️ Rocks VC Userbot ⭐️ Telegram Userbot To Play Audio And Video Song On VC Chat

Dr Asad Ali 10 Jul 18, 2022
veez music is a telegram music bot project, allow you to play music on voice chat group telegram.

?? VEEZ MUSIC BOT Veez Music is a telegram bot project that's allow you to play music on telegram voice chat group. Requirements ?? FFmpeg NodeJS node

levina 23 Aug 29, 2021
this is a telegram bot repository, that can stream video on telegram group video chat.

VIDEO STREAM BOT telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram ?? Commands: /vstream (reply to vide

levina 319 Aug 15, 2022
Video Stream is a telegram bot project that's allow you to play video on telegram group video chat

Video Stream is a telegram bot project that's allow you to play video on telegram group video chat ?? Get SESSION_NAME from below: Pyrogram ## ✨ Featu

null 1 Nov 10, 2021
Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

WAR MUSIC / VIDEO PLAYER Bot Bot Link: ?? Get SESSION_NAME from below: Pyrogram ?? Preview ✨ Features Music & Video stream support MultiChat support P

Abhishek singh 11 Dec 25, 2022
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 on Telegram Group Video Chat ?? Get SESSION_NAME from below: Pyrogram

Jonathan 6 Feb 8, 2022