File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ impl EventHandler for BotHandler {
6464
6565 async fn guild_member_update ( & self , ctx : Context , _: Option < Member > , new : Member ) {
6666 if new. roles . contains ( & self . config . punishment_role ) {
67- let mut should_warn: bool = false ;
6867 let mut user: Option < PunishedUser > = None ;
6968 {
7069 let mut state = self . state . lock ( ) . expect ( "Unable to read from state" ) ;
@@ -74,8 +73,6 @@ impl EventHandler for BotHandler {
7473 punished. times_punished += 1 ;
7574 punished. last_punish = SystemTime :: now ( ) ;
7675
77- should_warn = punished. times_punished >= self . config . warn_threshold ;
78-
7976 user = Some ( punished. clone ( ) ) ;
8077
8178 break ;
@@ -90,10 +87,12 @@ impl EventHandler for BotHandler {
9087 times_punished : 1 ,
9188 last_punish : SystemTime :: now ( ) ,
9289 } ) ;
90+
91+ return
9392 }
9493 }
9594
96- if should_warn && user. is_some ( ) {
95+ if user. is_some ( ) {
9796 self . warn_mods ( & ctx, & user. unwrap ( ) ) . await ;
9897 }
9998 }
You can’t perform that action at this time.
0 commit comments