Include guild channels in payload.

This commit is contained in:
Paul Makles
2020-08-12 16:07:10 +02:00
parent 7e7eb34f65
commit 088490dfc3

View File

@@ -130,13 +130,21 @@ impl User {
)
})
.collect();
let guild_objects = fetch_guilds(&self.find_guilds()?)?;
let mut cids: Vec<String> = guild_objects
.iter()
.flat_map(|x| x.channels.clone())
.collect();
let channels: Vec<JsonValue> = fetch_channels(&self.find_dms()?)?
cids.append(&mut self.find_dms()?);
let channels: Vec<JsonValue> = fetch_channels(&cids)?
.into_iter()
.map(|x| x.serialise())
.collect();
let guilds: Vec<JsonValue> = fetch_guilds(&self.find_guilds()?)?
let guilds: Vec<JsonValue> = guild_objects
.into_iter()
.map(|x| x.serialise())
.collect();