File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ pub struct Data {
1818 pub orders : Arc < dyn OrderRepository > ,
1919}
2020
21- /// Discord adapter - primary/driving adapter for Discord bot access
2221pub struct DiscordAdapter {
2322 token : String ,
2423 queue : Arc < dyn QueueRepository > ,
@@ -88,11 +87,22 @@ pub async fn check_is_oracle(ctx: Context<'_>) -> Result<bool, Error> {
8887 . find ( |r| r. name . to_lowercase ( ) == "orakel" )
8988 . map ( |r| r. id )
9089 {
91- return Ok ( member. roles . contains ( & orakel_role_id) ) ;
90+ if member. roles . contains ( & orakel_role_id) {
91+ return Ok ( true ) ;
92+ }
9293 }
9394 }
9495 }
9596 }
9697
98+ // Send message to discord to prevent timeout.
99+ // Dsicord expects a response within 3 seconds. Just
100+ // returning false does not respond to the interaction.
101+ ctx. send (
102+ poise:: CreateReply :: default ( )
103+ . content ( "❌ Du har ikke tilgang til denne kommandoen." )
104+ . ephemeral ( true ) ,
105+ )
106+ . await ?;
97107 Ok ( false )
98108}
You can’t perform that action at this time.
0 commit comments