This project is based on Wechaty and Puppeteer. Since new wechat account after 2017 can not use wechat web api, so we need to use puppeteer to simulate the login process (but it costs money). And it be written for our UTLeetcoder Project
If you want to run this bot locally, you need to do the following steps:
- clone this repo and then run
npm install
to install all dependencies. - run
npm run demo
to start the bot.
All bot commands are written in helper.ts
. You can add your own commands in this file. And main.ts
is the main file of this project which create a bot instance and then start the bot.
This bot can be called by @bot
in wechat at index 0.
- get date statistics from UTLeetcoder provide json by provide message with head
@bot
andcheck daily xxxx-xx-xx
wherexxxx-xx-xx
is the date format you want to check. The bot will return the statistics of that day (but only top 3, cz may lots of data). - get weekly statistics from UTLeetcoder provide json by provide message with head
@bot
andcheck weeekly xxxx-xx
wherexxxx
stand for the year andxx
stand for the week number. The bot will return the statistics of that week. - get specific user statistics from UTLeetcoder provide json by provide message with head
@bot
andcheck user xxxx
wherexxxx
is the user name (notice, we dont exactly know your query name so that we query all string followeduser
plz type correct name). The bot will return the statistics of that user. - use davinci text model by provide message with head
@bot
andopenai prompt xxxx
wherexxxx
is the sentence you wanna ask or complete. - if you want request multiple statistics, you can provide message contain
@bot
and above commands split by;
. The bot will return the statistics of all commands.
If you want to contribute to this project, you can fork this repo and then create a pull request. We will review your code and merge it if it is good.
If you have any questions, you can create an issue in this repo.