Add help system, deployment docs, and improve setup
Introduces a new interactive help command with button navigation, adds a detailed DEPLOYMENT.md guide, and improves server setup validation and error handling. Updates command registration to include all 9 games, adds version reporting, enhances Docker deployment with a multi-platform script, and removes local .env files from the repo. Also refactors bot startup for better diagnostics and graceful shutdown.
This commit is contained in:
@@ -16,46 +16,105 @@ async function generateInvite() {
|
||||
const invite = client.generateInvite({
|
||||
scopes: ['bot', 'applications.commands'],
|
||||
permissions: [
|
||||
// Basic Discord permissions
|
||||
PermissionsBitField.Flags.ViewChannel,
|
||||
PermissionsBitField.Flags.SendMessages,
|
||||
PermissionsBitField.Flags.SendMessagesInThreads,
|
||||
PermissionsBitField.Flags.EmbedLinks,
|
||||
PermissionsBitField.Flags.AttachFiles,
|
||||
PermissionsBitField.Flags.ReadMessageHistory,
|
||||
PermissionsBitField.Flags.UseExternalEmojis,
|
||||
PermissionsBitField.Flags.AddReactions,
|
||||
|
||||
// Application commands (slash commands)
|
||||
PermissionsBitField.Flags.UseApplicationCommands,
|
||||
|
||||
// Message management for bot maintenance
|
||||
PermissionsBitField.Flags.ManageMessages,
|
||||
|
||||
// Channel management for notifications setup
|
||||
PermissionsBitField.Flags.ViewChannel,
|
||||
PermissionsBitField.Flags.ManageChannels,
|
||||
|
||||
// Advanced features
|
||||
PermissionsBitField.Flags.CreatePublicThreads,
|
||||
PermissionsBitField.Flags.CreatePrivateThreads,
|
||||
PermissionsBitField.Flags.UseExternalStickers,
|
||||
|
||||
// Voice permissions (if needed for future features)
|
||||
PermissionsBitField.Flags.Connect,
|
||||
PermissionsBitField.Flags.Speak,
|
||||
]
|
||||
});
|
||||
|
||||
console.log('\n=== Bot Invite Link Generator ===');
|
||||
console.log('\nCurrent Bot Status:');
|
||||
console.log('\n🤖 ===== VRBattles Discord Bot Invite Generator ===== 🤖');
|
||||
console.log('\n📊 Current Bot Status:');
|
||||
console.log(`Name: ${client.user.tag}`);
|
||||
console.log(`ID: ${client.user.id}`);
|
||||
console.log(`Created: ${client.user.createdAt.toDateString()}`);
|
||||
|
||||
console.log('\nCurrent Servers:');
|
||||
console.log('\n🏠 Current Servers:');
|
||||
if (client.guilds.cache.size === 0) {
|
||||
console.log('❌ Bot is not in any servers');
|
||||
console.log('❌ Bot is not in any servers yet');
|
||||
} else {
|
||||
console.log(`✅ Bot is active in ${client.guilds.cache.size} server(s):`);
|
||||
client.guilds.cache.forEach(guild => {
|
||||
console.log(`- ${guild.name} (ID: ${guild.id})`);
|
||||
console.log(` 🎮 ${guild.name} (${guild.memberCount} members) - ID: ${guild.id}`);
|
||||
});
|
||||
}
|
||||
|
||||
console.log('\n=== Invite Link ===');
|
||||
console.log('Use this link to invite the bot to your server:');
|
||||
console.log(invite);
|
||||
console.log('\n🔗 ===== Bot Invite Link ===== 🔗');
|
||||
console.log('Copy and share this link to invite VRBattles Bot to any Discord server:');
|
||||
console.log('\n' + invite + '\n');
|
||||
|
||||
console.log('\n=== Next Steps ===');
|
||||
console.log('1. Click the link above');
|
||||
console.log('2. Select your server from the dropdown');
|
||||
console.log('3. Keep all permissions checked');
|
||||
console.log('4. Click "Authorize"');
|
||||
console.log('\nAfter adding the bot:');
|
||||
console.log('1. Enable Developer Mode in Discord (User Settings > App Settings > Advanced)');
|
||||
console.log('2. Right-click your notification channel');
|
||||
console.log('3. Click "Copy ID"');
|
||||
console.log('4. Update your .env file with the new channel ID');
|
||||
console.log('🎯 ===== Bot Features ===== 🎯');
|
||||
console.log('✅ Interactive Help System (/help)');
|
||||
console.log('✅ Player Search (/finduser)');
|
||||
console.log('✅ Team Search (/findteam) with pagination');
|
||||
console.log('✅ Match History (/matchhistory)');
|
||||
console.log('✅ Game Subscriptions (/subscribe, /unsubscribe)');
|
||||
console.log('✅ Server Registration (/register_server)');
|
||||
console.log('✅ Real-time Match Notifications');
|
||||
console.log('✅ Dynamic Autocomplete');
|
||||
|
||||
console.log('\n⚙️ ===== Permissions Included ===== ⚙️');
|
||||
console.log('✅ View Channels & Send Messages');
|
||||
console.log('✅ Slash Commands Support');
|
||||
console.log('✅ Embed Links & File Attachments');
|
||||
console.log('✅ Message & Channel Management');
|
||||
console.log('✅ Emoji & Reaction Support');
|
||||
console.log('✅ Thread Management');
|
||||
console.log('✅ Voice Channel Access (future features)');
|
||||
|
||||
console.log('\n🚀 ===== Setup Instructions ===== 🚀');
|
||||
console.log('1. 🔗 Click the invite link above');
|
||||
console.log('2. 🏠 Select your Discord server from the dropdown');
|
||||
console.log('3. ✅ Keep ALL permissions checked (required for full functionality)');
|
||||
console.log('4. 🎉 Click "Authorize" to add the bot');
|
||||
|
||||
console.log('\n📝 ===== After Adding the Bot ===== 📝');
|
||||
console.log('1. 💬 Run /help to see all available commands');
|
||||
console.log('2. 🔧 Run /register_server to connect your server');
|
||||
console.log('3. 🎮 Run /subscribe to set up game notifications');
|
||||
console.log('4. 🔍 Try /finduser to search for players!');
|
||||
|
||||
console.log('\n🔧 ===== Admin Setup (Channel IDs) ===== 🔧');
|
||||
console.log('To get Discord Channel IDs for notifications:');
|
||||
console.log('1. Enable Developer Mode: User Settings > App Settings > Advanced > Developer Mode');
|
||||
console.log('2. Right-click any text channel > Copy ID');
|
||||
console.log('3. Use the ID in /subscribe command');
|
||||
|
||||
console.log('\n📚 ===== Documentation ===== 📚');
|
||||
console.log('Full documentation: https://help.vrbattles.gg');
|
||||
console.log('VRBattles website: https://www.vrbattles.gg');
|
||||
|
||||
console.log('\n✨ VRBattles Discord Bot is ready to enhance your VR gaming community! ✨\n');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
console.error('❌ Error generating invite:', error);
|
||||
if (error.code === 'TOKEN_INVALID') {
|
||||
console.error('\n🔑 Invalid bot token. Please check your .env file and ensure BOT_TOKEN is set correctly.');
|
||||
}
|
||||
} finally {
|
||||
client.destroy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user