From c9a2a6ca8d6b37dbb4630736fb22fc5cb33f6b92 Mon Sep 17 00:00:00 2001 From: Ethan Ruszanowski Date: Fri, 27 Jan 2023 12:09:46 -0500 Subject: [PATCH 1/3] Update formatting --- src/commands/team.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/commands/team.rs b/src/commands/team.rs index 2ccde8a..5eaea26 100644 --- a/src/commands/team.rs +++ b/src/commands/team.rs @@ -64,16 +64,16 @@ pub(crate) async fn team( .color(serenity::Colour::DARK_GREEN) }) .components(|c| { - c // Create an action row with button - .create_action_row(|a| { - a.create_button( - |b| { - b.style(serenity::ButtonStyle::Primary) - .label("Swap Channels") - .custom_id(uuid_team) - }, // Use the context ID as button ID - ) - }) + c.create_action_row(|a| { + // Create an action row with button + a.create_button( + |b| { + b.style(serenity::ButtonStyle::Primary) + .label("Swap Channels") + .custom_id(uuid_team) + }, // Use the context ID as button ID + ) + }) }) }) .await?; // Send embed with team picks @@ -101,18 +101,18 @@ pub(crate) async fn team( .color(serenity::Colour::DARK_GREEN) }) .components(|c| { - c // Create an action row with button - .create_action_row(|a| { - a.create_button( - |b| { - b + c.create_action_row(|a| { + // Create an action row with button + a.create_button( + |b| { + b .disabled(true) // with disabled button .style(serenity::ButtonStyle::Primary) .label("Quit Sibelius") // and new text .custom_id(uuid_team) - }, // Use the context ID as button ID - ) - }) + }, // Use the context ID as button ID + ) + }) }) }) }) From a7599f55e104d7fcdeb8e384da264f47c91ff86c Mon Sep 17 00:00:00 2001 From: Ethan Ruszanowski Date: Fri, 27 Jan 2023 14:26:58 -0500 Subject: [PATCH 2/3] Set activity status and fix command reg --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e3f24a7..df2bb9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ -mod commands; - use poise::serenity_prelude as serenity; +mod commands; + struct Data {} type Error = Box; @@ -29,6 +29,9 @@ async fn main() { ), ) .await?; // Update slash commands in GID + + ctx.set_activity(serenity::Activity::playing("SMITE")).await; + Ok(Data {}) }) }); From 4ca472471a786a0b1d0a86f6d90e84db8410779a Mon Sep 17 00:00:00 2001 From: Ethan Ruszanowski Date: Fri, 27 Jan 2023 14:27:17 -0500 Subject: [PATCH 3/3] Add prefix to ping command --- src/commands/slur.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/slur.rs b/src/commands/slur.rs index 385d480..0174687 100644 --- a/src/commands/slur.rs +++ b/src/commands/slur.rs @@ -7,7 +7,7 @@ use std::{ }; /// Basically a ping command -#[poise::command(slash_command)] +#[poise::command(slash_command, prefix_command)] pub(crate) async fn slur(ctx: Context<'_>) -> Result<(), Error> { let file = File::open("quotes.txt").unwrap_or_else(|_e| panic!("Quote file missing.")); // Open the quotes file let file = BufReader::new(file); // Read the quotes file