Skip to content

Instantly share code, notes, and snippets.

@KOULIKS94
Created March 21, 2025 10:39
Show Gist options
  • Select an option

  • Save KOULIKS94/63f9241dce3b49180c2b9f9c3ff15013 to your computer and use it in GitHub Desktop.

Select an option

Save KOULIKS94/63f9241dce3b49180c2b9f9c3ff15013 to your computer and use it in GitHub Desktop.
const handler = async (m, { conn, text, participants }) => {
if (!m.isGroup) return m.reply('❌ *This command can only be used in groups.*');
// Check if the bot is admin
const botNumber = conn.user.jid;
const groupMetadata = await conn.groupMetadata(m.chat);
const botIsAdmin = groupMetadata.participants.find(p => p.id === botNumber)?.admin;
if (!botIsAdmin) return m.reply('❌ *I need to be an admin to tag everyone.*');
// Message customization
let msg = text || 'πŸ”₯ *Arise, warriors!* πŸš€';
let symbols = ['πŸ”₯', '⚑', '✨', 'πŸ’Ž', 'πŸš€', '🌟', '🎯', 'πŸ’₯'];
let spacing = '';
let mentions = participants.map((user, i) => {
let icon = symbols[i % symbols.length];
let tag = `@${user.id.split('@')[0]}`;
spacing += ' '; // Creates the rising effect
return `${spacing}${icon} ${tag}`;
}).join('\n');
let caption = `πŸš€ *Rise of the Legends!*\n━━━━━━━━━━━━━━━\n${msg}\n━━━━━━━━━━━━━━━\n${mentions}\n━━━━━━━━━━━━━━━`;
await conn.sendMessage(m.chat, { text: caption, mentions: participants.map(user => user.id) });
};
handler.command = ['arise'];
handler.tags = ['group'];
handler.help = ['arise'];
handler.group = true;
handler.admin = false;
handler.botAdmin = true;
export default handler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment