@@ -65,36 +65,35 @@ async fn _check_block(ctx: poise::Context<'_, Data, Error>) -> Result<bool, Erro
6565 let ctx_id = ctx. id ( ) ;
6666 trace ! ( %ctx_id, "checking if user is blocked" ) ;
6767
68- if let Some ( guild) = ctx. guild_id ( ) {
69- if let Some ( reason) = redis
68+ if let Some ( guild) = ctx. guild_id ( )
69+ && let Some ( reason) = redis
7070 . get :: < _ , Option < String > > ( format ! ( "guild:{{{}}}:blocked" , guild) )
7171 . await ?
72- {
73- trace ! ( %ctx_id, "guild is blocked" ) ;
74- let resolved_language = scripty_i18n:: get_resolved_language (
75- ctx. author ( ) . id . get ( ) ,
76- ctx. guild_id ( ) . map ( |g| g. get ( ) ) ,
77- )
78- . await ;
79-
80- let reason = if reason. is_empty ( ) {
81- format_message ! ( resolved_language, "blocked-entity-no-reason-given" )
82- } else {
83- format_message ! (
84- resolved_language,
85- "blocked-entity-reason-given" ,
86- reason: reason
87- )
88- } ;
89- ctx. say ( format_message ! (
72+ {
73+ trace ! ( %ctx_id, "guild is blocked" ) ;
74+ let resolved_language = scripty_i18n:: get_resolved_language (
75+ ctx. author ( ) . id . get ( ) ,
76+ ctx. guild_id ( ) . map ( |g| g. get ( ) ) ,
77+ )
78+ . await ;
79+
80+ let reason = if reason. is_empty ( ) {
81+ format_message ! ( resolved_language, "blocked-entity-no-reason-given" )
82+ } else {
83+ format_message ! (
9084 resolved_language,
91- "blocked-entity-guild" ,
92- reason: reason,
93- supportServerInvite: cfg. support_invite. to_string( )
94- ) )
95- . await ?;
96- return Ok ( false ) ;
97- }
85+ "blocked-entity-reason-given" ,
86+ reason: reason
87+ )
88+ } ;
89+ ctx. say ( format_message ! (
90+ resolved_language,
91+ "blocked-entity-guild" ,
92+ reason: reason,
93+ supportServerInvite: cfg. support_invite. to_string( )
94+ ) )
95+ . await ?;
96+ return Ok ( false ) ;
9897 }
9998
10099 let hashed_user_id = scripty_utils:: hash_user_id ( ctx. author ( ) . id . get ( ) ) ;
0 commit comments