mirror of https://github.com/Nofated095/Q2TG.git
feat: 能禁用文件上传的提示 #153
This commit is contained in:
parent
6c1727d432
commit
efd74084ea
|
@ -57,6 +57,8 @@ services:
|
|||
- SIGN_API=http://sign:8080/sign?key=114514
|
||||
- SIGN_VER=8.9.71 # 与上方 sign 容器的配置同步
|
||||
- TG_CONNECTION=tcp # 连接 Telegram 的方式,也可以改成 websocket
|
||||
# 要关闭文件上传提示,请取消注释以下变量 https://github.com/clansty/Q2TG/issues/153
|
||||
#- DISABLE_FILE_UPLOAD_TIP=1
|
||||
# 要支持转发时自动识别语音,请设置以下参数
|
||||
- BAIDU_APP_ID=
|
||||
- BAIDU_API_KEY=
|
||||
|
|
|
@ -368,7 +368,7 @@ export default class ForwardService {
|
|||
public async forwardFromTelegram(message: Api.Message, pair: Pair): Promise<Array<QQMessageSent>> {
|
||||
try {
|
||||
const tempFiles: FileResult[] = [];
|
||||
const chain: Sendable = [];
|
||||
let chain: Sendable = [];
|
||||
const senderId = Number(message.senderId || message.sender?.id);
|
||||
// 这条消息在 tg 中被回复的时候显示的
|
||||
let brief = '', isSpoilerPhoto = false;
|
||||
|
@ -529,6 +529,9 @@ export default class ForwardService {
|
|||
}
|
||||
}
|
||||
brief += '[文件]';
|
||||
if (process.env.DISABLE_FILE_UPLOAD_TIP) {
|
||||
chain = [];
|
||||
}
|
||||
}
|
||||
|
||||
if (message.message && !isSpoilerPhoto) {
|
||||
|
|
Loading…
Reference in New Issue