-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGift2Sticker.py
More file actions
767 lines (649 loc) · 25.7 KB
/
Copy pathGift2Sticker.py
File metadata and controls
767 lines (649 loc) · 25.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# CopyLeft 2026 github.com/i-execute
# Author: I_execute.t.me
# Licensed under AGPLv3.
__version__ = (1, 1, 1)
# meta developer: Execute_forge.t.me
from telethon.tl.types import Message
from telethon.tl.functions.payments import GetUniqueStarGiftRequest, GetSavedStarGiftsRequest, GetStarGiftsRequest
from telethon.tl.functions.payments import GetPaymentFormRequest
from telethon.tl.types import InputPeerSelf, TextWithEntities
from telethon.tl.types import InputInvoiceStarGift
import io
import re
import asyncio
from .. import loader, utils
from ..inline.types import InlineCall
NFT_LINK_PATTERN = re.compile(r'(?:https?://)?(?:t\.me/nft/)?([A-Za-z][\w-]+-\d+)$')
GIFT_ID_PATTERN = re.compile(r'^\d{19}$')
def _escape(text):
if not text:
return ""
return str(text).replace("&", "&").replace("<", "<").replace(">", ">")
def _parse_nft_slug(text):
text = text.strip()
m = NFT_LINK_PATTERN.match(text)
if m:
return m.group(1)
if re.match(r'^[A-Za-z][\w-]+-\d+$', text):
return text
return None
def _is_custom_emoji_doc(doc):
from telethon.tl.types import DocumentAttributeCustomEmoji
for attr in getattr(doc, 'attributes', []):
if isinstance(attr, DocumentAttributeCustomEmoji):
return True
return False
@loader.tds
class Gift2Sticker(loader.Module):
"""Convert NFT gift link to sticker"""
strings = {
"name": "Gift2Sticker",
"main_menu": (
"<b>Gift2Sticker</b>\n"
"<blockquote>Choose input method</blockquote>"
),
"loading": "<b>Loading...</b>",
"sending_progress": (
"<b>Sending stickers</b>\n"
"<blockquote>{current}/{total} sent</blockquote>"
),
"done": (
"<b>Done</b>\n"
"<blockquote>{sent} sticker(s) sent</blockquote>"
),
"gift_info": (
"<b>NFT Gift: {title}</b>\n"
"<blockquote>"
"Slug: {slug}\n"
"Model: {model}\n"
"Pattern: {pattern}\n"
"Backdrop: {backdrop}"
"</blockquote>"
),
"hidden_gift_info": (
"<b>Hidden Gift</b>\n"
"<blockquote>"
"ID: <code>{id}</code>\n"
"Price: {stars} stars"
"</blockquote>"
),
"err_no_arg": (
"<b>Error</b>\n"
"<blockquote>Provide a gift link or slug</blockquote>"
),
"err_invalid_link": (
"<b>Error</b>\n"
"<blockquote>Invalid gift link or slug</blockquote>"
),
"err_not_found": (
"<b>Error</b>\n"
"<blockquote>Gift not found</blockquote>"
),
"err_no_sticker": (
"<b>Error</b>\n"
"<blockquote>No sticker found for this gift</blockquote>"
),
"err_send_failed": (
"<b>Error</b>\n"
"<blockquote>Failed to send sticker</blockquote>"
),
"err_no_gifts": (
"<b>Error</b>\n"
"<blockquote>No gifts found</blockquote>"
),
"err_invalid_index": (
"<b>Error</b>\n"
"<blockquote>Invalid index. Valid range: 0-{max}</blockquote>"
),
"err_invalid_id": (
"<b>Error</b>\n"
"<blockquote>Invalid gift ID (must be 19 digits)</blockquote>"
),
"err_user_not_found": (
"<b>Error</b>\n"
"<blockquote>User not found</blockquote>"
),
"err_no_saved_gifts": (
"<b>Error</b>\n"
"<blockquote>User has no saved gifts</blockquote>"
),
"stopped": (
"<b>Stopped</b>\n"
"<blockquote>{sent} sticker(s) sent</blockquote>"
),
"input_nft_link": "Enter NFT link or slug:",
"input_index": "Enter gift index:",
"input_gift_id": "Enter gift ID:",
"input_username": "Enter username or ID:",
"btn_nft_link": "NFT Link",
"btn_index": "Index",
"btn_gift_id": "Gift ID",
"btn_from_profile": "From Profile",
"btn_back": "Back",
"btn_kill": "Kill",
"btn_new_sticker": "New Sticker",
"btn_close": "Close",
}
strings_ru = {
"main_menu": (
"<b>Gift2Sticker</b>\n"
"<blockquote>Выберите способ ввода</blockquote>"
),
"loading": "<b>Загрузка...</b>",
"sending_progress": (
"<b>Отправка стикеров</b>\n"
"<blockquote>Отправлено {current}/{total}</blockquote>"
),
"done": (
"<b>Готово</b>\n"
"<blockquote>Отправлено {sent} стикер(ов)</blockquote>"
),
"gift_info": (
"<b>NFT подарок: {title}</b>\n"
"<blockquote>"
"Slug: {slug}\n"
"Модель: {model}\n"
"Паттерн: {pattern}\n"
"Фон: {backdrop}"
"</blockquote>"
),
"hidden_gift_info": (
"<b>Скрытый подарок</b>\n"
"<blockquote>"
"ID: <code>{id}</code>\n"
"Цена: {stars} звезд"
"</blockquote>"
),
"err_no_arg": (
"<b>Ошибка</b>\n"
"<blockquote>Укажите ссылку или slug подарка</blockquote>"
),
"err_invalid_link": (
"<b>Ошибка</b>\n"
"<blockquote>Неверная ссылка или slug подарка</blockquote>"
),
"err_not_found": (
"<b>Ошибка</b>\n"
"<blockquote>Подарок не найден</blockquote>"
),
"err_no_sticker": (
"<b>Ошибка</b>\n"
"<blockquote>Стикер для этого подарка не найден</blockquote>"
),
"err_send_failed": (
"<b>Ошибка</b>\n"
"<blockquote>Не удалось отправить стикер</blockquote>"
),
"err_no_gifts": (
"<b>Ошибка</b>\n"
"<blockquote>Подарки не найдены</blockquote>"
),
"err_invalid_index": (
"<b>Ошибка</b>\n"
"<blockquote>Неверный индекс. Допустимый диапазон: 0-{max}</blockquote>"
),
"err_invalid_id": (
"<b>Ошибка</b>\n"
"<blockquote>Неверный ID подарка (должен быть 19 цифр)</blockquote>"
),
"err_user_not_found": (
"<b>Ошибка</b>\n"
"<blockquote>Пользователь не найден</blockquote>"
),
"err_no_saved_gifts": (
"<b>Ошибка</b>\n"
"<blockquote>У пользователя нет сохранённых подарков</blockquote>"
),
"stopped": (
"<b>Остановлено</b>\n"
"<blockquote>Отправлено {sent} стикер(ов)</blockquote>"
),
"input_nft_link": "Введите NFT ссылку или slug:",
"input_index": "Введите индекс подарка:",
"input_gift_id": "Введите ID подарка:",
"input_username": "Введите username или ID:",
"btn_nft_link": "NFT Link",
"btn_index": "Index",
"btn_gift_id": "Gift ID",
"btn_from_profile": "From Profile",
"btn_back": "Назад",
"btn_kill": "Стоп",
"btn_new_sticker": "Новый стикер",
"btn_close": "Закрыть",
}
def __init__(self):
self._kill_flag = False
self._chat_id = None
self._reply_id = None
async def client_ready(self, client, db):
self._client = client
def _main_menu_markup(self):
return [
[
{"text": self.strings["btn_nft_link"], "callback": self._cb_nft_link, "style": "primary"},
{"text": self.strings["btn_index"], "callback": self._cb_index, "style": "primary"},
],
[
{"text": self.strings["btn_gift_id"], "callback": self._cb_gift_id, "style": "primary"},
{"text": self.strings["btn_from_profile"], "callback": self._cb_from_profile, "style": "primary"},
],
]
async def _cb_main_menu(self, call: InlineCall):
self._kill_flag = False
await call.edit(
self.strings["main_menu"],
reply_markup=self._main_menu_markup(),
)
async def _cb_nft_link(self, call: InlineCall):
await call.edit(
self.strings["main_menu"],
reply_markup=[
[{"text": self.strings["input_nft_link"], "input": self.strings["input_nft_link"], "handler": self._handle_nft_link, "style": "primary"}],
[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}],
],
)
async def _cb_index(self, call: InlineCall):
await call.edit(
self.strings["main_menu"],
reply_markup=[
[{"text": self.strings["input_index"], "input": self.strings["input_index"], "handler": self._handle_index, "style": "primary"}],
[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}],
],
)
async def _cb_gift_id(self, call: InlineCall):
await call.edit(
self.strings["main_menu"],
reply_markup=[
[{"text": self.strings["input_gift_id"], "input": self.strings["input_gift_id"], "handler": self._handle_gift_id, "style": "primary"}],
[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}],
],
)
async def _cb_from_profile(self, call: InlineCall):
await call.edit(
self.strings["main_menu"],
reply_markup=[
[{"text": self.strings["input_username"], "input": self.strings["input_username"], "handler": self._handle_from_profile, "style": "primary"}],
[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}],
],
)
async def _cb_kill(self, call: InlineCall):
self._kill_flag = True
await call.answer("Stopping...")
def _done_markup(self):
return [
[
{"text": self.strings["btn_new_sticker"], "callback": self._cb_main_menu, "style": "success"},
{"text": self.strings["btn_close"], "callback": self._cb_close, "style": "danger"},
],
]
async def _cb_close(self, call: InlineCall):
await call.delete()
async def _send_sticker_doc(self, chat_id, doc, reply_id=None):
from telethon.tl.types import (
DocumentAttributeCustomEmoji,
DocumentAttributeImageSize,
DocumentAttributeSticker,
InputStickerSetEmpty,
)
is_ce = _is_custom_emoji_doc(doc)
if not is_ce:
try:
data = await self._client.download_media(doc, bytes)
if not data:
return False
f = io.BytesIO(data)
f.name = "sticker.tgs"
await self._client.send_file(chat_id, f, reply_to=reply_id)
return True
except Exception:
return False
try:
data = await self._client.download_media(doc, bytes)
if not data:
return False
f = io.BytesIO(data)
f.name = "sticker.tgs"
alt_emoji = ""
for attr in getattr(doc, 'attributes', []):
if isinstance(attr, DocumentAttributeCustomEmoji):
alt_emoji = getattr(attr, 'alt', '') or ''
attrs = [
DocumentAttributeImageSize(w=512, h=512),
DocumentAttributeSticker(
alt=alt_emoji or '',
stickerset=InputStickerSetEmpty(),
mask=None,
mask_coords=None,
),
]
await self._client.send_file(
chat_id, f,
reply_to=reply_id,
attributes=attrs,
force_document=False,
)
return True
except Exception:
try:
data = await self._client.download_media(doc, bytes)
if data:
f = io.BytesIO(data)
f.name = "sticker.tgs"
await self._client.send_file(
chat_id, f,
reply_to=reply_id,
force_document=True,
)
return True
except Exception:
pass
return False
async def _fetch_all_saved_gifts(self, peer):
all_gifts = []
offset = ""
while True:
try:
r = await self._client(GetSavedStarGiftsRequest(peer=peer, offset=offset, limit=10))
if not r.gifts:
break
all_gifts.extend(r.gifts)
if len(r.gifts) < 10:
break
offset = getattr(r, 'next_offset', "") or ""
if not offset:
break
await asyncio.sleep(0.3)
except Exception:
break
return all_gifts
async def _handle_nft_link(self, call: InlineCall, value: str):
value = value.strip()
slug = _parse_nft_slug(value)
if not slug:
await call.edit(
self.strings["err_invalid_link"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
await call.edit(self.strings["loading"], reply_markup=[])
try:
r = await self._client(GetUniqueStarGiftRequest(slug=slug))
gift = r.gift if hasattr(r, 'gift') else r
except Exception:
await call.edit(
self.strings["err_not_found"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
model_name = "?"
pattern_name = "?"
backdrop_name = "?"
model_doc = None
for attr in (getattr(gift, 'attributes', None) or []):
atype = type(attr).__name__
if atype == "StarGiftAttributeModel":
model_name = getattr(attr, 'name', '?')
model_doc = getattr(attr, 'document', None)
elif atype == "StarGiftAttributePattern":
pattern_name = getattr(attr, 'name', '?')
elif atype == "StarGiftAttributeBackdrop":
backdrop_name = getattr(attr, 'name', '?')
if not model_doc:
await call.edit(
self.strings["err_no_sticker"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
self._kill_flag = False
await call.edit(
self.strings["sending_progress"].format(current=0, total=1),
reply_markup=[[{"text": self.strings["btn_kill"], "callback": self._cb_kill, "style": "danger"}]],
)
ok = await self._send_sticker_doc(self._chat_id, model_doc, self._reply_id)
if not ok:
await call.edit(
self.strings["err_send_failed"],
reply_markup=self._done_markup(),
)
return
await call.edit(
self.strings["gift_info"].format(
title=_escape(getattr(gift, 'title', '?')),
slug=_escape(slug),
model=_escape(model_name),
pattern=_escape(pattern_name),
backdrop=_escape(backdrop_name),
),
reply_markup=self._done_markup(),
)
async def _handle_index(self, call: InlineCall, value: str):
value = value.strip()
try:
idx = int(value)
except ValueError:
await call.edit(
self.strings["err_invalid_index"].format(max="?"),
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
await call.edit(self.strings["loading"], reply_markup=[])
try:
result = await self._client(GetStarGiftsRequest(hash=0))
gifts = result.gifts
except Exception:
await call.edit(
self.strings["err_no_gifts"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
if not gifts:
await call.edit(
self.strings["err_no_gifts"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
max_idx = len(gifts) - 1
if idx < 0 or idx > max_idx:
await call.edit(
self.strings["err_invalid_index"].format(max=max_idx),
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
selected = gifts[idx]
sticker = getattr(selected, 'sticker', None)
if not sticker:
await call.edit(
self.strings["err_no_sticker"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
self._kill_flag = False
await call.edit(
self.strings["sending_progress"].format(current=0, total=1),
reply_markup=[[{"text": self.strings["btn_kill"], "callback": self._cb_kill, "style": "danger"}]],
)
ok = await self._send_sticker_doc(self._chat_id, sticker, self._reply_id)
if not ok:
await call.edit(
self.strings["err_send_failed"],
reply_markup=self._done_markup(),
)
return
await call.edit(
self.strings["done"].format(sent=1),
reply_markup=self._done_markup(),
)
async def _handle_gift_id(self, call: InlineCall, value: str):
value = value.strip()
if not GIFT_ID_PATTERN.match(value):
await call.edit(
self.strings["err_invalid_id"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
gift_id = int(value)
await call.edit(self.strings["loading"], reply_markup=[])
try:
result = await self._client(GetStarGiftsRequest(hash=0))
gifts = result.gifts or []
except Exception:
gifts = []
sticker = None
for g in gifts:
if g.id == gift_id:
sticker = getattr(g, 'sticker', None)
break
if sticker:
self._kill_flag = False
await call.edit(
self.strings["sending_progress"].format(current=0, total=1),
reply_markup=[[{"text": self.strings["btn_kill"], "callback": self._cb_kill, "style": "danger"}]],
)
ok = await self._send_sticker_doc(self._chat_id, sticker, self._reply_id)
if not ok:
await call.edit(
self.strings["err_send_failed"],
reply_markup=self._done_markup(),
)
return
await call.edit(
self.strings["done"].format(sent=1),
reply_markup=self._done_markup(),
)
return
try:
me_input = await self._client.get_input_entity(self._client._self_id)
inv = InputInvoiceStarGift(me_input, gift_id, message=TextWithEntities("", []))
form = await self._client(GetPaymentFormRequest(inv))
price = None
if hasattr(form, 'invoice') and form.invoice and form.invoice.prices:
price = form.invoice.prices[0].amount
await call.edit(
self.strings["hidden_gift_info"].format(id=gift_id, stars=price if price is not None else "?"),
reply_markup=self._done_markup(),
)
return
except Exception as e:
err = str(e)
if "STARGIFT_INVALID" in err:
await call.edit(
self.strings["err_not_found"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
await call.edit(
self.strings["err_not_found"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
async def _handle_from_profile(self, call: InlineCall, value: str):
value = value.strip()
await call.edit(self.strings["loading"], reply_markup=[])
try:
target = int(value) if value.lstrip("-").isdigit() else value
entity = await self._client.get_entity(target)
except Exception:
await call.edit(
self.strings["err_user_not_found"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
try:
peer = await self._client.get_input_entity(entity.id)
except Exception:
await call.edit(
self.strings["err_user_not_found"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
all_saved = await self._fetch_all_saved_gifts(peer)
if not all_saved:
await call.edit(
self.strings["err_no_saved_gifts"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
seen_ids = set()
to_send = []
for sg in all_saved:
gift = sg.gift
gtype = type(gift).__name__
gid = getattr(gift, 'id', None)
if gid in seen_ids:
continue
seen_ids.add(gid)
to_send.append((gtype, gift))
if not to_send:
await call.edit(
self.strings["err_no_saved_gifts"],
reply_markup=[[{"text": self.strings["btn_back"], "callback": self._cb_main_menu, "style": "danger"}]],
)
return
total = len(to_send)
self._kill_flag = False
await call.edit(
self.strings["sending_progress"].format(current=0, total=total),
reply_markup=[[{"text": self.strings["btn_kill"], "callback": self._cb_kill, "style": "danger"}]],
)
sent = 0
for gtype, gift in to_send:
if self._kill_flag:
await call.edit(
self.strings["stopped"].format(sent=sent),
reply_markup=self._done_markup(),
)
self._kill_flag = False
return
if gtype == "StarGiftUnique":
slug = getattr(gift, 'slug', None)
if not slug:
continue
try:
r = await self._client(GetUniqueStarGiftRequest(slug=slug))
g = r.gift if hasattr(r, 'gift') else r
for attr in (getattr(g, 'attributes', None) or []):
if type(attr).__name__ == "StarGiftAttributeModel":
doc = getattr(attr, 'document', None)
if doc:
ok = await self._send_sticker_doc(self._chat_id, doc, self._reply_id)
if ok:
sent += 1
break
except Exception:
pass
else:
sticker = getattr(gift, 'sticker', None)
if sticker:
ok = await self._send_sticker_doc(self._chat_id, sticker, self._reply_id)
if ok:
sent += 1
await call.edit(
self.strings["sending_progress"].format(current=sent, total=total),
reply_markup=[[{"text": self.strings["btn_kill"], "callback": self._cb_kill, "style": "danger"}]],
)
if sent % 5 == 0 and sent > 0:
await asyncio.sleep(1)
else:
await asyncio.sleep(0.3)
await call.edit(
self.strings["done"].format(sent=sent),
reply_markup=self._done_markup(),
)
@loader.command(
ru_doc="Конвертировать NFT подарок в стикер",
en_doc="Convert NFT gift to sticker",
)
async def gts(self, message: Message):
"""Convert NFT gift to sticker"""
self._kill_flag = False
self._chat_id = message.chat_id
try:
reply = await message.get_reply_message()
self._reply_id = reply.id if reply else None
except Exception:
self._reply_id = None
await self.inline.form(
text=self.strings["main_menu"],
message=message,
reply_markup=self._main_menu_markup(),
silent=True,
)