mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-12-02 11:57:39 -05:00
revert
This commit is contained in:
parent
0e706e7251
commit
1d0d365eed
1 changed files with 12 additions and 16 deletions
|
@ -8,15 +8,11 @@ module.exports = {
|
||||||
trusted: 0,
|
trusted: 0,
|
||||||
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
||||||
const timezone = args.join(' ')
|
const timezone = args.join(' ')
|
||||||
const format = 'dddd, MMMM Do, YYYY, hh:mm:ss A'
|
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||||
const momented = moment().tz(timezone).format(format)
|
|
||||||
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 (momented === moment().format(format) &&
|
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc' || timezone.toLowerCase() === 'america/new_york') {
|
||||||
(timezone.toLowerCase() !== 'asia/bangkok' ||
|
bot.tellraw(selector, component)
|
||||||
timezone.toLowerCase() !== 'utc' ||
|
} else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) {
|
||||||
timezone.toLowerCase() !== 'america/new_york'
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
throw new SyntaxError('Invalid timezone')
|
throw new SyntaxError('Invalid timezone')
|
||||||
} else {
|
} else {
|
||||||
bot.tellraw(selector, component)
|
bot.tellraw(selector, component)
|
||||||
|
@ -24,15 +20,15 @@ module.exports = {
|
||||||
},
|
},
|
||||||
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
||||||
const timezone = args.join(' ')
|
const timezone = args.join(' ')
|
||||||
const format = 'dddd, MMMM Do, YYYY, hh:mm:ss A'
|
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||||
const momented = moment().tz(timezone).format(format)
|
|
||||||
const description = `The current date and time for the timezone ${timezone} is: ${momented}`
|
const description = `The current date and time for the timezone ${timezone} is: ${momented}`
|
||||||
if (momented === moment().format(format) &&
|
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc' || timezone.toLowerCase() === 'america/new_york') {
|
||||||
(timezone.toLowerCase() !== 'asia/bangkok' ||
|
const Embed = new EmbedBuilder()
|
||||||
timezone.toLowerCase() !== 'utc' ||
|
.setColor(config.discord.embedsColors.normal)
|
||||||
timezone.toLowerCase() !== 'america/new_york'
|
.setTitle('Time')
|
||||||
)
|
.setDescription(description)
|
||||||
) {
|
channeldc.send({ embeds: [Embed] })
|
||||||
|
} else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) {
|
||||||
throw new SyntaxError('Invalid timezone')
|
throw new SyntaxError('Invalid timezone')
|
||||||
} else {
|
} else {
|
||||||
const Embed = new EmbedBuilder()
|
const Embed = new EmbedBuilder()
|
||||||
|
|
Loading…
Reference in a new issue