Add embed to teams.rs

This commit is contained in:
Em (Ethan) Ruszanowski 2023-01-11 18:40:50 -05:00
parent 1cc467ba28
commit 4089abc815
No known key found for this signature in database
GPG key ID: C3E7A3C0B1491DFE
2 changed files with 12 additions and 3 deletions

View file

@ -24,4 +24,4 @@ pub(crate) async fn mode(
) -> Result<(), Error> { ) -> Result<(), Error> {
ctx.say("Waiting for that sweet API access.").await?; ctx.say("Waiting for that sweet API access.").await?;
Ok(()) Ok(())
} }

View file

@ -12,8 +12,17 @@ pub(crate) async fn team(
) -> Result<(), Error> { ) -> Result<(), Error> {
let mut v = ctx.guild().unwrap().voice_states; // Get hashmap of users' voice states within the guild let mut v = ctx.guild().unwrap().voice_states; // Get hashmap of users' voice states within the guild
v.retain(|_, s| s.channel_id == Some(channel.id())); // Drop users not active in requested voice channel from hashmap v.retain(|_, s| s.channel_id == Some(channel.id())); // Drop users not active in requested voice channel from hashmap
let res = format!("Channel {} has {} active users. Team size is {}.", channel.id(), v.keys().len(), size); let res = format!("Channel {} has {} active users.", channel.id(), v.keys().len());
ctx.say(res).await?; ctx.send(|f| f
.content(res)
.embed(|f| f
.title(format!("Custom {}v{} Teams", size, size))
.description("I'm not done with this yet.")
.field("Order", "Some names", true)
.field("Chaos", "Other names", true)
.field("Spectators", "You guessed it, names.", false)
.color(serenity::Colour(16711680)) // Red
)).await?;
Ok(()) Ok(())
} }