[QUESTION] Alter Filters.user uids list dinamically #2358
Replies: 6 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
-
This didn't fix the problem but thanks for the hint |
Beta Was this translation helpful? Give feedback.
-
Uh, sorry, I misread your |
Beta Was this translation helpful? Give feedback.
-
I already perform what you’re talking about, I have a list that stores those values, get_by_rank is inside a class. handlers.append(CommandHandler('start',start,white_list.get_by_rank(0))) Even if I update my data structure with all the new UIDs those new folks can’t access to the bot. |
Beta Was this translation helpful? Give feedback.
-
What I'm saying is that you need something like rank_0_filter = white_list.get_by_rank(0)
handlers.append(CommandHandler('start',start, rank_0_filter))
…
def add_user_to_rank_0(update, context):
...
rank_0_filter.add_user_ids(…) |
Beta Was this translation helpful? Give feedback.
-
So I need a pointer to that resource? So If I update the list it’s still in sync? Also Filters.user().add_user_ids accept an array? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone thanks for this amazing wrapper!!
I'm trying to figure out the creation of a bot that needs to update the filters attached to the handlers to time in time.
I have an admin with a specific UID that have access to the bot (by filtering), this administrator can create new admins or people with a different permission rank that can or cannot use certain features.
Now I created a class that returns a Filters.user() filled with UIDs of who can access the command based on the rank:
My problem is that when I launch the app those filters are created and attached to the handlers and then to the dispatcher,
now If my first admin creates a new admin this one will have no access to the bot until the restart of the bot there is a way to update this Filter.user() list dynamically?
Example of handlers:
Attachment to the dispatcher:
Any Ideas?
Beta Was this translation helpful? Give feedback.
All reactions