Skip to content

Instantly share code, notes, and snippets.

@spark-shadow
Last active June 5, 2022 14:25
Show Gist options
  • Save spark-shadow/aa3991992fae718edb75b380336aff24 to your computer and use it in GitHub Desktop.
Save spark-shadow/aa3991992fae718edb75b380336aff24 to your computer and use it in GitHub Desktop.
const Shadow = require('../Utilis/events')
const {MessageType, MessageOptions, Mimetype, Presence} = require('@adiwajshing/baileys');
const { parseJid } = require("../Utilis/vote");
//scam by shadow
//what is the use of scam = it will make a fake action on whatsapp Like typing,reccoridng,online,offline.....
let tostop = ''
Shadow.addCommand({ pattern: 'scam ?(.*)', fromMe: true, desc: "Creates 5 minutes of fake actions", }, async (message, match) => {
let [jid] = match.match(parseJid) || []
jid = !jid ? message.jid : jid
match = match.split(' ')[0]
if (match === '') {
return await message.sendMessage('*You Must Enter Fake Action!*\nExisting Types: ```typing & recording & online & stop```');
} else if (match == 'recording') {
await message.client.updatePresence(jid, Presence.recording)
tostop = setInterval(async () => {
try {
await message.client.updatePresence(jid, Presence.recording)
} catch (error) {
console.log(error.message)
}
}, 20 * 1000);
} else if (match == 'typing') {
await message.client.updatePresence(jid, Presence.composing)
tostop = setInterval(async () => {
try {
await message.client.updatePresence(jid, Presence.composing)
} catch (error) {
console.log(error.message)
}
}, 20 * 1000);
} else if (match == "stop") clearInterval(tostop);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment