Implemented API Key creation/usage and changed layout of audio requests
This commit is contained in:
@@ -89,7 +89,9 @@ pub async fn enqueue_track(
|
||||
let mut playlist_items: Vec<YtDlpItem> = Vec::new();
|
||||
if let Some(handler_lock) = manager.get(guild_id) {
|
||||
let mut handler = handler_lock.lock().await;
|
||||
let guild = GuildCache::get_by_id(guild_id.get() as i64).await?.unwrap();
|
||||
let guild = GuildCache::find_by_id(guild_id.get() as i64)
|
||||
.await?
|
||||
.unwrap();
|
||||
let valid = is_valid_url(&track_url);
|
||||
|
||||
// Check if the URL is valid
|
||||
|
||||
@@ -64,7 +64,7 @@ pub async fn set_volume(manager: &Arc<Songbird>, guild_id: &GuildId, volume: i32
|
||||
let bound_volume = volume as f32 / 100.0;
|
||||
|
||||
// Update the guild cache
|
||||
let mut guild_cache = GuildCache::get_by_id(guild_id.get() as i64)
|
||||
let mut guild_cache = GuildCache::find_by_id(guild_id.get() as i64)
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
@@ -108,7 +108,7 @@ impl EventHandler for BotHandler {
|
||||
for guild in ready.guilds {
|
||||
// Check if guild exists in database
|
||||
let guild_id = guild.id.get() as i64;
|
||||
if let None = GuildCache::get_by_id(guild_id).await.unwrap() {
|
||||
if let None = GuildCache::find_by_id(guild_id).await.unwrap() {
|
||||
let guild_cache = GuildCache {
|
||||
id: guild_id,
|
||||
name: guild.id.name(&ctx.cache),
|
||||
|
||||
Reference in New Issue
Block a user