mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 perf: 简化腿忒配置
1. 简化配置 2. 更新README
This commit is contained in:
parent
9890f7366b
commit
3177408a99
@ -121,10 +121,10 @@ async tuiimg (e) {
|
||||
### 其他进阶操作
|
||||
【可选】相关配置(apps/tools.js):
|
||||
> twiiter-api:https://developer.twitter.com/en
|
||||
注册完之后将`Bearer Token`填入app/tools.js twitter方法的TwitterApi后面的单引号里`const twitterClient = new TwitterApi('', {httpAgent});`
|
||||
注册完之后将`Bearer Token`填入config/tools.yaml`
|
||||
|
||||
> 百度翻译api:https://fanyi-api.baidu.com/doc/21
|
||||
注册完填入方式参考上方注释url (app/tools.js);另外,有群友反馈百度翻译需要充钱才能使用!
|
||||
注册完填入方式参考上方注释url (config/tools.yaml);另外,有群友反馈百度翻译需要充钱才能使用!
|
||||
|
||||
> 更改proxy地址在config/tools.yaml:
|
||||
`proxyAddr: '127.0.0.1' # 魔法地址`
|
||||
|
@ -90,6 +90,8 @@ export class tools extends plugin {
|
||||
// 加载百度翻译配置
|
||||
this.translateAppId = this.toolsConfig.translateAppId;
|
||||
this.translateSecret = this.toolsConfig.translateSecret;
|
||||
// 加载twitter配置
|
||||
this.bearerToken = this.toolsConfig.bearerToken;
|
||||
}
|
||||
|
||||
// 翻译插件
|
||||
@ -354,7 +356,7 @@ export class tools extends plugin {
|
||||
const twitterUrl = reg.exec(e.msg);
|
||||
const id = twitterUrl[1];
|
||||
const httpAgent = new HttpProxyAgent(this.myProxy);
|
||||
const twitterClient = new TwitterApi("", { httpAgent });
|
||||
const twitterClient = new TwitterApi(this.bearerToken, { httpAgent });
|
||||
|
||||
// Tell typescript it's a readonly app
|
||||
const readOnlyClient = twitterClient.readOnly;
|
||||
|
@ -3,4 +3,6 @@ proxyAddr: '127.0.0.1' # 魔法地址
|
||||
proxyPort: '7890' # 魔法端口
|
||||
|
||||
translateAppId: '' # 百度翻译APP ID
|
||||
translateSecret: '' # 百度翻译密匙
|
||||
translateSecret: '' # 百度翻译密匙
|
||||
|
||||
bearerToken: '' # 推特Bearer Token
|
Loading…
x
Reference in New Issue
Block a user