修复tg系统通知认证参数

This commit is contained in:
whyour 2021-10-18 19:18:46 +08:00
parent ef9fa02145
commit c42299766c
2 changed files with 6 additions and 2 deletions

View File

@ -127,6 +127,7 @@ export default class NotificationService {
telegramBotToken,
telegramBotUserId,
} = this.params;
const authStr = telegramBotProxyAuth ? `${telegramBotProxyAuth}@` : '';
const url = `https://${
telegramBotApiHost ? telegramBotApiHost : 'api.telegram.org'
}/bot${telegramBotToken}/sendMessage`;
@ -137,7 +138,7 @@ export default class NotificationService {
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
proxy: `http://${telegramBotProxyHost}:${telegramBotProxyPort}`,
proxy: `http://${authStr}${telegramBotProxyHost}:${telegramBotProxyPort}`,
};
const httpAgent = new HttpProxyAgent(options);
const httpsAgent = new HttpsProxyAgent(options);

View File

@ -115,7 +115,10 @@ export default {
},
{ label: 'telegramBotProxyHost', tip: '代理IP' },
{ label: 'telegramBotProxyPort', tip: '代理端口' },
{ label: 'telegramBotProxyAuth', tip: 'telegram代理配置认证参数' },
{
label: 'telegramBotProxyAuth',
tip: 'telegram代理配置认证参数, 用户名与密码用英文冒号连接 user:password',
},
{
label: 'telegramBotApiHost',
tip: 'telegram api自建的反向代理地址默认tg官方api',