randydev commited on
Commit
f1dc301
·
verified ·
1 Parent(s): 12a17d6

Rename Akeno/plugins/quote to Akeno/plugins/quote.py

Browse files
Files changed (1) hide show
  1. Akeno/plugins/{quote → quote.py} +9 -4
Akeno/plugins/{quote → quote.py} RENAMED
@@ -14,7 +14,9 @@ from Akeno.utils.handler import *
14
  from Akeno.utils.logger import LOGS
15
  from config import *
16
 
17
- def generate_quote(messages: list[dict]) -> tuple[bool, str]:
 
 
18
  json = {
19
  "type": "quote",
20
  "format": "webp",
@@ -34,7 +36,7 @@ def generate_quote(messages: list[dict]) -> tuple[bool, str]:
34
  except Exception as e:
35
  return False, str(e)
36
 
37
- def get_entities(message: Message) -> list[dict]:
38
  entities = []
39
  if message.entities:
40
  for entity in message.entities:
@@ -45,7 +47,6 @@ def get_entities(message: Message) -> list[dict]:
45
  "length": entity.length,
46
  }
47
  )
48
-
49
  return entities
50
 
51
  @Akeno(
@@ -112,4 +113,8 @@ async def quotely(client: Client, message: Message):
112
  return await message.reply_text(f"`{path}`")
113
  await message.reply_sticker(path)
114
  await pro.delete()
115
- os.remove(path)
 
 
 
 
 
14
  from Akeno.utils.logger import LOGS
15
  from config import *
16
 
17
+ from typing import List, Dict, Tuple
18
+
19
+ def generate_quote(messages: List[Dict]) -> Tuple[bool, str]:
20
  json = {
21
  "type": "quote",
22
  "format": "webp",
 
36
  except Exception as e:
37
  return False, str(e)
38
 
39
+ def get_entities(message: Message) -> List[Dict]:
40
  entities = []
41
  if message.entities:
42
  for entity in message.entities:
 
47
  "length": entity.length,
48
  }
49
  )
 
50
  return entities
51
 
52
  @Akeno(
 
113
  return await message.reply_text(f"`{path}`")
114
  await message.reply_sticker(path)
115
  await pro.delete()
116
+ os.remove(path)
117
+
118
+ module = modules_help.add_module("quote", __file__)
119
+ module.add_command("q", "Generate a quote sticker of the replied message.")
120
+ module.add_command("q r", "Generate a quote sticker of the replied message with it's reply message.")