Giter Site home page Giter Site logo

bilibili-bot-example's Introduction

这是什么?

B站机器人脚本,如果有用户@了机器人的账号,机器人就会按照代码回复

实现原理

一直向B站的@通知api发送请求,如果用户@的内容符合代码写的情况,便会调用B站api来回复,虽然只可以回复(其他功能有空我会继续做),但可以在本地利用用户@的内容干很多事

如何安装?

下载main.py,然后根据main.py内的import安装python模块

pip install requests以及pip install pymysql

当然,您也需要先配置好您的数据库,我推荐将数据库的字符编码改为utf8mb4,因为用户会输入emoji,而utf8无法显示emoji(根本无法储存在数据库中),本项目也提供了示例的数据库文件(omg_replys.sql)

使用例

可以看到机器人成功识别了查重内容并回复

在其他人的评论下@机器人也可以查重!

基于本项目还可以魔改出很多其他功能的机器人!

bilibili-bot-example's People

Contributors

hutaoloveu 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.