updated timezone

This commit is contained in:
Win 2024-05-30 12:03:49 +07:00
parent e9a4bfe264
commit dc9cb2a8d9
2 changed files with 5 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@ -26,6 +26,8 @@ const client = new Client({
const config = JSON.parse(fs.readFileSync(path.resolve("config", "config.json"))); const config = JSON.parse(fs.readFileSync(path.resolve("config", "config.json")));
process.env.TZ = config.timezone;
client.once(Events.ClientReady, readyClient => { client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`); console.log(`Ready! Logged in as ${readyClient.user.tag}`);
}); });
@ -70,9 +72,7 @@ client.on('ready', () => {
console.log("Updating on boot"); console.log("Updating on boot");
let date = new Date().toISOString(). let date = new Date().toLocaleString('th-TH');
replace(/T/, ' '). // replace T with a space
replace(/\..+/, '')
let caption = `# Weather Update\n## ${date}\n${radar_caption}` let caption = `# Weather Update\n## ${date}\n${radar_caption}`
@ -107,11 +107,9 @@ client.on('ready', () => {
await channel.messages.delete(message_id); await channel.messages.delete(message_id);
console.log("Delete old message"); console.log("Delete old message");
let date = new Date().toISOString(). let date = new Date().toLocaleString('th-TH');
replace(/T/, ' '). // replace T with a space
replace(/\..+/, '')
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({ let message = await channel.send({
content: caption, content: caption,