Skip to content

Commit

Permalink
Merge pull request #27 from Lhcfl/dev
Browse files Browse the repository at this point in the history
将招呼间隔调整到4小时
  • Loading branch information
Lhcfl authored Oct 15, 2023
2 parents bc2397e + 24445e5 commit 2654905
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Check
name: Build

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
- 'releases/**'

jobs:
eslint:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -19,3 +19,23 @@ jobs:
node-version: 18
- run: npm install
- run: npm run build

# - name: Configure Git # 配置Git
# env:
# DEPLOY_PRI: ${{ secrets.DEPLOY_PRI }}
# GIT_USERNAME: Bot
# GIT_EMAIL: ${{ github.repository_owner }}@user.github.com
# run: |
# sudo timedatectl set-timezone "Asia/Shanghai"
# mkdir -p ~/.ssh/
# echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh-keyscan github.com >> ~/.ssh/known_hosts
# git config --global user.name '$DEPLOY_PRI'
# git config --global user.email '$DEPLOY_PRI'

# - name: Update package-lock.json
# run: |
# git add package-lock.json
# git commit -m "Auto Update package-lock" --no-verify
# git push origin main
2 changes: 1 addition & 1 deletion .github/workflows/tsdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
git add -A
git commit -m "API Document generated."
- name: Push javadocs # 推送
- name: Push TSDocs # 推送
run: |
cd docs
git push origin HEAD:gh-pages --force
5 changes: 2 additions & 3 deletions src/plugins/auto_reply/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const handleReply = async (app: App, msg: Message) => {
[22, 23, '很晚了呢, 揉揉${user}, 该睡觉了呢, 不要熬夜哦'],
[0, 1, '很晚了呢, 揉揉${user}, 该睡觉了呢, 不要熬夜哦'],
[2, 4, '是凌晨了呢, 揉揉抱抱${user}, 要注意身体呀, 记得睡觉的说'],
[5, 6, '早安, ${user}~ 希望早起的你能无往不利呢'],
[7, 9, '早安, ${user}~ 新的一天也会有新的美好的~'],
[7, 10, '早安, ${user}~ 新的一天也会有新的美好的~'],
];
const vars: { [k: string]: string } = {
user: getName(msg.from),
Expand All @@ -32,7 +31,7 @@ const handleReply = async (app: App, msg: Message) => {
if (reply_it === undefined) return;
const rephr = repdate.getHours();
const [lo, hi, rep] = reply_it;
if (lo <= rephr && rephr <= hi && msgdate.getTime() - repdate.getTime() <= 86400_000) return;
if (lo <= rephr && rephr <= hi && msgdate.getTime() - repdate.getTime() <= 14400_000) return;
void app.bot.sendMessage(
msg.chat.id,
rep.replaceAll(/\${(\w*)}/g, (_, s: string) => vars[s])
Expand Down

0 comments on commit 2654905

Please sign in to comment.