一个可以可以统计群组用户发言,并且能将聊天内容生成词云的机器人

Overview

当前版本

v2.2

更新维护日志

更新维护日志

有问题请加群组反馈

Telegram 交流反馈群组 点击加入

演示

xq9iR.png

配置要求

内存:1G以上

安装方法

使用 Docker 安装

Docker官方安装地址:点击访问

cd /root

# 拉取Redis镜像
docker pull redis

# 创建 entrypoint.sh 入口文件
echo '#! /bin/sh \
cd /root/word_cloud_bot && python3 main.py >> output 2>&1 &
tail -f /dev/null' > /root/entrypoint.sh

# 创建 Dockerfile
wget -O /root/Dockerfile https://github.com/devourbots/word_cloud_bot/raw/master/Dockerfile

# 使用命令查看所有时区
timedatectl list-timezones

找到您所在的时区,例如:
上海 Asia/Shanghai
纽约 America/New_York

# 编辑Dockerfile
vi /root/Dockerfile

# 在第7行修改服务器所属时区,原文件为:
RUN ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
修改为纽约当地时,修改后:
RUN ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

# 在第10行修改你的机器人TOKEN
修改后:
RUN sed -i '1c TOKEN = "1749418611:AAGcpouQ4EWSDITLQXFozHjMgT_-MsVSmDM"' /root/word_cloud_bot/config.py


# 根据 Dockerfile 创建镜像
docker build . -t world_cloud_bot:latest

# 运行 Redis 镜像,此步在前
docker run -d -p 6379:6379 redis:latest

# 注意!!!
请关闭服务器 6379 端口的外网访问权限!!!如果您的主机提供商提供了安全组策略(阿里云、腾讯云、AWS等等),可以在控制台关闭6379端口。
如果您的主机商不支持自定义安全组,请根据您的发行版系统自行搜索防火墙关闭端口的方式,检测方式在下方。
不要抱有侥幸心理!不要抱有侥幸心理!不要抱有侥幸心理!

# 运行 机器人,此步在后
docker run -d --net=host world_cloud_bot:latest

端口检测工具, 请确保 6379 是关闭状态

xlu8H.png

使用方法

使用 /start 指令测试机器人与 Redis 数据库的连通情况

使用 /rank 指令主动触发词云任务,在 config.py 里可以设置每个群组每小时主动触发次数的限制

将机器人拉入群组,设置为管理员(受机器人API所限,只有授予管理员权限后,机器人才能接收到所有用户的普通聊天文本,此机器人不需要其他权限,您可以将所有权限关闭)

所有聊天内容每天定时清理,仅用于本地分词,无其他任何用途

xqyvt.png

将机器人设置为仅自己群组可用

如何编辑 Docker 容器中的文件请自行 Google

如果您不想让别人使用你的机器人,那么可以将 config.py 文件中的 EXCLUSIVE_MODE = 0改为 EXCLUSIVE_MODE = 1

DGbSy.png

编辑 /root/word_cloud_bot/func.py,在 94 行左右,将自己的 群组ID 加入到列表中。 这里的EXCLUSIVE_MODE = 1不要改动,注意区分!

例如我两个的群组ID分别为:-127892174935、-471892571924

那么修改后为:

if EXCLUSIVE_MODE == 1 and chat_id not in ["-127892174935", "-471892571924"]:
    print(chat_id + " 为未认证群组,取消入库")
    return

DGHR5.png

设置 /rank 指令对普通用户开放

编辑 /root/word_cloud_bot/config.py, 将 RANK_COMMAND_MODE = 1 改为 RANK_COMMAND_MODE = 0

DGJuC.png

信息推送密度

xW3jh.png

默认分别会在当地时间 11:00、18:00、23:30 推送三次数据统计报告,并会在 23:59 清空当日统计数据, 如需更密集的数据推送,可以编辑 /root/word_cloud_bot/main.py ,按照示例格式自行增加,相关的 docker 技术操作不再赘述

You might also like...
Releases(v2.5)
Owner
机器人总动员
机器人总动员
Python flexible slugify function

awesome-slugify Python flexible slugify function PyPi: https://pypi.python.org/pypi/awesome-slugify Github: https://github.com/dimka665/awesome-slugif

Dmitry Voronin 471 Dec 20, 2022
Find a Doc is a free online resource aimed at helping connect the foreign community in Japan with health services in their native language.

Find a Doc - Localization Find a Doc is a free online resource aimed at helping connect the foreign community in Japan with health services in their n

Our Japan Life 18 Dec 19, 2022
Fixes mojibake and other glitches in Unicode text, after the fact.

ftfy: fixes text for you print(fix_encoding("(ง'⌣')ง")) (ง'⌣')ง Full documentation: https://ftfy.readthedocs.org Testimonials “My life is li

Luminoso Technologies, Inc. 3.4k Jan 08, 2023
This is REST-API for Indonesian Text Summarization using Non-Negative Matrix Factorization for the algorithm to summarize documents and FastAPI for the framework.

Indonesian Text Summarization Using FastAPI This is REST-API for Indonesian Text Summarization using Non-Negative Matrix Factorization for the algorit

Viqi Nurhaqiqi 2 Nov 03, 2022
Answer some questions and get your brawler csvs ready!

BRAWL-STARS-V11-BRAWLER-MAKER-TOOL Answer some questions and get your brawler csvs ready! HOW TO RUN on android: Install pydroid3 from playstore, and

9 Jan 07, 2023
This repository contains scripts to control a RGB text fan attached to a Raspberry Pi.

RGB Text Fan Controller This repository contains scripts to control a RGB text fan attached to a Raspberry Pi. Setup The Raspberry Pi and RGB text fan

Luke Prior 1 Oct 01, 2021
Deasciify-highlighted - A Python script for deasciifying text to Turkish and copying clipboard

deasciify-highlighted is a Python script for deasciifying text to Turkish and copying clipboard.

Ümit Altıntaş 3 Mar 18, 2022
Word-Generator - Generates meaningful words from dictionary with given no. of letters and words.

Meaningful Word Generator Generates meaningful words from dictionary with given no. of letters and words. This might be useful for generating short li

Mohammed Rabil 1 Jan 01, 2022
Make writing easier!

Handwriter Make writing easier! How to Download and install a handwriting font, or create a font from your handwriting. Use a word processor like Micr

64 Dec 25, 2022
Maiden & Spell community player ranking based on tournament data.

MnSRank Maiden & Spell community player ranking based on tournament data. Why? 2021 just ended and this seemed like a cool idea. Elo doesn't work well

Jonathan Lee 1 Apr 20, 2022
Little python script + dictionary to help solve Wordle puzzles

Wordle Solver Little python script + dictionary to help solve Wordle puzzles Usage Usage: ./wordlesolver.py [letters in word] [letters not in word] [p

Luke Stephens (hakluke) 4 Jul 24, 2022
A working (ish) python script to convert text to a gradient.

verticle-horiontal-gradient-script A working (ish) python script to convert text to a gradient. This script is poorly made with the well known python

prmze 1 Feb 20, 2022
🍋 A Python package to process food

Pyfood is a simple Python package to process food, in different languages. Pyfood's ambition is to be the go-to library to deal with food, recipes, on

Local Seasonal 8 Apr 04, 2022
This is an AI that is supposed to say you if your text is formal or not

This is an AI that is supposed to say you if your text is formal or not. It's written in Python 3 and has some german examples (because I'm german yk) in the text.json file. This file contains the te

1 Jan 12, 2022
Implementation of hashids (http://hashids.org) in Python. Compatible with Python 2 and Python 3

hashids for Python 2.7 & 3 A python port of the JavaScript hashids implementation. It generates YouTube-like hashes from one or many numbers. Use hash

David Aurelio 1.4k Jan 02, 2023
基于Pytex的数学建模工具,实现将md文件转换成pdf/tex文档的前后端

Pytex-for-MCM 基于Pytex的数学建模工具,实现将md文件转换成pdf/tex文档的前后端。

3 May 17, 2021
A python Tk GUI that creates, writes text and attaches images into a custom spreadsheet file

A python Tk GUI that creates, writes text and attaches images into a custom spreadsheet file

Mirko Simunovic 13 Dec 09, 2022
This is a text summarizing tool written in Python

Summarize Written by: Ling Li Ya This is a text summarizing tool written in Python. User Guide Some things to note: The application is accessible here

Marcus Lee 2 Feb 18, 2022
REST API for sentence tokenization and embedding using Multilingual Universal Sentence Encoder.

MUSE stands for Multilingual Universal Sentence Encoder - multilingual extension (supports 16 languages) of Universal Sentence Encoder (USE).

Dani El-Ayyass 47 Sep 05, 2022
utoken is a multilingual tokenizer that divides text into words, punctuation and special tokens such as numbers, URLs, XML tags, email-addresses and hashtags.

utoken utoken is a multilingual tokenizer that divides text into words, punctuation and special tokens such as numbers, URLs, XML tags, email-addresse

Ulf Hermjakob 11 Jan 05, 2023