Skip to content

Instantly share code, notes, and snippets.

@techgod143
Last active July 3, 2024 17:30
Show Gist options
  • Save techgod143/3330d0fe60022e3d16a5b7076a16ffcb to your computer and use it in GitHub Desktop.
Save techgod143/3330d0fe60022e3d16a5b7076a16ffcb to your computer and use it in GitHub Desktop.
A react LyFE
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