fix: Fix client state not updated after login
This commit is contained in:
parent
2b4f2bc8e9
commit
baba05c01d
|
@ -75,8 +75,10 @@ export const loginHandler: ToolHandler = async (args, context) => {
|
||||||
context.client.token = args.token;
|
context.client.token = args.token;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to log in with the token
|
// Attempt to log in with the token and get the ready client
|
||||||
await context.client.login(token);
|
const readyClient = await waitForReady(context.client, token);
|
||||||
|
// Update the context client with the ready client
|
||||||
|
context.client = readyClient;
|
||||||
return {
|
return {
|
||||||
content: [{ type: "text", text: `Successfully logged in to Discord: ${context.client.user?.tag}` }]
|
content: [{ type: "text", text: `Successfully logged in to Discord: ${context.client.user?.tag}` }]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue