Skip to content

Commit

Permalink
chore: move connect to before api invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 4, 2024
1 parent 98d3b8d commit 0eef0d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/workflow-functions/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class MtProtoSingleton {
MtProtoSingleton.instance = new MtProtoSingleton();
MtProtoSingleton.api = Api;
MtProtoSingleton.client = await mtProtoInit(env, MtProtoSingleton.api);
await MtProtoSingleton.client.connect();
}
return MtProtoSingleton.instance;
}
Expand Down
1 change: 1 addition & 0 deletions src/workflow-functions/create-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export async function createChat(context: Context<"issues.labeled", SupportedEve

const mtProto = await MtProtoSingleton.getInstance(env);
const client = mtProto.getClient();
await client.connect();
const api = mtProto.getApi();
console.log("Creating chat with name: ", chatName);
const chat = await client.invoke(
Expand Down

0 comments on commit 0eef0d1

Please sign in to comment.