1.0.5: Allow to pass `disable_security` and `always_allow` to buttons directly for use in inline queries

pull/1/head
Hikari 2022-04-23 04:20:44 +00:00
parent f4f7e8e0b9
commit 74e6bbdad6
No known key found for this signature in database
GPG Key ID: 5FA52ACBB2AD964D
2 changed files with 5 additions and 3 deletions

View File

@ -222,7 +222,8 @@ class Events(InlineUnit):
for button in utils.array_sum(form.get("buttons", [])):
if button.get("_callback_data", None) == query.data:
if (
form.get("disable_security", False)
button.get("disable_security", False)
or form.get("disable_security", False)
or (
form.get("force_me", False)
and query.from_user.id == self._me
@ -244,7 +245,8 @@ class Events(InlineUnit):
elif (
query.from_user.id
not in self._client.dispatcher.security._owner
and query.from_user.id not in form.get("always_allow", [])
+ form.get("always_allow", [])
+ button.get("always_allow", [])
):
await query.answer("You are not allowed to press this button!")
return

View File

@ -1 +1 @@
__version__ = (1, 1, 4)
__version__ = (1, 1, 5)