Skip to content

Commit

Permalink
fix: limit timezone to at most utc+-100
Browse files Browse the repository at this point in the history
  • Loading branch information
Lhcfl committed Dec 11, 2023
1 parent 338ba27 commit 6b526f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/auto_reply/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const init: PluginInit = (init_app) => {
}
text = text.trim();
try {
text === 'none' || /^[uU][tT][cC][+-][\d]+(\.5)?$/.test(text) || dayjs().tz(text);
text === 'none' || /^[uU][tT][cC][+-][\d][\d]?(\.5)?$/.test(text) || dayjs().tz(text);
} catch (e) {
if (e instanceof RangeError) {
void app.bot.sendMessage(msg.chat.id, '无法识别时区名', {
Expand Down

0 comments on commit 6b526f8

Please sign in to comment.