It is used to deal with the school's trivial and miscellaneous things to improve the efficiency of work and facilitate the touch of fish.

Overview

介绍

本项目由专业部主任提供灵感并根据NtChat项目进行了二次开发。主要用于处理在学校中一些繁杂琐碎的事情,比如查看接龙谁没有接并提醒,青年大学习谁没做,安全大学习谁没有看。可以通过本项目提高工作效率与方便摸鱼。

特别注意:本项目仅供学习参考。由于使用Hook造成微信封号等情况概不负责!!!

  • 基于NtChat项目进行二次开发
  • 支持收发文本、群@、名片、图片、文件、视频、链接卡片等
  • 支持好友和群管理
  • 支持微信接龙检测
  • 支持青年大学习检测
  • 安全大学习(开发中,敬请期待)

支持的微信版本下载

  • 下载 WeChatSetup3.6.0.18.exe
  • 特别注意:本项目仅供学习参考。由于使用Hook造成微信封号等情况概不负

帮助文档

安装

pip install ntchat

国内源安装

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ntchat

OpenCV用于识别图片相似性

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip install opencv-python

简单教程

需要有一定的计算机相关知识

前提

数据库准备:

本项目前提需要通过NtChat读取指定群聊的群成员WXID,并写入数据库。建立如下图的数据表:

mysql

  • wx_id:为主键每个学生有唯一的一个微信id
  • id_number:学生身份证
  • name:为学生姓名
  • sex:为学生性别,该项可不填
  • image_similarity:记录图片相似性,主要用于青年大学习是否截图发送正确
  • update_time:数据更新时间,用于检测青年大学习图片是否是当天的监测结果。后期可能会更改。
  • creat_time: 数据创建时间
  • phone:学生手机号,该项可不填

对于本校老师可以通过学校的资助表转为csv格式后导入数据库更改相关字段即可

Yaml数据准备:

下面为local_basic_data.yml文件内容。

  • mysql: 请根据自身设置mysql数据库信息进行更改
  • wechat:
    • basic: 记录微信基本信息
      • decoder_image_save_patch:图片存储目标文件
      • decoder_proces_exe:微信dat图片解码exe文件现已废弃
      • wechat_file_patch:微信指定缓存存储路径,可通过微信设置中插卡并更改
      • whitelist:白名单列表,用于排除特定学生
      • automatic_response_title:自动回复消息头
      • automatic_response_star:自动回复主体
      • automatic_response_end:自动回复结尾
      • from_wxid: 指定用户用于发送机器人相关监测指令
    • qndxx:用于记录青年大学习事件相关内容
      • end_key_word:起动监测关键词,启动后开始记录图片发送的地址并保存到decoder_image_save_patch指定文件件
      • image_detection_key_word:输入关键词后开始识别图片相似度,判断学生是否做了青年大学习
      • unfinished:输入后显示未完成的人员名单
    • room:存储指定监控群相关信息
      • nickname:指定群名称
      • room_wechat_id:指定群的wxid
    • solitaire:记录成语接龙相关内容
      • star_key_word:使用该关键词后会@相关未完成任务的学生
      • re:用于正则表达式过滤信息
        • star:出现什么关键信息后进行处理的关键词
        • name:提取学生姓名的关键词
        • phone:提取学生手机号的关键词
mysql:
  charset: utf-8
  databases:
    charset: utf8mb4
    name: your_databases_name
    table_name: your_table_name
  date_time: 0
  host: 127.0.0.1
  password: your_databases_password
  port: 3306
  user: root
wechat:
  basic:
    decoder_image_save_patch: D:\Code\Python\WeChat_Bot_For_Ntchat\image
    decoder_proces_exe: D:\Code\Python\WeChat_Bot_For_Ntchat\image\wechatDatDecode.exe
    wechat_file_patch: E:\WechatDownload\WeChat
    whitelist: []
    automatic_response_title: 本消息为检测系统自动回复
    automatic_response_star: 未完成人员为:
    automatic_response_end: 请以上同学请尽快完成相关任务。(若出现Bug请向管理员反应或邮至[email protected]
    from_wxid: xxxxx
  qndxx:
    end_key_word: 结束青年大学习监测
    image_detection_key_word: 开始识别
    src_image_similarity_path: D:\Code\Python\WeChat_Bot_For_Ntchat\image\image_similarity\similarity.jpg
    star_key_word: 启动青年大学习监测
    unfinished: 未完成名单
  room:
    nickname: your_room_nickname
    room_wechat_id: [email protected]
  solitaire:
    star_key_word: 发送群聊
    re:
      star: (#接龙)
      name: (?:\d\.\s[ㅤ]?)([\u4e00-\u9fa5]*)
      phone: (1[345789]\d[\s]?\d{4}[\s]?\d{4})

青年大学习:

由于本人不是学校团委成员,没有整个学校团委账号,对于学生是否做了青年大学习无法直接查询后台,如果使用该项目的老师有团委的账号,该功能其实可以通过直接读取后台表格内容精确的确定学生是否完成。

本项目使用的思路是通过图片相似度进行判断,也可使用飞桨PaddlePaddle开源的深度学习模型进行OCR精确的识别判断。(为了效率和占用低资源,该项目使用OpenCV图片差值哈希算法相似度相进行判断,深度学习判断代码已删除,您可根据自身需求进行更改)

使用指南

接龙判断

如下图所示,当管理员用户将指定群中的接龙消息发送给机器人账号的时候,程序自动执行,判断哪位学生完成,哪位学生未完成。并将基本信息发送给管理员账号。

jielong

发送的消息如下:

接龙自动回复内容可通过Yaml文件进行修改 默认返回,未完成学生姓名,未完成认识,白名单人数

response

发送至指定群需要输入相关关键词。关键词内容为yaml文件中的star_key_word字段

response_keyword

指定群会@未完成学生并发送设定好的自动回复内容,如下图:

response_room

青年大学习

该功能只开发了Demo,并未经过实际检验,值在两人测试群中进行了试验。使用时可能出现Bug

发送监测关键词时,开始记录群成员发送的图片路径

qndxx

(如果一个群成员发送多张图片时,会一一进行记录,主要有任一图片符合要求就会通过检测,不会影响结果)

发送识别指令,开始解码dat图片,并将dat图片复制到指定文件夹,进行解码操作后将jpg文件也保存指定文件夹,方便人工审核。

识别

发送指令后,将识别结果写入数据库image_similarity字段。然后可将未完成用户打印出来。

安全教育平台:(TODO)

开发指南

目录结构

D:.
├─.idea
│ └─inspectionProfiles
├─api #青年大学习接龙等事件和关键词
│ └─__pycache__
├─config #yaml等配置文件处理程序
│ └─__pycache__
├─const #yaml等配置常量处理
│ └─__pycache__
├─core #Mysql,文件,微信等二次开发功能
│ └─__pycache__
├─doc #md文件图片等资料
├─image #存储图片目录
│ └─image_similarity #放置相似性图片对比的文件夹
├─utils #微信解码,日志,深度学习处理,OpenCV相似性判断等第三方代码
│ ├─ocr_result #OCR识别结果
│ └─__pycache__
└─__pycache__

代码内部有注释。

TODO:

  • 完善青年大学习功能
  • 开发安全教育平台功能
  • 可以通过机器人查询指令权限和内容
  • 通过机器人查询指定学生的指定信息并返回
You might also like...

(CVPR2022) Official PyTorch Implementation of KDEP. Knowledge Distillation as Efficient Pre-training: Faster Convergence, Higher Data-efficiency, and Better Transferability

(CVPR2022) Official PyTorch Implementation of KDEP. Knowledge Distillation as Efficient Pre-training: Faster Convergence, Higher Data-efficiency, and Better Transferability

Knowledge Distillation as Efficient Pretraining: Faster Convergence, Higher Data-efficiency, and Better Transferability This repository contains the c

Nov 17, 2022

A python and batch automation script for windows to facilitate project creation process.

setup: git clone "https://github.com/MyoniM/project-init.git" cd project-init pip install -r requirements.txt add "project-init" folder directory to

Oct 4, 2022

A manager tool to facilitate two-scale coupling in multi-physics simulations using preCICE.

Micro Manager A manager tool to enable two-scale macro-micro coupling using the coupling library preCICE. Installing the package Using pip3 It is reco

May 18, 2022

Advanced industrial efficiency-oriented object detection.

Advanced industrial efficiency-oriented object detection.

Introduction Welcome to AIRDet! AIRDet is an efficiency-oriented anchor-free object detector, aims to enable robust object detection in various indust

Nov 11, 2022

Code for the Paper "Improving Diffusion Model Efficiency Through Patching"

Patch Diffusion Code for the paper "Improving Diffusion Model Efficiency Through Patching". The core idea of the paper is to insert a ViT-style patchi

Nov 29, 2022

DepthShrinker: A New Compression Paradigm Towards Boosting Real-Hardware Efficiency of Compact Neural Networks

 DepthShrinker: A New Compression Paradigm Towards Boosting Real-Hardware Efficiency of Compact Neural Networks

[ICML 2022] DepthShrinker: A New Compression Paradigm Towards Boosting Real-Hardware Efficiency of Compact Neural Networks, by Yonggan Fu, Haichuan Yang, Jiayi Yuan, Meng Li, Cheng Wan, Raghuraman Krishnamoorthi, Vikas Chandra, Yingyan Lin

Oct 29, 2022

A tool to find Discords corresponding to Roblox accounts with added friend searching for maximum efficiency.

Roblox Discord Finder What is this? A tool to find Discords corresponding to Roblox accounts with added friend searching for maximum efficiency. How d

Nov 6, 2022

A python dictionary that uses Redis as in-memory storage backend to facilitate distributed computing applications development.

redis-pydict A python dictionary that uses Redis as in-memory storage backend to facilitate distributed computing applications development. This libra

Nov 2, 2022

The Implementation based on previous work by BostonDidi Team, completed most of the work that was left unfinished before.

This repo is for implementing MV3D from this paper: https://arxiv.org/abs/1611.07759 * This implementation are completed based on the open resource by

Mar 9, 2022
Owner
Davis
Davis
Proof of Concept: Privilage escalation in Ubuntu Touch 16.04 - by PIN Bruteforce

Proof of Concept: Privilege escalation in Ubuntu Touch 16.04 - by Passcode Bruteforce Ubuntu Touch allows you to "protect" devices with a 4-digit pass

Filip Karczewski 4 Sep 26, 2022
A simple Python module for the Bitflow Anti-Fish API

Bitflow Anti-Fish API This is a simple Python module for the Bitflow Anti-Fish API! Installation Use the package manager pip to install this module. p

null 1 Jul 12, 2022
Parser for ictio.org Citizen Observatory data for Amazon basin fish observation

IctioPy Python3 data access library for ictio.org's Citizen Observatory for Amazon basin fish observation. This python module provides helper routines

ScienceForChange 2 May 9, 2022
This YOLOv5 script is for detecting fish using pre-trained weight in video

YOLOv5 for Fish Detection in Video Please follows all the instruction from the YOLOv5 repository: https://github.com/ultralytics/yolov5. Then, copy th

Delowar Hossain 1 Sep 13, 2022
Ever deal with multiple huge csv files and and the panads read_csv method is slowing you down? You are not alone.

read-csv-turbo Ever deal with multiple huge csv files and and the panads read_csv/skiprows method is slowing you down? You are not alone. read-csv-tur

donjor 2 Apr 22, 2022
Hands on session on how to generate and deal with sequencing data in bioinformatic analyses.

IBECourse2022_SequencingData Hands on session on how to generate and deal with sequencing data in bioinformatic analyses. VCF files and bcftools Mater

null 3 Jul 22, 2022
This is repository containing general code to deal with causal sets in python.

Overview This is a depository for all the code used for the MSci project on Causal Sets. Testing commits. Introduction Causal set theory is a framewor

Vid Homsak 1 Oct 16, 2022
This project is an unofficial summary of the resources related to VALSE and its annual seminar. Its main purpose is to more facilitate your communication and learning, and we also welcome your additions and suggestions.

简体中文 | English Abstract Official website | Official Accounts | Blog The main purpose of the VALSE annual seminar is to provide a stage for deep academ

Xu Lin 14 Nov 10, 2022
A pile of small and simple python programs that primarily focus on the improvement of problem solving skills and efficiency in programming in python.

Pydophile A pile of small and simple python programs that primarily focus on the improvement of problem solving skills and efficiency in programming i

Anikate De 5 Oct 18, 2022
StocksMA is a package to facilitate access to financial and economic data of Moroccan stocks.

Creating easier access to the Moroccan stock market data What is StocksMA ? StocksMA is a package to facilitate access to financial and economic data

Salah Eddine LABIAD 25 Oct 18, 2022