Skip to content

Commit 58cf01b

Browse files
authored
update master to latest pmcenter-lazer version
Update master branch for pmcenter v2 preparation
2 parents ee41696 + 4de73d4 commit 58cf01b

38 files changed

Lines changed: 377 additions & 70 deletions

AUTHORS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# pmcenter Authors
2+
3+
Thanks to all the people that had made contributions to the pmcenter project:
4+
5+
If you're a new contributor, feel free to add yourself to the list when committing.
6+
7+
### List of pmcenter Authors
8+
9+
Elepover / Elepooooover
10+
Genteure
11+
jimchen5209 / Jim Chen
12+
lwl12
13+
milkice233 / milkice
14+
tasi788 / 踢低吸
15+
U2FsdGVkX1

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A telegram bot helping you process private messages.
2525
> - [⛵ Changing File Location](#changing-file-location)
2626
> - [🚀 Starting](#starting)
2727
> - [🔩 Commands](#commands)
28+
> - [❔ FAQ](#faq)
2829
> - [🔺 Disclaimer](#disclaimer)
2930
3031
## Branches
@@ -173,6 +174,8 @@ Or, use setup wizard:
173174
| `AdvancedLogging` | `Boolean` || If enabled, pmcenter will display the code files and line number where the logging was triggered. |
174175
| `DisableTimeDisplay` | `Boolean` || Don't display time in the logs. |
175176
| `UpdateChannel` | `String` || Choose which update channel you prefer to. |
177+
| `IgnoreKeyboardInterrupt` | `Boolean` || Choose whether pmcenter should ignore Ctrl-C interrupts or not. |
178+
| `DisableNetCore3Check` | `Boolean` || Turn this on to hide .NET Core Runtime version warnings. |
176179
| `Statistics` | `Stats` || Statistics data. |
177180
| `Socks5Proxies` | `Array` || List of SOCKS5 proxies. |
178181
| `BannedKeywords` | `Array` || Storage of banned keywords. |
@@ -261,9 +264,9 @@ You can write a `systemd service` to keep it running, even after the host machin
261264

262265
Please note: `/restart` command only works with a daemon that auto-restarts pmcenter when it exits. pmcenter cannot restart by itself.
263266

264-
# Known Problems
267+
## Known Problems
265268

266-
## OpenSSL Compatibility Problem
269+
### OpenSSL Compatibility Problem
267270

268271
This problem only occurs on Linux, and will not occur on Windows.
269272

@@ -284,6 +287,34 @@ As is mentioned in issue [#33179](https://github.com/dotnet/corefx/issues/33179)
284287
2. Upgrade to a newer (later than #34443) .NET Core 2.1 runtime.
285288
3. Install OpenSSL 1.0.
286289

287-
# Disclaimer
290+
## FAQ
291+
292+
### Why are you still targeting to .NET Core 2.1?
293+
294+
According to [.NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core), the .NET Core 2.2 is now EOL, .NET Core 3.0 is also approaching its _End of Support Date_. As for .NET Core 3.1, which has LTS support level, it may not be as widely supported as .NET Core 2.1 (which also has LTS support level). So we finally chose .NET Core 2.1.
295+
296+
The existing pmcenter code is completely compatible with .NET Core 3.1, but will not take advantage of the new features (like AOT compilation and TLS 1.3 support).
297+
298+
pmcenter is planning to move to .NET Core 3.1, see [issue #25](https://github.com/Elepover/pmcenter/issues/25).
299+
300+
### Why cannot I reply to anonymously forwarded messages?
301+
302+
Please enable the `EnableMsgLink` option in pmcenter's configurations file. Only messages forwarded when `EnableMsgLink` option is turned on can be replied.
303+
304+
For more information, refer to the [configurations](#pmcenter-settings) part.
305+
306+
### Why pmcenter.json is too large?
307+
308+
Maybe your pmcenter instance has saved too many Message Links, try this following command:
309+
310+
`/clearmessagelinks`
311+
312+
### Why pmcenter didn't restart when I use the `/restart` command?
313+
314+
The `/restart` command requires a daemon process or service manager (like `systemd` in some Linux distros), it cannot be restarted by itself. Check your system's configurations.
315+
316+
We also have a sample `systemd` service for you [here](https://github.com/Elepover/pmcenter/blob/master/pmcenter.service).
317+
318+
## Disclaimer
288319

289320
The program is licensed under Apache License _(Version 2.0. Dependencies are licensed under MIT License)_ and comes with **ABSOLUTELY NO WARRANTY**. By using the program in any way, you acknowledge and confirm that the developer of the program is **NOT RESPONSIBLE** for service outage, data loss or any other rare unlisted incident caused by the program.

README_zh.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
> - [⛵ 改变文件位置](#改变文件位置)
2626
> - [🚀 启动](#启动)
2727
> - [🔩 命令](#命令)
28+
> - [❔ 常见问题](#常见问题)
2829
> - [🔺 免责声明](#免责声明)
2930
3031
## 分支
@@ -175,6 +176,8 @@ docker run -d -v $(pwd)/pmcenter.json:/opt/pmcenter/pmcenter.json --restart alwa
175176
| `AdvancedLogging` | `Boolean` || 如果启用,pmcenter 会在日志消息中附加输出时的代码文件及行号信息 |
176177
| `DisableTimeDisplay` | `Boolean` || 不在日志中显示时间 |
177178
| `UpdateChannel` | `String` || 选择更新频道 |
179+
| `IgnoreKeyboardInterrupt` | `Boolean` || 是否忽略 Ctrl-C 中断 |
180+
| `DisableNetCore3Check` | `Boolean` || 启用以忽略 .NET Core 运行时版本检查 |
178181
| `Statistics` | `Stats` || 统计数据 |
179182
| `Socks5Proxies` | `Array` || SOCKS5 代理列表 |
180183
| `BannedKeywords` | `Array` || 屏蔽的关键字存储 |
@@ -264,9 +267,9 @@ pmcenter_lang: pmcenter 语言文件路径。
264267

265268
请注意: `/restart` 命令仅在有有效的守护进程,且其能在 pmcenter 退出后自动将其重启的情况下工作。pmcenter 无法自行重新启动。
266269

267-
# 已知问题
270+
## 已知问题
268271

269-
## OpenSSL 1.1 兼容性问题
272+
### OpenSSL 1.1 兼容性问题
270273

271274
此问题仅在 Linux 环境下出现,与 Windows 无关。
272275

@@ -287,7 +290,35 @@ System.Net.Http.HttpRequestException: The SSL connection could not be establishe
287290
2. 更新 (新于 #34443) 的 .NET Core 2.1 运行时。
288291
3. 安装 OpenSSL 1.0.
289292

290-
# 免责声明
293+
## 常见问题
294+
295+
### 为什么 pmcenter 的目标框架仍然是 .NET Core 2.1?
296+
297+
根据 [.NET Core 支持政策](https://dotnet.microsoft.com/platform/support/policy/dotnet-core),.NET Core 2.2 已停止支持,.NET Core 3.0 也即将达到“终止支持日期”,至于有长期支持的 .NET Core 3.1,其支持范围可能不如同样为长期支持的 .NET Core 2.1,所以我们最终选择了 .NET Core 2.1.
298+
299+
现有的 pmcenter 代码与 .NET Core 3.1 完全兼容,但无法利用其新特性 (如提前编译及 TLS 1.3 支持)。
300+
301+
pmcenter 正在准备转向 .NET Core 3.1,请参考 [issue #25](https://github.com/Elepover/pmcenter/issues/25).
302+
303+
### 为什么我无法回复匿名转发的消息?
304+
305+
请在 pmcenter 设置文件中启用 `EnableMsgLink` 选项。只有在 `EnableMsgLink` 选项启用后的转发的消息可以被回复。
306+
307+
如需更多信息,请参见[配置](#pmcenter-设置)部分。
308+
309+
### 为什么 pmcenter.json 这么大?
310+
311+
可能您的 pmcenter 实例保存了太多的消息链接,请尝试使用以下命令:
312+
313+
`/clearmessagelinks`
314+
315+
### 为什么 pmcenter 在我使用 `/restart` 命令时并未重启?
316+
317+
`/restart` 命令需要一个守护进程或服务管理器 (比如在一些 Linux 发行版中的 `systemd`),其无法自行重启,请检查您的系统设置。
318+
319+
我们也[在此](https://github.com/Elepover/pmcenter/blob/master/pmcenter.service)为您提供了一份示例 `systemd` 服务文件。
320+
321+
## 免责声明
291322

292323
很抱歉,但鉴于某些事件,我们实在不得不加入这个章节,以至于独立成一个 commit 来提交。
293324

locales/pmcenter_locale_en.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"TargetVersion": "1.9.1.271",
2+
"TargetVersion": "1.9.280.15",
33
"LangCode": "en.imported",
44
"LanguageNameInEnglish": "English",
55
"LanguageNameInNative": "English",
@@ -40,13 +40,13 @@
4040
"Message_SysStatus_UpdateLevel_Unknown": "❓ Unknown",
4141
"Message_SysStatus_RestartRequired": "🔄 *Bot restart required to apply changes.*",
4242
"Message_SysStatus_Summary": "📝 *Device name*: `$1`\n💿 *Operating System*: `$2`\nℹ *OS description*: `$3`\n⌛ *Server uptime*: `$4`\n🕓 *Bot uptime*: `$5`\n📅 *Server time (UTC)*: `$6`\n📐 *Runtime version*: `$7`\nℹ *Runtime description*: `$8`\n📏 *Application version*: `$9`\n💠 *Processor count*: `$a`\n📖 *Language code*: `$b`\n🛫 *Update channel (current)*: `$f`\n🛬 *Update channel (target)*: `$g`\n🔄 *Update checker*: `$c`\n🔄 *Rate limit processor*: `$d`\n🔄 *Configuration reset verifier*: `$e`",
43-
"Message_Restarting": "🔄 Restarting...\n\n_It only works with systemd daemon._",
43+
"Message_Restarting": "🔄 Restarting...\n\n_It only works with systemd-like daemons._",
4444
"Message_NotificationsOff": "📳 Notifications are *OFF*.",
4545
"Message_NotificationsOn": "📲 Notifications are *ON*.",
4646
"Message_SupportTextMessagesOnly": "📋 Sorry... Only text messages can be forwarded in Anonymous Forward mode.",
4747
"Message_ForwarderNotReal": "ℹ The actual sender of this message is $1, whose UID is `$2`.\n\nYou can also ban this user by sending this following command:\n\n`/banid $2`\n\nTo undo this, send this command:\n\n`/pardonid $2`",
4848
"Message_GeneralFailure": "✖ Error processing request: $1",
49-
"Message_LangVerMismatch": "⚠ Language file ($1) is not for current version ($2), consider updating language file?",
49+
"Message_LangVerMismatch": "⚠ Language file (`$1`) is not for current version (`$2`), consider updating language file?",
5050
"Message_SwitchingLang": "💠 Switching language...",
5151
"Message_LangSwitched": "🚀 Language switched!",
5252
"Message_ThreadStatus_Unknown": "Unknown",
@@ -69,5 +69,6 @@
6969
"Message_Stats": "📝 *Statistics*\n\n💬 Received messages: `$1`\n🔄 Forwarded to owner: `$2`\n🔄 Forwarded from owner: `$3`\n🚀 Commands received: `$4`",
7070
"Message_Retracted": "✅ This message has been retracted.",
7171
"Message_MsgLinksCleared": "✅ All message links have been cleared.",
72-
"Message_AvailableLang": "ℹ *Available languages*\n\n`$1`"
72+
"Message_AvailableLang": "ℹ *Available languages*\n\n`$1`",
73+
"Message_NetCore31Required": "⚠ You need `.NET Core 3.1` (runtime) installed in order to receive pmcenter v2 and further updates.\n\nLatest .NET Core runtime version detected on your device: `$1`\n\nThis warning will only show once."
7374
}

locales/pmcenter_locale_zh.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"TargetVersion": "1.9.1.271",
2+
"TargetVersion": "1.9.280.15",
33
"LangCode": "zh.simplified",
44
"LanguageNameInEnglish": "Chinese (Simplified)",
55
"LanguageNameInNative": "简体中文",
@@ -46,7 +46,7 @@
4646
"Message_SupportTextMessagesOnly": "📋 抱歉,匿名转发模式下仅能转发纯文本消息。",
4747
"Message_ForwarderNotReal": "ℹ 实际消息发送者为: $1, 其 UID 为: `$2`.\n\n您也可以发送以下命令来屏蔽该用户:\n\n`/banid $2`\n\n若要撤销操作,请发送:\n\n`/pardonid $2`",
4848
"Message_GeneralFailure": "✖ 处理请求时出错: $1",
49-
"Message_LangVerMismatch": "⚠ 语言文件 ($1) 不适用于当前版本 ($2), 请考虑升级。",
49+
"Message_LangVerMismatch": "⚠ 语言文件 (`$1`) 不适用于当前版本 (`$2`), 请考虑升级。",
5050
"Message_SwitchingLang": "💠 正在切换语言...",
5151
"Message_LangSwitched": "🚀 语言已切换!",
5252
"Message_ThreadStatus_Unknown": "未知",
@@ -69,5 +69,6 @@
6969
"Message_Stats": "📝 *统计数据*\n\n💬 接收到的消息: `$1`\n🔄 已转发给所有者: `$2`\n🔄 从所有者处转发: `$3`\n🚀 接收到的命令: `$4`",
7070
"Message_Retracted": "✅ 消息已撤回。",
7171
"Message_MsgLinksCleared": "✅ 所有消息链接已清空。",
72-
"Message_AvailableLang": "ℹ *可用语言*\n\n`$1`"
72+
"Message_AvailableLang": "ℹ *可用语言*\n\n`$1`",
73+
"Message_NetCore31Required": "⚠ 您的设备上需要安装 `.NET Core 3.1` (运行时) 以获取 pmcenter v2 或未来版本的更新。\n\n在您设备上检测到的最新 .NET Core 运行时版本为: `$1`\n\n此警告只会出现一次。"
7374
}

locales/pmcenter_locale_zh.meow.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"TargetVersion": "1.9.1.271",
2+
"TargetVersion": "1.9.280.15",
33
"LangCode": "zh.meow",
44
"LanguageNameInEnglish": "Chinese (Meow)",
55
"LanguageNameInNative": "喵体中文",
@@ -46,7 +46,7 @@
4646
"Message_SupportTextMessagesOnly": "📋 抱歉qaq, 匿名转发模式下仅能转发纯文本消息。",
4747
"Message_ForwarderNotReal": "ℹ 实际消息发送者为: $1, 其 UID 为: `$2`.\n\n主人也可以发送以下命令来拍扁该用户:\n\n`/banid $2`\n\n若要撤销操作,请发送:\n\n`/pardonid $2`",
4848
"Message_GeneralFailure": "✖ 处理请求时撞墙了qaq: $1",
49-
"Message_LangVerMismatch": "⚠ 诶,语言文件 ($1) 好像不适用于当前版本 ($2) 呢, 要不要帮本喵升级一下呢w",
49+
"Message_LangVerMismatch": "⚠ 诶,语言文件 (`$1`) 好像不适用于当前版本 (`$2`) 呢, 要不要帮本喵升级一下呢w",
5050
"Message_SwitchingLang": "💠 语言包马上就切换好惹w",
5151
"Message_LangSwitched": "🚀 语言包切换好啦~",
5252
"Message_ThreadStatus_Unknown": "未知",
@@ -69,5 +69,6 @@
6969
"Message_Stats": "📝 *统计数据*\n\n💬 小喵接收到的消息: `$1`\n🔄 已转发给主人: `$2`\n🔄 从主人这里转发: `$3`\n🚀 接收到的命令: `$4`",
7070
"Message_Retracted": "✅ 消息已经从主人那边撤回啦~",
7171
"Message_MsgLinksCleared": "✅ 所有消息链接都清理掉啦~",
72-
"Message_AvailableLang": "ℹ *可用语言*\n\n`$1`"
72+
"Message_AvailableLang": "ℹ *可用语言*\n\n`$1`",
73+
"Message_NetCore31Required": "⚠ 您的设备上需要安装 `.NET Core 3.1` (运行时) 以获取 pmcenter v2 或未来版本的更新。\n\n在您设备上检测到的最新 .NET Core 运行时版本为: `$1`\n\n此警告只会出现一次。"
7374
}

locales/pmcenter_locale_zh.tw.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"TargetVersion": "1.9.1.271",
2+
"TargetVersion": "1.9.280.15",
33
"LangCode": "zh.tw",
44
"LanguageNameInEnglish": "Chinese (Traditional, Taiwan)",
55
"LanguageNameInNative": "繁體中文(台灣)",
@@ -46,7 +46,7 @@
4646
"Message_SupportTextMessagesOnly": "📋 抱歉,匿名轉傳模式下僅能轉傳純文字訊息。",
4747
"Message_ForwarderNotReal": "ℹ 實際訊息發送者為: $1, 其 UID 為: `$2`.\n\n您也可以發送以下指令來封鎖該用戶:\n\n`/banid $2`\n\n若要撤銷操作,請發送:\n\n`/pardonid $2`",
4848
"Message_GeneralFailure": "✖ 處理請求時出錯: $1",
49-
"Message_LangVerMismatch": "⚠ 語言文件 ($1) 不適用於目前版本 ($2), 請考慮升級。",
49+
"Message_LangVerMismatch": "⚠ 語言文件 (`$1`) 不適用於目前版本 (`$2`), 請考慮升級。",
5050
"Message_SwitchingLang": "💠 正在切換語言...",
5151
"Message_LangSwitched": "🚀 語言已切換!",
5252
"Message_ThreadStatus_Unknown": "未知",
@@ -69,5 +69,6 @@
6969
"Message_Stats": "📝 *統計數據*\n\n💬 接收到的訊息: `$1`\n🔄 已轉傳給所有者: `$2`\n🔄 從所有者處轉傳: `$3`\n🚀 接收到的指令: `$4`",
7070
"Message_Retracted": "✅ 訊息已撤銷。",
7171
"Message_MsgLinksCleared": "✅ 所有訊息鏈接已清空。",
72-
"Message_AvailableLang": "ℹ *可用語言*\n\n`$1`"
72+
"Message_AvailableLang": "ℹ *可用語言*\n\n`$1`",
73+
"Message_NetCore31Required": "⚠ 您的設備上需要安裝 `.NET Core 3.1` (運行時) 以獲取 pmcenter v2 或更新版本更新。\n\n在您的設備上識別到的最新 .NET Core 運行時版本為: `$1`\n\n此警告僅會出現一次。"
7374
}

og-banner.psd

11.7 MB
Binary file not shown.

pmcenter/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dotnet_diagnostic.CA1062.severity = suggestion
3030
# CA1707: Identifiers should not contain underscores
3131
dotnet_diagnostic.CA1707.severity = suggestion
3232

33-
# IDE0060: 删除未使用的参数
33+
# IDE0060: Delete unused arguments
3434
dotnet_code_quality_unused_parameters = all:suggestion
3535

3636
# CA2234: Pass system uri objects instead of strings

pmcenter/BotCommands/ResetConfCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
3939
false,
4040
Vars.CurrentConf.DisableNotifications,
4141
update.Message.MessageId).ConfigureAwait(false);
42-
Environment.Exit(0);
42+
Methods.ExitApp(0);
4343
return true;
4444
}
4545
else
@@ -51,8 +51,8 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
5151
false,
5252
Vars.CurrentConf.DisableNotifications,
5353
update.Message.MessageId).ConfigureAwait(false);
54-
Thread ConfValidator = new Thread(() => Methods.ThrDoResetConfCount());
55-
ConfValidator.Start();
54+
Vars.ConfValidator = new Thread(() => Methods.ThrDoResetConfCount());
55+
Vars.ConfValidator.Start();
5656
return true;
5757
}
5858
}

0 commit comments

Comments
 (0)