Update commands/time.js
This commit is contained in:
parent
df09e38075
commit
2c7a1baef0
1 changed files with 4 additions and 2 deletions
|
@ -13,15 +13,17 @@ const source = context.source
|
||||||
const args = context.arguments
|
const args = context.arguments
|
||||||
const timezone = args.join(' ')
|
const timezone = args.join(' ')
|
||||||
|
|
||||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
|
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase()) && bot.options.Core.CorelessMode) {
|
||||||
bot.chat('Invalid timezone')
|
bot.chat('Invalid timezone')
|
||||||
|
}else{
|
||||||
|
throw new CommandError('Invalid timezone')
|
||||||
}
|
}
|
||||||
|
|
||||||
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||||
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
|
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
|
||||||
|
|
||||||
|
|
||||||
if (!bot.options.Core.CorelessMode) {
|
if (bot.options.Core.CorelessMode) {
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue