diff --git a/src/bot/mtproto-api/workrooms.ts b/src/bot/mtproto-api/workrooms.ts index 2d72a84..bbe89c8 100644 --- a/src/bot/mtproto-api/workrooms.ts +++ b/src/bot/mtproto-api/workrooms.ts @@ -45,7 +45,7 @@ export async function createChat(context: Context<"issues.labeled", SupportedEve } try { - const botEntity = await mtProto.client.getEntity(config.botId); + const botEntity = await mtProto.client.getEntity(config.botUsername); await mtProto.client.invoke( new mtProto.api.messages.AddChatUser({ diff --git a/src/types/plugin-inputs.ts b/src/types/plugin-inputs.ts index 25db40f..b2370ac 100644 --- a/src/types/plugin-inputs.ts +++ b/src/types/plugin-inputs.ts @@ -26,6 +26,7 @@ export const pluginSettingsSchema = T.Object({ supergroupChatId: T.Integer(), supergroupChatName: T.String(), botId: T.Transform(T.Unknown()).Decode((value) => Number(value)).Encode((value) => value.toString()), + botUsername: T.String(), }); export const pluginSettingsValidator = new StandardValidator(pluginSettingsSchema);