diff --git a/src/workflow-functions/bot.ts b/src/workflow-functions/bot.ts index 102df49..1ef4593 100644 --- a/src/workflow-functions/bot.ts +++ b/src/workflow-functions/bot.ts @@ -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; } diff --git a/src/workflow-functions/create-chat.ts b/src/workflow-functions/create-chat.ts index ca7ef6a..ade01e9 100644 --- a/src/workflow-functions/create-chat.ts +++ b/src/workflow-functions/create-chat.ts @@ -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(