2020# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121# SOFTWARE.
2222
23- from pyrogram import (
24- Emoji , InlineQuery , InlineQueryResultArticle , InlineQueryResultPhoto , InputTextMessageContent , InlineKeyboardButton ,
25- InlineKeyboardMarkup , __version__
26- )
23+ from pyrogram import emoji , __version__
24+ from pyrogram .types import (InlineQuery , InlineQueryResultArticle , InlineQueryResultPhoto , InputTextMessageContent ,
25+ InlineKeyboardButton , InlineKeyboardMarkup )
2726
2827from ..assistant import Assistant
2928from ..utils import docs
@@ -47,31 +46,31 @@ async def inline(_, query: InlineQuery):
4746 await query .answer (
4847 results = docs .DEFAULT_RESULTS ,
4948 cache_time = CACHE_TIME ,
50- switch_pm_text = f"{ Emoji .MAGNIFYING_GLASS_TILTED_RIGHT } Type to search Pyrogram Docs" ,
49+ switch_pm_text = f"{ emoji .MAGNIFYING_GLASS_TILTED_RIGHT } Type to search Pyrogram Docs" ,
5150 switch_pm_parameter = "start" ,
5251 )
5352
5453 return
5554
5655 results = []
5756 offset = int (query .offset or 0 )
58- switch_pm_text = f"{ Emoji .OPEN_BOOK } Pyrogram Docs"
57+ switch_pm_text = f"{ emoji .OPEN_BOOK } Pyrogram Docs"
5958
6059 if string == "!m" :
61- switch_pm_text = f"{ Emoji .CLOSED_BOOK } Pyrogram Methods ({ len (docs .METHODS )} )"
60+ switch_pm_text = f"{ emoji .CLOSED_BOOK } Pyrogram Methods ({ len (docs .METHODS )} )"
6261
6362 if offset == 0 :
6463 results .append (
6564 InlineQueryResultArticle (
6665 title = "Methods" ,
6766 description = "Pyrogram Methods online documentation page" ,
6867 input_message_content = InputTextMessageContent (
69- f"{ Emoji .FIRE } **Pyrogram Methods**\n \n "
68+ f"{ emoji .FIRE } **Pyrogram Methods**\n \n "
7069 f"`This page contains all available high-level Methods existing in Pyrogram v{ VERSION } .`"
7170 ),
7271 reply_markup = InlineKeyboardMarkup ([[
7372 InlineKeyboardButton (
74- f"{ Emoji .OPEN_BOOK } Online docs" ,
73+ f"{ emoji .OPEN_BOOK } Online docs" ,
7574 url = "https://docs.pyrogram.org/api/methods"
7675 )
7776 ]]),
@@ -82,20 +81,20 @@ async def inline(_, query: InlineQuery):
8281 for i in docs .METHODS [offset : offset + NEXT_OFFSET ]:
8382 results .append (i [1 ])
8483 elif string == "!t" :
85- switch_pm_text = f"{ Emoji .GREEN_BOOK } Pyrogram Types ({ len (docs .TYPES )} )"
84+ switch_pm_text = f"{ emoji .GREEN_BOOK } Pyrogram Types ({ len (docs .TYPES )} )"
8685
8786 if offset == 0 :
8887 results .append (
8988 InlineQueryResultArticle (
9089 title = "Types" ,
9190 description = "Pyrogram Types online documentation page" ,
9291 input_message_content = InputTextMessageContent (
93- f"{ Emoji .FIRE } **Pyrogram Types**\n \n "
92+ f"{ emoji .FIRE } **Pyrogram Types**\n \n "
9493 f"`This page contains all available high-level Types existing in Pyrogram v{ VERSION } .`"
9594 ),
9695 reply_markup = InlineKeyboardMarkup ([[
9796 InlineKeyboardButton (
98- f"{ Emoji .OPEN_BOOK } Online docs" ,
97+ f"{ emoji .OPEN_BOOK } Online docs" ,
9998 url = "https://docs.pyrogram.org/api/types"
10099 )
101100 ]]),
@@ -106,20 +105,20 @@ async def inline(_, query: InlineQuery):
106105 for i in docs .TYPES [offset : offset + NEXT_OFFSET ]:
107106 results .append (i [1 ])
108107 elif string == "!b" :
109- switch_pm_text = f"{ Emoji .CLOSED_BOOK } Pyrogram Bound Methods ({ len (docs .BOUND_METHODS )} )"
108+ switch_pm_text = f"{ emoji .CLOSED_BOOK } Pyrogram Bound Methods ({ len (docs .BOUND_METHODS )} )"
110109
111110 if offset == 0 :
112111 results .append (
113112 InlineQueryResultArticle (
114113 title = "Types" ,
115114 description = "Pyrogram Bound Methods online documentation page" ,
116115 input_message_content = InputTextMessageContent (
117- f"{ Emoji .FIRE } **Pyrogram Bound Methods**\n \n "
116+ f"{ emoji .FIRE } **Pyrogram Bound Methods**\n \n "
118117 f"`This page contains all available bound methods existing in Pyrogram v{ VERSION } .`"
119118 ),
120119 reply_markup = InlineKeyboardMarkup ([[
121120 InlineKeyboardButton (
122- f"{ Emoji .OPEN_BOOK } Online docs" ,
121+ f"{ emoji .OPEN_BOOK } Online docs" ,
123122 url = "https://docs.pyrogram.org/api/bound-methods"
124123 )]]
125124 ),
@@ -130,20 +129,20 @@ async def inline(_, query: InlineQuery):
130129 for i in docs .BOUND_METHODS [offset : offset + NEXT_OFFSET ]:
131130 results .append (i [1 ])
132131 elif string == "!d" :
133- switch_pm_text = f"{ Emoji .CLOSED_BOOK } Pyrogram Decorators ({ len (docs .DECORATORS )} )"
132+ switch_pm_text = f"{ emoji .CLOSED_BOOK } Pyrogram Decorators ({ len (docs .DECORATORS )} )"
134133
135134 if offset == 0 :
136135 results .append (
137136 InlineQueryResultArticle (
138137 title = "Decorators" ,
139138 description = "Pyrogram Decorators online documentation page" ,
140139 input_message_content = InputTextMessageContent (
141- f"{ Emoji .FIRE } **Pyrogram Decorators**\n \n "
140+ f"{ emoji .FIRE } **Pyrogram Decorators**\n \n "
142141 f"`This page contains all available decorators existing in Pyrogram v{ VERSION } .`"
143142 ),
144143 reply_markup = InlineKeyboardMarkup ([[
145144 InlineKeyboardButton (
146- f"{ Emoji .OPEN_BOOK } Online docs" ,
145+ f"{ emoji .OPEN_BOOK } Online docs" ,
147146 url = "https://docs.pyrogram.org/api/decorators"
148147 )]]
149148 ),
@@ -154,20 +153,20 @@ async def inline(_, query: InlineQuery):
154153 for i in docs .DECORATORS [offset : offset + NEXT_OFFSET ]:
155154 results .append (i [1 ])
156155 elif string == "!f" :
157- switch_pm_text = f"{ Emoji .CONTROL_KNOBS } Pyrogram Filters ({ len (docs .FILTERS )} )"
156+ switch_pm_text = f"{ emoji .CONTROL_KNOBS } Pyrogram Filters ({ len (docs .FILTERS )} )"
158157
159158 if offset == 0 :
160159 results .append (
161160 InlineQueryResultArticle (
162161 title = "Filters" ,
163162 description = "Pyrogram Filters online documentation page" ,
164163 input_message_content = InputTextMessageContent (
165- f"{ Emoji .FIRE } **Pyrogram Filters**\n \n "
164+ f"{ emoji .FIRE } **Pyrogram Filters**\n \n "
166165 f"`This page contains all library-defined Filters available in Pyrogram v{ VERSION } .`"
167166 ),
168167 reply_markup = InlineKeyboardMarkup ([[
169168 InlineKeyboardButton (
170- f"{ Emoji .OPEN_BOOK } Online docs" ,
169+ f"{ emoji .OPEN_BOOK } Online docs" ,
171170 url = "https://docs.pyrogram.org/api/filters"
172171 )
173172 ]]),
@@ -178,25 +177,25 @@ async def inline(_, query: InlineQuery):
178177 for i in docs .FILTERS [offset : offset + NEXT_OFFSET ]:
179178 results .append (i [1 ])
180179 elif string == "!rm" :
181- switch_pm_text = f"{ Emoji .BLUE_BOOK } Raw Methods ({ len (docs .RAW_METHODS )} )"
180+ switch_pm_text = f"{ emoji .BLUE_BOOK } Raw Methods ({ len (docs .RAW_METHODS )} )"
182181
183182 if offset == 0 :
184183 results .append (
185184 InlineQueryResultArticle (
186185 title = "Raw Methods" ,
187186 description = "Pyrogram Raw Methods online documentation page" ,
188187 input_message_content = InputTextMessageContent (
189- f"{ Emoji .FIRE } **Pyrogram Raw Methods**\n \n "
188+ f"{ emoji .FIRE } **Pyrogram Raw Methods**\n \n "
190189 f"`This page contains all available Raw Methods existing in the Telegram Schema, Layer `"
191190 f"`{ docs .layer } .`"
192191 ),
193192 reply_markup = InlineKeyboardMarkup ([[
194193 InlineKeyboardButton (
195- f"{ Emoji .OPEN_BOOK } Online docs" ,
194+ f"{ emoji .OPEN_BOOK } Online docs" ,
196195 url = "https://docs.pyrogram.org/telegram/functions"
197196 ),
198197 InlineKeyboardButton (
199- f"{ Emoji .SCROLL } TL Schema" ,
198+ f"{ emoji .SCROLL } TL Schema" ,
200199 url = "https://github.com/pyrogram/pyrogram/blob/develop/compiler/api/source/main_api.tl"
201200 ),
202201 ]]),
@@ -207,25 +206,25 @@ async def inline(_, query: InlineQuery):
207206 for i in docs .RAW_METHODS [offset : offset + NEXT_OFFSET ]:
208207 results .append (i [1 ])
209208 elif string == "!rt" :
210- switch_pm_text = f"{ Emoji .ORANGE_BOOK } Raw Types ({ len (docs .RAW_TYPES )} )"
209+ switch_pm_text = f"{ emoji .ORANGE_BOOK } Raw Types ({ len (docs .RAW_TYPES )} )"
211210
212211 if offset == 0 :
213212 results .append (
214213 InlineQueryResultArticle (
215214 title = "Raw Types" ,
216215 description = "Pyrogram Raw Types online documentation page" ,
217216 input_message_content = InputTextMessageContent (
218- f"{ Emoji .FIRE } **Pyrogram Raw Types**\n \n "
217+ f"{ emoji .FIRE } **Pyrogram Raw Types**\n \n "
219218 f"`This page contains all available Raw Types existing in the Telegram Schema, Layer "
220219 f"{ docs .layer } .`"
221220 ),
222221 reply_markup = InlineKeyboardMarkup ([[
223222 InlineKeyboardButton (
224- f"{ Emoji .OPEN_BOOK } Online docs" ,
223+ f"{ emoji .OPEN_BOOK } Online docs" ,
225224 url = "https://docs.pyrogram.org/telegram/types"
226225 ),
227226 InlineKeyboardButton (
228- f"{ Emoji .SCROLL } TL Schema" ,
227+ f"{ emoji .SCROLL } TL Schema" ,
229228 url = "https://github.com/pyrogram/pyrogram/blob/develop/compiler/api/source/main_api.tl" ,
230229 ),
231230 ]]),
@@ -236,7 +235,7 @@ async def inline(_, query: InlineQuery):
236235 for i in docs .RAW_TYPES [offset : offset + NEXT_OFFSET ]:
237236 results .append (i [1 ])
238237 elif string == "rules" :
239- switch_pm_text = f"{ Emoji .SCROLL } Chat Rules"
238+ switch_pm_text = f"{ emoji .SCROLL } Chat Rules"
240239
241240 if offset == 0 :
242241 results .append (
@@ -251,7 +250,7 @@ async def inline(_, query: InlineQuery):
251250 for i in docs .RULES [offset : offset + NEXT_OFFSET ]:
252251 results .append (i )
253252 elif string == "colin" :
254- switch_pm_text = f"{ Emoji .SHARK } Hidden Shark"
253+ switch_pm_text = f"{ emoji .SHARK } Hidden Shark"
255254
256255 if offset == 0 :
257256 results .append (
@@ -260,8 +259,8 @@ async def inline(_, query: InlineQuery):
260259 # thumb_url="https://i.imgur.com/f32hngs.jpg",
261260 title = "You found the secret Sharkception :O" ,
262261 description = "You might not get anything from it, but you can feel proud to have found me!" ,
263- caption = f"Hey, I found @ColinShark { Emoji .SHARK } " ,
264- # input_message_content=InputTextMessageContent(f"Hey, I found @ColinShark {Emoji .SHARK}"),
262+ caption = f"Hey, I found @ColinShark { emoji .SHARK } " ,
263+ # input_message_content=InputTextMessageContent(f"Hey, I found @ColinShark {emoji .SHARK}"),
265264 )
266265 )
267266
@@ -291,7 +290,7 @@ async def inline(_, query: InlineQuery):
291290 await query .answer (
292291 results = [],
293292 cache_time = CACHE_TIME ,
294- switch_pm_text = f"{ Emoji .MAGNIFYING_GLASS_TILTED_RIGHT } Type to search Raw Docs" ,
293+ switch_pm_text = f"{ emoji .MAGNIFYING_GLASS_TILTED_RIGHT } Type to search Raw Docs" ,
295294 switch_pm_parameter = "start" ,
296295 )
297296
@@ -326,7 +325,7 @@ async def inline(_, query: InlineQuery):
326325
327326 if results :
328327 count = len (results )
329- switch_pm_text = f"{ Emoji .OPEN_BOOK } { count } Result{ 's' if count > 1 else '' } for \" { string } \" "
328+ switch_pm_text = f"{ emoji .OPEN_BOOK } { count } Result{ 's' if count > 1 else '' } for \" { string } \" "
330329
331330 await query .answer (
332331 results = results [:50 ],
@@ -338,6 +337,6 @@ async def inline(_, query: InlineQuery):
338337 await query .answer (
339338 results = [],
340339 cache_time = CACHE_TIME ,
341- switch_pm_text = f'{ Emoji .CROSS_MARK } No results for "{ string } "' ,
340+ switch_pm_text = f'{ emoji .CROSS_MARK } No results for "{ string } "' ,
342341 switch_pm_parameter = "okay" ,
343342 )
0 commit comments