Removed audio gitignore

This commit is contained in:
2024-11-03 11:52:24 -05:00
parent 8ea9c8d711
commit 806f2dcd50
7 changed files with 92 additions and 12 deletions

View File

@@ -1,13 +1,16 @@
use std::env;
use std::collections::HashSet;
use std::sync::Arc;
use axum::Router;
use serenity::http::Http;
use serenity::prelude::*;
use songbird::{SerenityInit, Songbird};
use reqwest::Client as HttpClient;
use tokio::net::TcpListener;
use crate::bot::handler::Handler;
mod api;
mod bot;
mod data;
mod error;
@@ -27,6 +30,23 @@ async fn main() {
return;
};
// Start API server
tokio::spawn(async move {
start_api().await;
});
// Start Discord bot
// start_bot().await;
}
async fn start_api() {
let app = Router::new();
let listener = TcpListener::bind("127.0.0.1:3000").await.unwrap();
log::debug!("listening on {}", listener.local_addr().unwrap());
axum::serve(listener, app).await.unwrap();
}
async fn start_bot() {
let token: String = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
let intents: GatewayIntents = GatewayIntents::all();
@@ -86,7 +106,7 @@ async fn main() {
shard_manager.shutdown_all().await;
});
// Start listening for events by starting a single shard
// Start Discord bot
if let Err(why) = client.start_autosharded().await {
log::error!("Client error: {why:?}");
}