wip
This commit is contained in:
@@ -46,7 +46,7 @@ pub async fn run(
|
||||
println!("job {:?}", job);
|
||||
|
||||
let response = match nats_client
|
||||
.request("corro-dj.download", to_stdvec(&job).unwrap().into())
|
||||
.request("corro-dj.play", to_stdvec(&job).unwrap().into())
|
||||
.await
|
||||
{
|
||||
Ok(resp) => resp,
|
||||
|
||||
@@ -51,7 +51,7 @@ impl EventHandler for Handler {
|
||||
async fn ready(&self, ctx: Context, ready: Ready) {
|
||||
println!("{} is connected!", ready.user.name);
|
||||
|
||||
let commands = Command::set_global_commands(
|
||||
if let Err(why) = Command::set_global_commands(
|
||||
&ctx.http,
|
||||
vec![
|
||||
commands::ping::register(),
|
||||
@@ -59,16 +59,17 @@ impl EventHandler for Handler {
|
||||
commands::testnats::register(),
|
||||
],
|
||||
)
|
||||
.await;
|
||||
|
||||
println!("I now have the following slash commands: {commands:#?}");
|
||||
.await
|
||||
{
|
||||
println!("Client error: {why:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// Configure the client with your Discord bot token in the environment.
|
||||
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||
let discord_token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||
|
||||
let nats_client = async_nats::connect("nats://localhost:4222")
|
||||
.await
|
||||
@@ -77,7 +78,7 @@ async fn main() {
|
||||
let handler = Handler { nats_client };
|
||||
|
||||
// Build our client.
|
||||
let mut discord_client = Client::builder(token, GatewayIntents::empty())
|
||||
let mut discord_client = Client::builder(discord_token, GatewayIntents::empty())
|
||||
.event_handler(handler)
|
||||
.await
|
||||
.expect("Error creating discord client");
|
||||
|
||||
Reference in New Issue
Block a user