Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
1c68821
1
Parent(s):
ba92e70
...
Browse files
Powers/plugins/stickers.py
CHANGED
@@ -69,7 +69,10 @@ async def kang(c:Gojo, m: Message):
|
|
69 |
if not m.from_user:
|
70 |
return await m.reply_text("You are anon admin, kang stickers in my pm.")
|
71 |
msg = await m.reply_text("Kanging Sticker..")
|
72 |
-
|
|
|
|
|
|
|
73 |
# Find the proper emoji
|
74 |
args = m.text.split()
|
75 |
if len(args) > 1:
|
@@ -85,18 +88,13 @@ async def kang(c:Gojo, m: Message):
|
|
85 |
|
86 |
# Get the corresponding fileid, resize the file if necessary
|
87 |
try:
|
88 |
-
if m.reply_to_message.sticker:
|
89 |
-
if m.reply_to_message.sticker.is_animated or m.reply_to_message.sticker.is_video:
|
90 |
-
is_requ = True
|
91 |
-
else:
|
92 |
-
is_requ = False
|
93 |
if is_requ or m.reply_to_message.photo or (m.reply_to_message.document and m.reply_to_message.document.mime_type.split("/")[0]=="image"):
|
94 |
sizee = (await get_file_size(m.reply_to_message)).split()
|
95 |
if (sizee[1] == "mb" and sizee > 10) or sizee[1] == "gb":
|
96 |
await m.reply_text("File size is too big")
|
97 |
return
|
98 |
path = await m.reply_to_message.download()
|
99 |
-
if not
|
100 |
try:
|
101 |
path = await resize_file_to_sticker_size(path)
|
102 |
except OSError as e:
|
@@ -111,7 +109,7 @@ async def kang(c:Gojo, m: Message):
|
|
111 |
LOGGER.error(format_exc())
|
112 |
return
|
113 |
try:
|
114 |
-
if
|
115 |
# telegram doesn't allow animated and video sticker to be kanged as we do for normal stickers
|
116 |
sticker = await create_sticker(
|
117 |
await upload_document(
|
|
|
69 |
if not m.from_user:
|
70 |
return await m.reply_text("You are anon admin, kang stickers in my pm.")
|
71 |
msg = await m.reply_text("Kanging Sticker..")
|
72 |
+
is_requ = False
|
73 |
+
if m.reply_to_message.sticker:
|
74 |
+
if m.reply_to_message.sticker.is_animated or m.reply_to_message.sticker.is_video:
|
75 |
+
is_requ = True
|
76 |
# Find the proper emoji
|
77 |
args = m.text.split()
|
78 |
if len(args) > 1:
|
|
|
88 |
|
89 |
# Get the corresponding fileid, resize the file if necessary
|
90 |
try:
|
|
|
|
|
|
|
|
|
|
|
91 |
if is_requ or m.reply_to_message.photo or (m.reply_to_message.document and m.reply_to_message.document.mime_type.split("/")[0]=="image"):
|
92 |
sizee = (await get_file_size(m.reply_to_message)).split()
|
93 |
if (sizee[1] == "mb" and sizee > 10) or sizee[1] == "gb":
|
94 |
await m.reply_text("File size is too big")
|
95 |
return
|
96 |
path = await m.reply_to_message.download()
|
97 |
+
if not is_requ:
|
98 |
try:
|
99 |
path = await resize_file_to_sticker_size(path)
|
100 |
except OSError as e:
|
|
|
109 |
LOGGER.error(format_exc())
|
110 |
return
|
111 |
try:
|
112 |
+
if is_requ or not m.reply_to_message.sticker:
|
113 |
# telegram doesn't allow animated and video sticker to be kanged as we do for normal stickers
|
114 |
sticker = await create_sticker(
|
115 |
await upload_document(
|