22import logging
33from datetime import timedelta , datetime
44from urllib .parse import quote
5+ from uuid import uuid4
56
67from aiotg import Chat , aiohttp
78
@@ -209,6 +210,34 @@ async def chats(chat: Chat, matched):
209210 )
210211
211212
213+ functions = ['/version' , 'import __hello__' ,
214+ 'import this' , 'zen' , '/about' ,
215+ 'from this import hi' , 'from this import gist' ,
216+ 'from this import long_better' , 'from this import correct' ,
217+ 'from this import offtopic' , 'from this import politeness' ,
218+ 'from this import ask' , 'from this import mood' ,
219+ 'from this import voice' , 'from this import git' ]
220+
221+
222+ @bot .inline
223+ async def inline_query (query ):
224+ """Find autocomplite for inline query"""
225+
226+ results = []
227+
228+ for func in functions :
229+ if query .query in func :
230+ results .append ({
231+ "type" : "article" ,
232+ "title" : func ,
233+ "id" : "{}" .format (uuid4 ()),
234+ "input_message_content" : {"message_text" : func },
235+ }
236+ )
237+ return query .answer (results )
238+
239+
212240if __name__ == "__main__" :
213241 logger .info ("Running..." )
214242 bot .run (debug = DEBUG )
243+
0 commit comments