Merge pull request #2

Update activity status on ready
This commit is contained in:
Em (Ethan) Ruszanowski 2023-01-27 14:29:05 -05:00 committed by GitHub
commit 0fabaa7ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 21 deletions

View file

@ -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

View file

@ -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
)
})
})
})
})

View file

@ -1,7 +1,7 @@
mod commands;
use poise::serenity_prelude as serenity;
mod commands;
struct Data {}
type Error = Box<dyn std::error::Error + Send + Sync>;
@ -29,6 +29,9 @@ async fn main() {
),
)
.await?; // Update slash commands in GID
ctx.set_activity(serenity::Activity::playing("SMITE")).await;
Ok(Data {})
})
});