supabase setup
This commit is contained in:
20
src/Bot.js
20
src/Bot.js
@@ -38,9 +38,19 @@ class Bot {
|
||||
this.client.on('interactionCreate', this.handleInteraction.bind(this));
|
||||
}
|
||||
|
||||
async start(token) {
|
||||
console.log("Starting bot...");
|
||||
try {
|
||||
// In the start method, add Supabase connection test:
|
||||
async start(token) {
|
||||
console.log("Starting bot...");
|
||||
try {
|
||||
// Test Supabase connection first
|
||||
if (this.supabaseService) {
|
||||
const connected = await this.supabaseService.testConnection();
|
||||
if (!connected) {
|
||||
console.warn('Supabase connection failed. Subscription features will be disabled.');
|
||||
this.subscriptionCommands = null;
|
||||
}
|
||||
}
|
||||
|
||||
await this.client.login(token);
|
||||
console.log("Login successful");
|
||||
|
||||
@@ -48,11 +58,11 @@ class Bot {
|
||||
const port = process.env.NOTIFICATION_PORT || 3000;
|
||||
await this.notificationService.start(port);
|
||||
console.log(`Notification service started on port ${port}`);
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
console.error("Startup failed:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async stop() {
|
||||
console.log("Stopping bot...");
|
||||
|
||||
Reference in New Issue
Block a user