List all territories of guild
This commit is contained in:
parent
7a6f05ac70
commit
f16da96323
@ -44,19 +44,18 @@ pub fn wc_guild(msg: &Message) -> Result<(), Error> {
|
||||
};
|
||||
|
||||
let mut message = String::new();
|
||||
let mut territories_count = 0;
|
||||
//let mut territories_count = 0;
|
||||
for value in territories.get("territories").unwrap().as_object().unwrap().values() {
|
||||
if value.get("guild").unwrap().as_str().unwrap() == guild.name {
|
||||
message.push_str(&format!("
|
||||
**Territory**: {}",
|
||||
value.get("territory").unwrap().as_str().unwrap()
|
||||
));
|
||||
territories_count += 1;
|
||||
//territories_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(_) = msg.channel_id.say(
|
||||
format!(
|
||||
let full_msg = format!(
|
||||
"**Guild**: {}
|
||||
**prefix**: {}
|
||||
**Created**: {}
|
||||
@ -67,8 +66,11 @@ pub fn wc_guild(msg: &Message) -> Result<(), Error> {
|
||||
guild.created_friendly,
|
||||
guild.level,
|
||||
guild.members.len()
|
||||
) + &message
|
||||
) {
|
||||
) + &message;
|
||||
for part in full_msg.split('\n').collect::<Vec<_>>().chunks(48) {
|
||||
msg.channel_id.say(part.join("\n"))?;
|
||||
}
|
||||
/*
|
||||
msg.channel_id.say(
|
||||
format!(
|
||||
"**Guild**: {}
|
||||
@ -86,6 +88,7 @@ pub fn wc_guild(msg: &Message) -> Result<(), Error> {
|
||||
)
|
||||
)?;
|
||||
};
|
||||
*/
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user