Skip to content

Instantly share code, notes, and snippets.

@Abhisirwabotofc
Created February 21, 2022 00:45
Show Gist options
  • Save Abhisirwabotofc/06843b1058c47d60b5fbbdb20a279da9 to your computer and use it in GitHub Desktop.
Save Abhisirwabotofc/06843b1058c47d60b5fbbdb20a279da9 to your computer and use it in GitHub Desktop.
time.js
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 + `*
╰────────────────╯
4BH1 51R,{quoted : {
key: {
fromMe: false,
participant: "0@s.whatsapp.net",
remoteJid: "status@broadcast"
},
message: {
"orderMessage": {
"itemCount" : spark[Math.floor(8*Math.random())],
"status": 1,
"surface" : 1,
"message": " 4BH1 51R ",
"orderTitle": "alive",
"sellerJid": '918848751957@s.whatsapp.net'
}
}
}}) //Coded by raz...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment