fix(client): sticker set negative indexes
This commit is contained in:
parent
bbb8b20420
commit
09064bb084
1 changed files with 2 additions and 2 deletions
|
@ -225,7 +225,7 @@ export class StickerSet {
|
||||||
if (typeof sticker === 'number') {
|
if (typeof sticker === 'number') {
|
||||||
if (!this.full) throw new MtCuteEmptyError()
|
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
|
const doc = this.full!.documents[sticker] as tl.RawDocument
|
||||||
|
|
||||||
sticker = {
|
sticker = {
|
||||||
|
@ -254,7 +254,7 @@ export class StickerSet {
|
||||||
if (typeof sticker === 'number') {
|
if (typeof sticker === 'number') {
|
||||||
if (!this.full) throw new MtCuteEmptyError()
|
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
|
const doc = this.full!.documents[sticker] as tl.RawDocument
|
||||||
|
|
||||||
sticker = {
|
sticker = {
|
||||||
|
|
Loading…
Reference in a new issue