Skip to content

Instantly share code, notes, and snippets.

@Abhisirwabotofc
Created January 29, 2022 06:01
Show Gist options
  • Save Abhisirwabotofc/91a06748ea84aede38849deb24f65d55 to your computer and use it in GitHub Desktop.
Save Abhisirwabotofc/91a06748ea84aede38849deb24f65d55 to your computer and use it in GitHub Desktop.
time
const riomwon = require("../Utilis/events");
const { getBuffer } = require('../Utilis/download');
const hrs = new Date().getHours({ timeZone: 'Asia/Kolkata' })
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
//live - by riomwon from whatsapp-bot
riomwon.addCommand({ pattern: 'time ?(.*)', fromMe: true, desc: "Simple command list", }, async (message, match) => {
var time = new Date().toLocaleString('HI', { timeZone: 'Asia/Kolkata' }).split(' ')[1]
var date = new Date().toLocaleDateString(get_localized_date)
var wish = ''
if (hrs < 12) wish = '*ɢᴏᴏᴅ ᴍᴏʀɴɪɴɢ ⛅*'
if (hrs >= 13 && hrs <= 16) wish = '*ɢᴏᴏᴅ ᴀғᴛᴇʀɴᴏᴏɴ 🌞*'
if (hrs >= 17 && hrs <= 19) wish = '*ɢᴏᴏᴅ ᴇᴠᴇɴɪɴɢ 🌥*'
if (hrs >= 20 && hrs <= 24) wish = '*ɢᴏᴏᴅ ɴɪɢʜᴛ 🌙*'
var am_pm = ''
if (hrs < 12) am_pm = 'ᴩᴍ'
if (hrs >= 12 && hrs <= 17) am_pm = 'ᴀᴍ'
if (hrs >= 17 && hrs <= 19) am_pm = 'ᴀᴍ'
if (hrs >= 19 && hrs <= 24) am_pm = 'ᴀᴍ'
const spark = [777,0,100,500,2719,2022,1000,999,2021] //items by raz
return await message.sendMessage(`╭────────────────╮
│ ` + wish + `
│ *ᴛɪᴍᴇ* *⌚` + time + ` ` + am_pm + `*
│ *Date* *🎲 ` + date + `*
╰────────────────╯
ɪᴛᴢ-ᴍᴇ ͢ʙᴏᴛ ᴀᴄʜᴜ`,{quoted : {
key: {
fromMe: false,
participant: "[email protected]",
remoteJid: "status@broadcast"
},
message: {
"orderMessage": {
"itemCount" : spark[Math.floor(8*Math.random())],
"status": 1,
"surface" : 1,
"message": " ɪᴛᴢ-ᴍᴇ ͢ʙᴏᴛ ᴀᴄʜᴜ ",
"orderTitle": "alive",
"sellerJid": '[email protected]'
}
}
}}) //Coded by raz...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment