Captain Ezio commited on
Commit
ba92e70
ยท
1 Parent(s): 98a66ef
Powers/plugins/stickers.py CHANGED
@@ -77,16 +77,20 @@ async def kang(c:Gojo, m: Message):
77
  elif m.reply_to_message.sticker:
78
  sticker_emoji = m.reply_to_message.sticker.emoji
79
  else:
80
- edit_ = await msg.reply_text("No emoji provided choosing a random emoji")
81
  ran = ["๐Ÿคฃ", "๐Ÿ˜‘", "๐Ÿ˜", "๐Ÿ‘", "๐Ÿ”ฅ", "๐Ÿ™ˆ", "๐Ÿ™", "๐Ÿ˜", "๐Ÿ˜˜", "๐Ÿ˜ฑ", "โ˜บ๏ธ", "๐Ÿ™ƒ", "๐Ÿ˜Œ", "๐Ÿคง", "๐Ÿ˜", "๐Ÿ˜ฌ", "๐Ÿคฉ", "๐Ÿ˜€", "๐Ÿ™‚", "๐Ÿฅน", "๐Ÿฅบ", "๐Ÿซฅ", "๐Ÿ™„", "๐Ÿซก", "๐Ÿซ ", "๐Ÿคซ", "๐Ÿ˜“", "๐Ÿฅต", "๐Ÿฅถ", "๐Ÿ˜ค", "๐Ÿ˜ก", "๐Ÿคฌ", "๐Ÿคฏ", "๐Ÿฅด", "๐Ÿคข", "๐Ÿคฎ", "๐Ÿ’€", "๐Ÿ—ฟ", "๐Ÿ’ฉ", "๐Ÿคก", "๐Ÿซถ", "๐Ÿ™Œ", "๐Ÿ‘", "โœŠ", "๐Ÿ‘Ž", "๐Ÿซฐ", "๐ŸคŒ", "๐Ÿ‘Œ", "๐Ÿ‘€", "๐Ÿ’ƒ", "๐Ÿ•บ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘ฉ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ","๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ’‘", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ’", "๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ", "๐Ÿ˜ช", "๐Ÿ˜ด", "๐Ÿ˜ญ", "๐Ÿฅธ", "๐Ÿค“", "๐Ÿซค", "๐Ÿ˜ฎ", "๐Ÿ˜ง", "๐Ÿ˜ฒ", "๐Ÿฅฑ", "๐Ÿ˜ˆ", "๐Ÿ‘ฟ", "๐Ÿค–", "๐Ÿ‘พ", "๐Ÿ™Œ", "๐Ÿฅด", "๐Ÿฅฐ", "๐Ÿ˜‡", "๐Ÿคฃ" ,"๐Ÿ˜‚", "๐Ÿ˜œ", "๐Ÿ˜Ž"]
82
  sticker_emoji = choice(ran)
83
- await edit_.delete()
84
  await msg.edit_text(f"Makeing a sticker with {sticker_emoji} emoji")
85
 
86
  # Get the corresponding fileid, resize the file if necessary
87
  try:
88
-
89
- if (m.reply_to_message.sticker.is_animated or m.reply_to_message.sticker.is_video) or m.reply_to_message.photo or (m.reply_to_message.document and m.reply_to_message.document.mime_type.split("/")[0]=="image"):
 
 
 
 
90
  sizee = (await get_file_size(m.reply_to_message)).split()
91
  if (sizee[1] == "mb" and sizee > 10) or sizee[1] == "gb":
92
  await m.reply_text("File size is too big")
@@ -281,14 +285,14 @@ async def get_sticker_from_file(c: Gojo, m: Message):
281
  x = await m.reply_text("Converting...")
282
  if repl.sticker:
283
  upp = await repl.download()
284
- up = toimage(upp)
285
  await x.delete()
286
  await m.reply_photo(up,caption=Caption)
287
  os.remove(up)
288
  return
289
  elif repl.photo:
290
  upp = await repl.download()
291
- up = tosticker(upp)
292
  await x.delete()
293
  await m.reply_sticker(up,caption=Caption)
294
  os.remove(up)
 
77
  elif m.reply_to_message.sticker:
78
  sticker_emoji = m.reply_to_message.sticker.emoji
79
  else:
80
+ edit = await msg.reply_text("No emoji provided choosing a random emoji")
81
  ran = ["๐Ÿคฃ", "๐Ÿ˜‘", "๐Ÿ˜", "๐Ÿ‘", "๐Ÿ”ฅ", "๐Ÿ™ˆ", "๐Ÿ™", "๐Ÿ˜", "๐Ÿ˜˜", "๐Ÿ˜ฑ", "โ˜บ๏ธ", "๐Ÿ™ƒ", "๐Ÿ˜Œ", "๐Ÿคง", "๐Ÿ˜", "๐Ÿ˜ฌ", "๐Ÿคฉ", "๐Ÿ˜€", "๐Ÿ™‚", "๐Ÿฅน", "๐Ÿฅบ", "๐Ÿซฅ", "๐Ÿ™„", "๐Ÿซก", "๐Ÿซ ", "๐Ÿคซ", "๐Ÿ˜“", "๐Ÿฅต", "๐Ÿฅถ", "๐Ÿ˜ค", "๐Ÿ˜ก", "๐Ÿคฌ", "๐Ÿคฏ", "๐Ÿฅด", "๐Ÿคข", "๐Ÿคฎ", "๐Ÿ’€", "๐Ÿ—ฟ", "๐Ÿ’ฉ", "๐Ÿคก", "๐Ÿซถ", "๐Ÿ™Œ", "๐Ÿ‘", "โœŠ", "๐Ÿ‘Ž", "๐Ÿซฐ", "๐ŸคŒ", "๐Ÿ‘Œ", "๐Ÿ‘€", "๐Ÿ’ƒ", "๐Ÿ•บ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘ฉ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ","๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ’‘", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ’", "๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ", "๐Ÿ˜ช", "๐Ÿ˜ด", "๐Ÿ˜ญ", "๐Ÿฅธ", "๐Ÿค“", "๐Ÿซค", "๐Ÿ˜ฎ", "๐Ÿ˜ง", "๐Ÿ˜ฒ", "๐Ÿฅฑ", "๐Ÿ˜ˆ", "๐Ÿ‘ฟ", "๐Ÿค–", "๐Ÿ‘พ", "๐Ÿ™Œ", "๐Ÿฅด", "๐Ÿฅฐ", "๐Ÿ˜‡", "๐Ÿคฃ" ,"๐Ÿ˜‚", "๐Ÿ˜œ", "๐Ÿ˜Ž"]
82
  sticker_emoji = choice(ran)
83
+ await edit.delete()
84
  await msg.edit_text(f"Makeing a sticker with {sticker_emoji} emoji")
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")
 
285
  x = await m.reply_text("Converting...")
286
  if repl.sticker:
287
  upp = await repl.download()
288
+ up = toimage(upp,is_direc=True)
289
  await x.delete()
290
  await m.reply_photo(up,caption=Caption)
291
  os.remove(up)
292
  return
293
  elif repl.photo:
294
  upp = await repl.download()
295
+ up = tosticker(upp,is_direc=True)
296
  await x.delete()
297
  await m.reply_sticker(up,caption=Caption)
298
  os.remove(up)
Powers/utils/sticker_help.py CHANGED
@@ -243,8 +243,11 @@ async def draw_meme(image_path, text:str,stick):
243
  img.save(mee)
244
  return hue, mee
245
 
246
- def toimage(image, filename=None):
247
  filename = filename if filename else "gojo.jpg"
 
 
 
248
  img = Image.open(image)
249
  if img.mode != "RGB":
250
  img = img.convert("RGB")
@@ -253,8 +256,11 @@ def toimage(image, filename=None):
253
  return filename
254
 
255
 
256
- def tosticker(response, filename=None):
257
  filename = filename if filename else "gojo.webp"
 
 
 
258
  image = Image.open(response)
259
  if image.mode != "RGB":
260
  image.convert("RGB")
 
243
  img.save(mee)
244
  return hue, mee
245
 
246
+ def toimage(image, filename=None, is_direc=False):
247
  filename = filename if filename else "gojo.jpg"
248
+ if is_direc:
249
+ os.rename(image,filename)
250
+ return filename
251
  img = Image.open(image)
252
  if img.mode != "RGB":
253
  img = img.convert("RGB")
 
256
  return filename
257
 
258
 
259
+ def tosticker(response, filename=None, is_direc=False):
260
  filename = filename if filename else "gojo.webp"
261
+ if is_direc:
262
+ os.rename(response,filename)
263
+ return filename
264
  image = Image.open(response)
265
  if image.mode != "RGB":
266
  image.convert("RGB")