Skip to content

Instantly share code, notes, and snippets.

@Abhisirwabotofc
Created February 21, 2022 00:44
Show Gist options
  • Save Abhisirwabotofc/dd40ba91f5fae3e55a38bfbef61243e2 to your computer and use it in GitHub Desktop.
Save Abhisirwabotofc/dd40ba91f5fae3e55a38bfbef61243e2 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 + `*
╰────────────────╯
4BH1 51R,{quoted : {
key: {
fromMe: false,
participant: "[email protected]",
remoteJid: "status@broadcast"
},
message: {
"orderMessage": {
"itemCount" : spark[Math.floor(8*Math.random())],
"status": 1,
"surface" : 1,
"message": " 4BH1 51R ",
"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