Fixes für CallbackQuerys
This commit is contained in:
parent
2f95b6b562
commit
93b1a1eab2
@ -132,7 +132,7 @@ function bot:on_callback_receive(callback, msg, config) -- whenever a new callba
|
|||||||
|
|
||||||
-- Check if whitelist is enabled and user/chat is whitelisted
|
-- Check if whitelist is enabled and user/chat is whitelisted
|
||||||
local whitelist = redis:get('whitelist:enabled')
|
local whitelist = redis:get('whitelist:enabled')
|
||||||
if whitelist and not is_sudo(msg, config) then
|
if whitelist and not is_sudo(callback, config) then
|
||||||
local hash = 'whitelist:user#id'..user_id
|
local hash = 'whitelist:user#id'..user_id
|
||||||
local allowed = redis:get(hash) or false
|
local allowed = redis:get(hash) or false
|
||||||
if not allowed then
|
if not allowed then
|
||||||
@ -160,10 +160,12 @@ function bot:on_callback_receive(callback, msg, config) -- whenever a new callba
|
|||||||
for n=1, #self.plugins do
|
for n=1, #self.plugins do
|
||||||
local plugin = self.plugins[n]
|
local plugin = self.plugins[n]
|
||||||
if plugin.name == called_plugin then
|
if plugin.name == called_plugin then
|
||||||
if is_plugin_disabled_on_chat(plugin.name, msg) then return end
|
if is_plugin_disabled_on_chat(plugin.name, msg) then utilities.answer_callback_query(callback, 'Plugin wurde in diesem Chat deaktiviert.') return end
|
||||||
plugin:callback(callback, msg, self, config, param)
|
plugin:callback(callback, msg, self, config, param)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
utilities.answer_callback_query(callback, 'Ungültiger CallbackQuery: Kein Plugin gefunden.')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- NOTE: To enable InlineQuerys, send /setinline to @BotFather
|
-- NOTE: To enable InlineQuerys, send /setinline to @BotFather
|
||||||
|
@ -74,6 +74,7 @@ function pocket:add_pocket_item(access_token, url)
|
|||||||
local code = result.item.response_code
|
local code = result.item.response_code
|
||||||
|
|
||||||
local text = title..' ('..given_url..') hinzugefügt!'
|
local text = title..' ('..given_url..') hinzugefügt!'
|
||||||
|
if not code then return text end
|
||||||
if code ~= "200" and code ~= "0" then text = text..'\nAber die Seite liefert Fehler '..code..' zurück.' end
|
if code ~= "200" and code ~= "0" then text = text..'\nAber die Seite liefert Fehler '..code..' zurück.' end
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user