diff --git a/packages/client/src/methods/stickers/add-sticker-to-set.ts b/packages/client/src/methods/stickers/add-sticker-to-set.ts index b76b9aee..1fb6945f 100644 --- a/packages/client/src/methods/stickers/add-sticker-to-set.ts +++ b/packages/client/src/methods/stickers/add-sticker-to-set.ts @@ -1,12 +1,11 @@ import { TelegramClient } from '../../client' -import { InputStickerSet, InputStickerSetItem, normalizeInputStickerSet, StickerSet } from '../../types' - -const MASK_POS = { - forehead: 0, - eyes: 1, - mouth: 2, - chin: 3, -} as const +import { + InputStickerSet, + InputStickerSetItem, + MASK_POSITION_POINT_TO_TL, + normalizeInputStickerSet, + StickerSet, +} from '../../types' /** * Add a sticker to a sticker set. @@ -44,7 +43,7 @@ export async function addStickerToSet( maskCoords: sticker.maskPosition ? { _: 'maskCoords', - n: MASK_POS[sticker.maskPosition.point], + n: MASK_POSITION_POINT_TO_TL[sticker.maskPosition.point], x: sticker.maskPosition.x, y: sticker.maskPosition.y, zoom: sticker.maskPosition.scale, diff --git a/packages/client/src/methods/stickers/create-sticker-set.ts b/packages/client/src/methods/stickers/create-sticker-set.ts index d08a0744..290fd4f7 100644 --- a/packages/client/src/methods/stickers/create-sticker-set.ts +++ b/packages/client/src/methods/stickers/create-sticker-set.ts @@ -5,19 +5,13 @@ import { InputFileLike, InputPeerLike, InputStickerSetItem, + MASK_POSITION_POINT_TO_TL, StickerSet, StickerSourceType, StickerType, } from '../../types' import { normalizeToInputUser } from '../../utils/peer-utils' -const MASK_POS = { - forehead: 0, - eyes: 1, - mouth: 2, - chin: 3, -} as const - /** * Create a new sticker set. * @@ -117,7 +111,7 @@ export async function createStickerSet( maskCoords: sticker.maskPosition ? { _: 'maskCoords', - n: MASK_POS[sticker.maskPosition.point], + n: MASK_POSITION_POINT_TO_TL[sticker.maskPosition.point], x: sticker.maskPosition.x, y: sticker.maskPosition.y, zoom: sticker.maskPosition.scale, diff --git a/packages/client/src/types/media/sticker.ts b/packages/client/src/types/media/sticker.ts index 8a8dbeae..601824ac 100644 --- a/packages/client/src/types/media/sticker.ts +++ b/packages/client/src/types/media/sticker.ts @@ -6,6 +6,13 @@ import { makeInspectable } from '../../utils' import { StickerSet } from '../misc' import { RawDocument } from './document' +export const MASK_POSITION_POINT_TO_TL = { + forehead: 0, + eyes: 1, + mouth: 2, + chin: 3, +} as const + export interface MaskPosition { /** * The part of the face relative where the mask should be placed