mirror of https://github.com/coddrago/Heroku
1.0.5: Allow to pass `disable_security` and `always_allow` to buttons directly for use in inline queries
parent
f4f7e8e0b9
commit
74e6bbdad6
|
@ -222,7 +222,8 @@ class Events(InlineUnit):
|
||||||
for button in utils.array_sum(form.get("buttons", [])):
|
for button in utils.array_sum(form.get("buttons", [])):
|
||||||
if button.get("_callback_data", None) == query.data:
|
if button.get("_callback_data", None) == query.data:
|
||||||
if (
|
if (
|
||||||
form.get("disable_security", False)
|
button.get("disable_security", False)
|
||||||
|
or form.get("disable_security", False)
|
||||||
or (
|
or (
|
||||||
form.get("force_me", False)
|
form.get("force_me", False)
|
||||||
and query.from_user.id == self._me
|
and query.from_user.id == self._me
|
||||||
|
@ -244,7 +245,8 @@ class Events(InlineUnit):
|
||||||
elif (
|
elif (
|
||||||
query.from_user.id
|
query.from_user.id
|
||||||
not in self._client.dispatcher.security._owner
|
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!")
|
await query.answer("You are not allowed to press this button!")
|
||||||
return
|
return
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__version__ = (1, 1, 4)
|
__version__ = (1, 1, 5)
|
||||||
|
|
Loading…
Reference in New Issue