UNPKG

nub-7up

Version:

A Discord Self Bot package for automation and custom commands, mimicking traditional Self Bot tools

58 lines (50 loc) 2.15 kB
const { Client, EmbedBuilder } = require('discord.js-selfbot-v13'); class Nub7upBot { constructor(token, options = {}) { this.client = new Client({ checkUpdate: false }); this.token = token; this.prefix = options.prefix || '!'; } start() { this.client.on('ready', () => { console.log(`Nub7upBot logged in as ${this.client.user.tag}!`); }); this.client.on('messageCreate', (message) => { if (message.author.id === this.client.user.id) return; if (message.content.toLowerCase().includes('مرحبا')) { message.channel.send('أهلا!'); } if (message.content.startsWith(this.prefix)) { const args = message.content.slice(this.prefix.length).trim().split(/ +/); const command = args.shift().toLowerCase(); if (command === 'ping') { message.channel.send('Pong! 🏓'); } else if (command === 'status') { const statusText = args.join(' ') || 'Nub7upBot'; this.client.user.setPresence({ status: 'online', activities: [{ name: statusText, type: 'PLAYING' }], }); message.channel.send(`Status set to: ${statusText}`); } else if (command === 'embed') { const embed = new EmbedBuilder() .setTitle('Nub7upBot Embed') .setDescription(args.join(' ') || 'This is a cool embed!') .setColor('#00ff00') .setTimestamp(); message.channel.send({ embeds: [embed] }); } else if (command === 'delete') { message.channel.messages.fetch({ limit: 100 }).then(messages => { const userMessages = messages.filter(msg => msg.author.id === this.client.user.id); userMessages.forEach(msg => msg.delete().catch(() => {})); message.channel.send('Deleted my recent messages!').then(msg => setTimeout(() => msg.delete(), 3000)); }); } } }); this.client.login(this.token).catch((error) => { console.error('Failed to login:', error.message); }); } } module.exports = Nub7upBot;