diff --git a/data/current_radar.gif b/data/current_radar.gif index a45d539..049f085 100644 Binary files a/data/current_radar.gif and b/data/current_radar.gif differ diff --git a/src/index.js b/src/index.js index 3155d69..28e66b9 100644 --- a/src/index.js +++ b/src/index.js @@ -26,6 +26,8 @@ const client = new Client({ const config = JSON.parse(fs.readFileSync(path.resolve("config", "config.json"))); +process.env.TZ = config.timezone; + client.once(Events.ClientReady, readyClient => { console.log(`Ready! Logged in as ${readyClient.user.tag}`); }); @@ -70,9 +72,7 @@ client.on('ready', () => { console.log("Updating on boot"); - let date = new Date().toISOString(). - replace(/T/, ' '). // replace T with a space - replace(/\..+/, '') + let date = new Date().toLocaleString('th-TH'); let caption = `# Weather Update\n## ${date}\n${radar_caption}` @@ -107,11 +107,9 @@ client.on('ready', () => { await channel.messages.delete(message_id); console.log("Delete old message"); - let date = new Date().toISOString(). - replace(/T/, ' '). // replace T with a space - replace(/\..+/, '') + let date = new Date().toLocaleString('th-TH'); - let caption = `# Weather Update\n## ${date} Asia/Bangkok\n${radar_caption}` + let caption = `# Weather Update\n## ${date}\n${radar_caption}` let message = await channel.send({ content: caption,