Suppress errors. Restyle
This commit is contained in:
		
							
								
								
									
										14
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/main.rs
									
									
									
									
									
								
							@@ -176,6 +176,20 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
 | 
			
		||||
        allowed_mentions: None,
 | 
			
		||||
        command_check: Some(|ctx| Box::pin(all_checks(ctx))),
 | 
			
		||||
        event_handler: |ctx, event, _framework, data| Box::pin(listener(ctx, event, data)),
 | 
			
		||||
        on_error: |error| {
 | 
			
		||||
            Box::pin(async move {
 | 
			
		||||
                match error {
 | 
			
		||||
                    poise::FrameworkError::CommandCheckFailed { .. } => {
 | 
			
		||||
                        // suppress error
 | 
			
		||||
                    }
 | 
			
		||||
                    error => {
 | 
			
		||||
                        if let Err(e) = poise::builtins::on_error(error).await {
 | 
			
		||||
                            log::error!("Error while handling error: {}", e);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        ..Default::default()
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user