Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rsoorajs opened this issue Sep 14, 2020 · 11 comments
Closed

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

rsoorajs opened this issue Sep 14, 2020 · 11 comments

Comments

@rsoorajs
Copy link

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 ?

@rsoorajs rsoorajs changed the title Any way to run the bot for specific users ? Any way to run this bot for specific users ? Sep 14, 2020
@Mahesh0253
Copy link
Owner

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
Copy link
Author

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

@Mahesh0253
Copy link
Owner

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

@rsoorajs
Copy link
Author

rsoorajs commented Sep 14, 2020

IMG_20200914_193317_450

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

@rsoorajs
Copy link
Author

like files are not showing while i search as inline

@Mahesh0253
Copy link
Owner

Try with filters.user instead of filters.chat

@rsoorajs
Copy link
Author

rsoorajs commented Sep 14, 2020

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
Copy link
Owner

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

@rsoorajs
Copy link
Author

rsoorajs commented Sep 14, 2020

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
Copy link
Owner

Mahesh0253 commented Sep 14, 2020

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

@rsoorajs
Copy link
Author

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

Worked.Thank you for your great help ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants