Skip to content

Commit 65a6951

Browse files
committed
Fix a few bugs
1 parent 142f798 commit 65a6951

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/forum.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn mod_embed(m: Mod, v: ModVersion, base_url: String) -> Value {
143143
},
144144
{
145145
"name": "Hash",
146-
"value": v.hash,
146+
"value": format!("`{}`", v.hash),
147147
"inline": true
148148
},
149149
{
@@ -190,7 +190,9 @@ pub async fn get_threads(
190190
return vec![];
191191
}
192192

193-
let vec1 = res.as_array().unwrap().clone();
193+
let vec1 = res.as_array().unwrap().clone().into_iter()
194+
.filter(|t| t["parent_id"].as_str().unwrap_or("").to_string().parse::<u64>().unwrap_or(0) == channel_id)
195+
.collect::<Vec<Value>>();
194196

195197
let res2 = client
196198
.get(format!("https://discord.com/api/v10/channels/{}/threads/archived/public", channel_id))

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ async fn main() -> anyhow::Result<()> {
180180
for m in results.unwrap().data {
181181
let v_res = ModVersion::get_one(&m.id, &m.versions[0].version, true, false, &mut pool).await;
182182
if v_res.is_err() {
183+
i += 1;
183184
continue;
184185
}
185186

0 commit comments

Comments
 (0)