@@ -8,7 +8,6 @@ use crate::{
88 config:: PingConfig ,
99 github:: { self , Event } ,
1010 handlers:: Context ,
11- interactions:: ErrorComment ,
1211} ;
1312use parser:: command:: ping:: PingCommand ;
1413
@@ -25,42 +24,27 @@ pub(super) async fn handle_command(
2524 } ;
2625
2726 if !is_team_member {
28- let cmnt = ErrorComment :: new (
29- & event. issue ( ) . unwrap ( ) ,
30- format ! ( "Only Rust team members can ping teams." ) ,
31- ) ;
32- cmnt. post ( & ctx. github ) . await ?;
33- return Ok ( ( ) ) ;
27+ inform ! ( "Only Rust team members can ping teams." ) ;
3428 }
3529
3630 let ( gh_team, config) = match config. get_by_name ( & team_name. team ) {
3731 Some ( v) => v,
3832 None => {
39- let cmnt = ErrorComment :: new (
40- & event. issue ( ) . unwrap ( ) ,
41- format ! (
42- "This team (`{}`) cannot be pinged via this command; \
33+ inform ! ( format!(
34+ "This team (`{}`) cannot be pinged via this command; \
4335 it may need to be added to `triagebot.toml` on the default branch.",
44- team_name. team,
45- ) ,
46- ) ;
47- cmnt. post ( & ctx. github ) . await ?;
48- return Ok ( ( ) ) ;
36+ team_name. team,
37+ ) ) ;
4938 }
5039 } ;
5140 let team = ctx. team . get_team ( & gh_team) . await ?;
5241 let team = match team {
5342 Some ( team) => team,
5443 None => {
55- let cmnt = ErrorComment :: new (
56- & event. issue ( ) . unwrap ( ) ,
57- format ! (
58- "This team (`{}`) does not exist in the team repository." ,
59- team_name. team,
60- ) ,
61- ) ;
62- cmnt. post ( & ctx. github ) . await ?;
63- return Ok ( ( ) ) ;
44+ inform ! ( format!(
45+ "This team (`{}`) does not exist in the team repository." ,
46+ team_name. team,
47+ ) ) ;
6448 }
6549 } ;
6650
@@ -76,11 +60,7 @@ pub(super) async fn handle_command(
7660 )
7761 . await
7862 {
79- let cmnt = ErrorComment :: new (
80- & event. issue ( ) . unwrap ( ) ,
81- format ! ( "Error adding team label (`{}`): {:?}." , label, err) ,
82- ) ;
83- cmnt. post ( & ctx. github ) . await ?;
63+ inform ! ( format!( "Error adding team label (`{}`): {:?}." , label, err) ) ;
8464 }
8565 }
8666
0 commit comments