Git Product home page Git Product logo

juzi-marketing-bot's Introduction

juzi-marketing-bot

功能简述

目前该机器人程序实现了通过句子秒回定时批量推送「早报」,「早间新闻」,「开心一刻」到指定企业微信群。并且每个群推送的数据可以根据群的相关信息进行自定义拉取

修改推送时间

如果想要修改推送时间,需要修改这个文件/src/config/time.config.ts,根据文件中的注释将其中对应的时间修改成想要的即可。 目前只支持修改成小时:分钟的格式,例如18:30即为下午六点半

修改推送消息格式

如果想要修改推送消息的格式,请前往这个文件/src/material/index.ts,这个文件里面目前有三个函数

  • getMorningMessage:根据网络API获取的数据来生成早报的消息,对应的各个部分的消息可以根据注释来理解
  • getNewsMessage:根据网络API获取早间新闻的消息,这个比较简单,只有一个消息模块可以用来排版
  • getJokeMessage:根据网络API获取开心一刻的消息,这个也比较简单,其中只有一个笑话模块可以用来排版

修改推送群信息

如果想要增加接收推送的群聊,请修改这个文件/src/config/room.config.ts,这个文件里面包含的都是群的相关消息,主要是下述几个重要的字段

  • chatId:聊天id,这个是秒回中用来发送消息所需的重要id,获取方式可以通过获取群聊信息的接口拉取
  • roomTopic: 群名,可以填空,这个目前没有具体的作用,只是为了方便管理
  • city:群所在的城市,这个需要根据不同的群进行配置
  • stationId:加油站的id,这个需要根据情况具体填写进来

For Developers

环境变量

本项目所需要调用的所有API接口都需要对应的key来使用,如果是本地开发,可以在根目录下创建一个.env的文件,并在文件中写入以下的值

JUHE_WEATHER_KEY=
JUHE_CALENDAR_KEY=
JUHE_NEWS_KEY=
JUHE_JOKE_KEY=

API_SPACE_KEY=
MH_TOKEN=

填入对应的值之后即可调用各个接口了

本地启动

安装依赖

npm install --registry=https://registry.npmmirror.com

运行程序

npm run start:dev

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.