mirror of
https://github.com/ethanrusz/echbot.git
synced 2024-11-24 21:07:45 -05:00
Add embed to teams.rs
This commit is contained in:
parent
1cc467ba28
commit
4089abc815
2 changed files with 12 additions and 3 deletions
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue