Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit e174147

Browse files
committed
修正時區與自動更新排程
1 parent 6ffdb10 commit e174147

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM python:3.8-slim
22

33
ENV NO_LOG_FILE=Yes
4+
ENV TZ=Asia/Taipei
45

56
COPY . /app
67

cogs/tasks/__init__.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self, bot: AIKyaru):
1111
self.bot = bot
1212
self.logger = logging.getLogger("AIKyaru.Tasks")
1313
self.loop = asyncio.get_event_loop()
14-
14+
1515
self.task_update_checker = self.loop.create_task(self.update_checker())
1616

1717
def cog_unload(self):
@@ -35,7 +35,11 @@ async def update_checker(self):
3535

3636
self.logger.info("Starting update task...")
3737
await self.bot.config.update()
38-
await asyncio.sleep(3660) # wait 1 hour
38+
await asyncio.sleep(5)
39+
await self.bot.gameData.tw.analytics()
40+
await self.bot.gameData.jp.analytics()
41+
await self.bot.config.update_gacha_emojis(self.bot)
42+
await asyncio.sleep(3600) # wait 1 hour
3943

4044
except asyncio.CancelledError:
4145
self.logger.info("Update task cancelled.")

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from utils.state_manger import StateManger, State
1616

1717
__author__ = "IanDesuyo"
18-
__version__ = "3.1.4"
18+
__version__ = "3.1.5"
1919

2020

2121
class AIKyaru(AutoShardedBot):

0 commit comments

Comments
 (0)