Skip to content

Instantly share code, notes, and snippets.

@Cee-Jay-Err0r
Last active August 11, 2024 18:39
Show Gist options
  • Select an option

  • Save Cee-Jay-Err0r/e9d7b92fd6b2ba9fdac8d8df3f6b02f5 to your computer and use it in GitHub Desktop.

Select an option

Save Cee-Jay-Err0r/e9d7b92fd6b2ba9fdac8d8df3f6b02f5 to your computer and use it in GitHub Desktop.
const { bot, parsedJid, getRandom } = require('../lib/')
/*
bot(
{ pattern: 'areact ?(.*)',
fromMe: false,
desc: 'auto react to messages',
type: 'misc',
},
async (message, match) => {
*/
// add jid so bot not react to message of these chat
const not_react_jids = ``
// add jid so bot react to only to message of these chat
const react_jids = ``
const not_gids = parsedJid(not_react_jids)
const gids = parsedJid(react_jids)
// set true so only react in personal chat
const onlyPm = true
// set true so only react in group chat
const onlyGroup = false
const emojis =
'😚,😘,πŸ₯°,😍,😊,πŸ₯Ί,🀭,πŸ€—,😢,🌝,πŸ”₯,☠️,✨,🌟,⭐,πŸ’«,πŸ’―,😻,❀️,🧑,πŸ’›,πŸ’š,πŸ’—,πŸ’–,πŸ’,❀️,πŸ’˜,🀍,πŸ–€,🀎,πŸ’œ,πŸ’™,πŸ’“,πŸ’ž,πŸ’•,πŸ’Œ,πŸ’Ÿ,β™₯️,❣️,πŸ’”,πŸ’‹,πŸ’€,πŸ‘€,πŸ’ƒ,πŸ’,🌹,πŸ₯€,🌺,🌷.split(
','
)
bot({ on: 'text', fromMe: false, type: 'ar' }, async (message, match) => {
if (not_gids.length) {
if (not_gids.includes(message.jid)) return
}
if (gids.length) {
if (!gids.includes(message.jid)) return
}
const isReact =
!message.fromMe &&
(onlyPm ? !message.isGroup : !onlyPm) &&
(onlyGroup ? message.isGroup : !onlyGroup)
if (!isReact) return
const react = {
text: getRandom(emojis),
key: message.message.key,
}
return await message.send(react, {}, 'react')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment