Spaces:
Paused
Paused
Download src/plugin/exit.js from arabdullah/ethix-md-user-4: direct link, hf CLI and curl.
- Browser
- Download file 853 Bytes
-
https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/src/plugin/exit.js
- Command line
-
hf download hf://spaces/arabdullah/ethix-md-user-4/src/plugin/exit.js
-
curl -L -o exit.js https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/src/plugin/exit.js
853 Bytes
| import config from '../../config.cjs'; | |
| const leaveGroup = async (m, gss) => { | |
| try { | |
| const botNumber = await gss.decodeJid(gss.user.id); | |
| const isCreator = [botNumber, config.OWNER_NUMBER + '@s.whatsapp.net'].includes(m.sender); | |
| const prefix = config.PREFIX; | |
| const cmd = m.body.startsWith(prefix) ? m.body.slice(prefix.length).split(' ')[0].toLowerCase() : ''; | |
| const text = m.body.slice(prefix.length + cmd.length).trim(); | |
| const validCommands = ['leave', 'exit', 'left']; | |
| if (!validCommands.includes(cmd)) return; | |
| if (!m.isGroup) return m.reply("*๐ THIS COMMAND CAN ONLY BE USED IN GROUPS*"); | |
| if (!isCreator) return m.reply("*๐ THIS IS AN OWNER COMMAND*"); | |
| await gss.groupLeave(m.from); | |
| } catch (error) { | |
| console.error('Error:', error); | |
| } | |
| }; | |
| export default leaveGroup; | |