File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 11use http:: StatusCode ;
2- use lambda_http:: tracing:: { error, info } ;
2+ use lambda_http:: tracing:: error;
33use twilight_http:: Error ;
44use twilight_model:: guild:: Permissions ;
55use twilight_model:: id:: Id ;
@@ -32,18 +32,11 @@ pub async fn intersect_admin_guilds(
3232}
3333
3434async fn is_client_admin_guild ( guild_id : Id < GuildMarker > , client : & twilight_http:: Client ) -> Result < bool , Error > {
35- info ! ( "Checking if client is admin in guild: {}, {}" , guild_id, client. token( ) . unwrap( ) ) ;
3635 let guilds = client. current_user_guilds ( ) . after ( Id :: new ( guild_id. get ( ) -1 ) ) . limit ( 1 ) . await ?. models ( ) . await . unwrap ( ) ;
37- info ! ( "Fetched guilds: {:?}" , guilds) ;
3836 let admin_guilds: Vec < CurrentUserGuild > = guilds
3937 . into_iter ( )
4038 . filter ( |g| g. permissions & Permissions :: ADMINISTRATOR == Permissions :: ADMINISTRATOR )
4139 . collect ( ) ;
42- info ! ( "Admin guilds: {:?}" , admin_guilds) ;
43- if admin_guilds. is_empty ( ) {
44- info ! ( "No admin guilds found for client in guild: {}" , guild_id) ;
45- return Ok ( false ) ;
46- }
4740 Ok ( admin_guilds. len ( ) == 1 )
4841}
4942
You can’t perform that action at this time.
0 commit comments