Add ding to flake & instALL

This commit is contained in:
2023-03-11 20:38:09 -05:00
parent fb3f38596e
commit a6456ad9de
3 changed files with 17 additions and 3 deletions

BIN
ding.mp3 Normal file

Binary file not shown.

View File

@@ -66,6 +66,10 @@
# artifacts from above. # artifacts from above.
newalan = craneLib.buildPackage (commonArgs // { newalan = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts; inherit cargoArtifacts;
postInstall = ''
mkdir -p $out/share/sounds
cp ding.mp3 $out/share/sounds/
'';
}); });
in rec { in rec {
checks = pkgs.lib.optionalAttrs (system == "x86_64-linux") { checks = pkgs.lib.optionalAttrs (system == "x86_64-linux") {

View File

@@ -3,6 +3,8 @@ use std::sync::Arc;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use rand::prelude::*; use rand::prelude::*;
use serenity::Client; use serenity::Client;
use songbird::error::JoinError;
use songbird::ffmpeg;
use songbird::id::ChannelId; use songbird::id::ChannelId;
use std::thread::sleep; use std::thread::sleep;
use std::collections::HashMap; use std::collections::HashMap;
@@ -45,7 +47,7 @@ async fn popin(ctx: Context, guild: Guild) {
most = Some(id); most = Some(id);
} }
}, },
Err(error) => { Err(_error) => {
} }
}; };
@@ -60,13 +62,21 @@ async fn popin(ctx: Context, guild: Guild) {
Some(chan) => { Some(chan) => {
let manager = songbird::get(&ctx).await let manager = songbird::get(&ctx).await
.expect("Songbird: intialization"); .expect("Songbird: intialization");
let (_,_status) = manager.join(guild.id, chan).await; let (call,status) = manager.join(guild.id, chan).await;
match status {
Ok(_) => {
let call = call.lock().await;
let ding = ffmpeg("");
},
Err(_err) => {
println!("Error joining channel")
}
}
}, },
None => { None => {
println!("No good channel to join") println!("No good channel to join")
} }
} }
()
} }
async fn popin_soon(ctx: Context, guild: Guild) { async fn popin_soon(ctx: Context, guild: Guild) {