Skip to content

Commit 2734ec6

Browse files
committed
Ignore comments from the bot itself
1 parent 377fc59 commit 2734ec6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

site/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ pub mod github {
616616
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
617617
pub struct User {
618618
pub id: u64,
619+
pub login: String,
619620
}
620621

621622
#[derive(Debug, Clone, Serialize, Deserialize)]

site/src/request_handlers/github.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ async fn handle_rust_timer(
9797
comment: github::Comment,
9898
issue: github::Issue,
9999
) -> ServerResult<github::Response> {
100+
// Avoid reacting to the bot's comments
101+
if comment.user.login == "rust-timer" {
102+
return Ok(github::Response);
103+
}
104+
100105
if comment.author_association != github::Association::Owner
101106
&& !get_authorized_users().await?.contains(&comment.user.id)
102107
{

0 commit comments

Comments
 (0)