mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix calendar time, neopia fix
This commit is contained in:
@@ -38,6 +38,7 @@ module.exports = class HolidaysCommand extends Command {
|
||||
singleEvents: true,
|
||||
timeMax: tomorrow().toISOString(),
|
||||
timeMin: today().toISOString(),
|
||||
timeZone: 'UTC',
|
||||
key: GOOGLE_KEY
|
||||
});
|
||||
if (!body.items.length) return null;
|
||||
|
||||
@@ -22,10 +22,14 @@ module.exports = class TimeCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { timeZone }) {
|
||||
if (timeZone === 'NEOPIA/STANDARD') timeZone = 'AMERICA/VANCOUVER';
|
||||
let neopia = false;
|
||||
if (timeZone === 'NEOPIA/STANDARD' || timeZone === 'NEOPIA') {
|
||||
timeZone = 'AMERICA/VANCOUVER';
|
||||
neopia = true;
|
||||
}
|
||||
try {
|
||||
const time = new Date().toLocaleTimeString('en-US', { timeZone });
|
||||
return msg.say(`The current time in ${timeZone} is ${time}.`);
|
||||
return msg.say(`The current time in ${neopia ? 'NEOPIA' : timeZone} is ${time}.`);
|
||||
} catch (err) {
|
||||
return msg.reply('Invalid time zone. Refer to <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>.');
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "81.0.5",
|
||||
"version": "81.0.6",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user