fix(client): sticker set negative indexes

This commit is contained in:
teidesu 2021-05-06 11:54:10 +03:00
parent bbb8b20420
commit 09064bb084

View file

@ -225,7 +225,7 @@ export class StickerSet {
if (typeof sticker === 'number') {
if (!this.full) throw new MtCuteEmptyError()
if (sticker < 0) sticker = this.full!.documents.length - sticker
if (sticker < 0) sticker = this.full!.documents.length + sticker
const doc = this.full!.documents[sticker] as tl.RawDocument
sticker = {
@ -254,7 +254,7 @@ export class StickerSet {
if (typeof sticker === 'number') {
if (!this.full) throw new MtCuteEmptyError()
if (sticker < 0) sticker = this.full!.documents.length - sticker
if (sticker < 0) sticker = this.full!.documents.length + sticker
const doc = this.full!.documents[sticker] as tl.RawDocument
sticker = {