Skip to content

Commit

Permalink
add binance api
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangWei-KUMO committed Oct 10, 2024
1 parent 46d5b0c commit 67fa10e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ BINANCE_TOPSEARCH=https://www.binance.com/bapi/composite/v1/public/future/extern
BINANCE_PRICE=https://api.binance.com/api/v3/ticker/24hr?symbol=
# 币安数字货币K线
BINANCE_KLINE=https://api.binance.com/api/v3/klines?interval=15m&limit=100&symbol=
# 经济新闻API ENDPOINT
NEWS_ENDPOINT=https://api-one-wscn.awtmt.com/apiv1/search/live?channel=global-channel&limit=40&score=2
# 经济新闻API ENDPOINT ETAG
NEWS_ETAG=VKikV7rHg+OhU+DW+HiofA==
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ This is an open-source WeChat robot project based on WechatY, Dify API services,
| Long Memeory for chat | 聊天长记忆 ||
| Self-running business | 自我运维 ||
| Crypto Coin Market Analysis | 数字货币市场分析 ||
| Crypto Coin Market Analysis | 传统金融市场数据获取及分析 ||

| Inpainting | 老照片修复 |🏃🏻‍♀️|
| Inpainting | 机器人集群启动 |🏃🏻‍♀️|

Expand Down Expand Up @@ -68,6 +70,12 @@ pm2 logs tubex-wechatbot

本机器人在登录账号实名认证后自身不会出现微信风控的问题,但是在群聊过程中高频率出现股票投资、比特币投资等话题情况下会导致群聊、朋友圈等功能被封一个月的情况。使用者请注意管控好机器人的言行。

### 数字货币功能的部署与使用

本机器人接入的数字货币信息均来源于币安实时信息,但是由于Binance API在中国境内无法访问,在部署服务器上请选择海外服务器。
在涉及数字货币的问题上,用户应该携带关键词如:数字货币、加密货币、趋势、走势等。目前仅支持当日币安最热门的5个币种的趋势分析。
由于市场分析的难度较大,建议开发者使用GPT-4o、Gemini 1.5、Gemini flash等海外大模型。

### Cooperation

lewis.q.zhang@gmail.com
Expand Down
16 changes: 1 addition & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {splitTextIntoArray} from './util/reply-filter.js'
import qrcode from 'qrcode-terminal';
import {transporter,mailOptions} from './util/mailer.js';
import schedule from 'node-schedule';
import {getNews,getStockPlan} from './util/group.js'
import {getNews} from './util/group.js'
import { WebSocketServer } from "ws"

const wss = new WebSocketServer({ port: 1984 })
Expand Down Expand Up @@ -308,20 +308,6 @@ export async function prepareBot() {
}
});
}

if(process.env.IS_BIGQUANT_MESSAGE){
const rule = new schedule.RecurrenceRule();
rule.hour = process.env.SCHEDULE_HOUR_2
rule.minute = process.env.SCHEDULE_MINUES_2
// 中国上海时间
rule.tz = 'Asia/Shanghai';
schedule.scheduleJob(rule, async()=>{
let result = await getStockPlan();
if(result){
await sendMessage(id, result);
}
});
}
})

await bot.start();
Expand Down

0 comments on commit 67fa10e

Please sign in to comment.