15
README.md
15
README.md
@@ -11,6 +11,7 @@ A powerful Discord bot that can send messages and search for multimedia files on
|
||||
- ⬇️ **File Download** - Download and share multimedia files directly in Discord
|
||||
- 🟠 **Bitcoin Monitor** - Real-time Bitcoin transaction monitoring
|
||||
- 🚪 **Channel Access** - Join and send messages to specific Discord channels by ID
|
||||
- 🎫 **Bot Invitation** - Generate invitation links to add the bot to other servers
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -109,6 +110,20 @@ Makes the bot access and send a message to a specific Discord channel.
|
||||
- Error handling for invalid channels or permissions
|
||||
- Supports any text-based Discord channel
|
||||
|
||||
### 🎫 Bot Invitation
|
||||
```
|
||||
/invite permissions:basic
|
||||
```
|
||||
Generates an invitation link to add this bot to Discord servers.
|
||||
- `permissions`: Permission level (basic, moderate, admin) (optional, default: basic)
|
||||
|
||||
**Invitation Features:**
|
||||
- Automatic invitation link generation
|
||||
- Multiple permission levels
|
||||
- Direct Discord authorization link
|
||||
- Bot information display
|
||||
- Easy server integration
|
||||
|
||||
## Security Features
|
||||
|
||||
- ✅ Environment variables for token security
|
||||
|
||||
51
index.js
51
index.js
@@ -182,6 +182,23 @@ client.on(Events.ClientReady, async readyClient => {
|
||||
required: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'invite',
|
||||
description: 'Generate an invitation link for this bot',
|
||||
options: [
|
||||
{
|
||||
name: 'permissions',
|
||||
type: 3, // STRING type
|
||||
description: 'Permission level for the bot',
|
||||
required: false,
|
||||
choices: [
|
||||
{ name: 'Basic (Send Messages, Use Slash Commands)', value: 'basic' },
|
||||
{ name: 'Moderate (+ Manage Messages, Kick Members)', value: 'moderate' },
|
||||
{ name: 'Admin (Administrator)', value: 'admin' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1123,6 +1140,40 @@ client.on(Events.InteractionCreate, async interaction => {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'invite':
|
||||
const permissionLevel = interaction.options.getString('permissions') || 'basic';
|
||||
|
||||
// Define permission values
|
||||
const permissions = {
|
||||
basic: '274877907008', // Send Messages, Use Slash Commands, Embed Links, Attach Files, Read Message History, View Channels
|
||||
moderate: '274877907016', // Basic + Manage Messages, Kick Members
|
||||
admin: '8' // Administrator
|
||||
};
|
||||
|
||||
const selectedPermissions = permissions[permissionLevel];
|
||||
const clientId = client.user.id;
|
||||
const inviteUrl = `https://discord.com/api/oauth2/authorize?client_id=${clientId}&permissions=${selectedPermissions}&scope=bot%20applications.commands`;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('🤖 Invitar Bot al Servidor')
|
||||
.setDescription(`¡Usa este enlace para invitar el bot a cualquier servidor de Discord!`)
|
||||
.addFields(
|
||||
{ name: '🔗 Enlace de Invitación', value: `[Haz clic aquí para invitar el bot](${inviteUrl})`, inline: false },
|
||||
{ name: '🔐 Nivel de Permisos', value: permissionLevel.charAt(0).toUpperCase() + permissionLevel.slice(1), inline: true },
|
||||
{ name: '🤖 Bot ID', value: clientId, inline: true },
|
||||
{ name: '📋 Instrucciones', value: '1. Haz clic en el enlace\n2. Selecciona el servidor\n3. Autoriza los permisos\n4. ¡Listo!', inline: false }
|
||||
)
|
||||
.setColor(0x5865F2)
|
||||
.setTimestamp()
|
||||
.setFooter({ text: 'Discord Bot Invitation' });
|
||||
|
||||
if (client.user.displayAvatarURL()) {
|
||||
embed.setThumbnail(client.user.displayAvatarURL());
|
||||
}
|
||||
|
||||
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
break;
|
||||
|
||||
case 'btc-monitor':
|
||||
const action = interaction.options.getString('action');
|
||||
const channel = interaction.options.getChannel('channel');
|
||||
|
||||
Referencia en una nueva incidencia
Block a user