Mahesh0253 / Media-Search-bot

Inline bot for channels and groups
GNU General Public License v2.0
557 stars 1.15k forks source link

Any way to run this bot for specific users ? #5

Closed rsoorajs closed 4 years ago

rsoorajs commented 4 years ago

Anyway to run this bot for specific users ? Because i want to run this bot for private purpose.so anyway to prevent others using it by comamands or env vars ?

Mahesh0253 commented 4 years ago

Add chat filter for inline query in inline.py file (line no.8)

Example: @Client.on_inline_query(filters.chat(1234))

Replace 1234 by your chat id

rsoorajs commented 4 years ago

can i add more chat ids like 123,456,555 ?

Mahesh0253 commented 4 years ago

Yes, use list in filter. For example filters.chat([1234, 5678, 54311])

rsoorajs commented 4 years ago

IMG_20200914_193317_450

getting InlineQuery object has no attribute "chat" error after changing like that

rsoorajs commented 4 years ago

like files are not showing while i search as inline

Mahesh0253 commented 4 years ago

Try with filters.user instead of filters.chat

rsoorajs commented 4 years ago

Try with filters.user instead of filters.chat

Tried.But one problem,still everyone can access the bot and files.

i changed as like you said @Client.on_inline_query(filters.user(MY NUMERIC ID)) and still the bot is working for other peoples

Mahesh0253 commented 4 years ago

By filters.user other users can't access files in inline search, please check it again

rsoorajs commented 4 years ago

Yes, use list in filter. For example filters.chat([1234, 5678, 54311])

The previous issue was solved.i put CACHE_TIME to 0 and hopefully it worked.

now see this image whilebi outting one more ids,it shows an error.anyway to fix this one too ?

IMG_20200914_224227_502

Mahesh0253 commented 4 years ago

put ids in list format - filters.user([1234, 5678, 54311])

rsoorajs commented 4 years ago

Use put ids in list format - filters.user([1234, 5678, 54311])

Worked.Thank you for your great help ☺️