MCPcopy Create free account
hub / github.com/Botloader/botloader / check_login

Function check_login

cmd/blcmd/src/main.rs:120–136  ·  view source on GitHub ↗
(ctx: Context)

Source from the content-addressed store, hash-verified

118}
119
120async fn check_login(ctx: Context) -> anyhow::Result<()> {
121 if ctx.config.api_token.is_empty() {
122 println!("You're not logged in");
123 return Ok(());
124 }
125
126 let client = ctx.config.api_client();
127 let self_user = client.get_self_user().await?;
128
129 println!(
130 "Logged in as {}#{}!",
131 self_user.name,
132 self_user.discriminator()
133 );
134
135 Ok(())
136}
137
138async fn logout(ctx: Context) -> anyhow::Result<()> {
139 if ctx.config.api_token.is_empty() {

Callers 1

mainFunction · 0.85

Calls 2

api_clientMethod · 0.80
get_self_userMethod · 0.80

Tested by

no test coverage detected