Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 8, 2024
1 parent 709346c commit 352e1fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/bot/mtproto-api/workrooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export async function createChat(context: Context<"issues.labeled", SupportedEve
}

try {

const botEntity = await mtProto.client.getEntity(config.botId);

await mtProto.client.invoke(
Expand Down Expand Up @@ -97,7 +96,7 @@ export async function closeChat(context: Context<"issues.closed", SupportedEvent
});

for (let i = 0; i < userIDs.length; i++) {
if (userIDs[i] === context.config.botId) {
if (userIDs[i].toJSNumber() === context.config.botId) {
continue;
}
await mtProto.client.invoke(
Expand Down
3 changes: 1 addition & 2 deletions src/types/plugin-inputs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SupportedEvents, SupportedEventsU } from "./context";
import { StaticDecode, Type as T } from "@sinclair/typebox";
import bigInt from "big-integer";
import { StandardValidator } from "typebox-validators";

export interface PluginInputs<T extends SupportedEventsU = SupportedEventsU, TU extends SupportedEvents[T] = SupportedEvents[T]> {
Expand All @@ -26,7 +25,7 @@ export const pluginSettingsSchema = T.Object({
*/
supergroupChatId: T.Integer(),
supergroupChatName: T.String(),
botId: T.Transform(T.Unknown()).Decode((value) => bigInt(Number(value))).Encode((value) => value.toString()),
botId: T.Transform(T.Unknown()).Decode((value) => Number(value)).Encode((value) => value.toString()),
});

export const pluginSettingsValidator = new StandardValidator(pluginSettingsSchema);
Expand Down

0 comments on commit 352e1fb

Please sign in to comment.