Caching-Fix bei Weather
This commit is contained in:
parent
575ec300b8
commit
29d3dffdda
@ -156,12 +156,15 @@ function weather:inline_callback(inline_query, config, matches)
|
|||||||
local user_id = inline_query.from.id
|
local user_id = inline_query.from.id
|
||||||
if matches[1] ~= 'w' then
|
if matches[1] ~= 'w' then
|
||||||
city = matches[1]
|
city = matches[1]
|
||||||
|
is_personal = false
|
||||||
else
|
else
|
||||||
local set_location = get_location(user_id)
|
local set_location = get_location(user_id)
|
||||||
if not set_location then
|
if not set_location then
|
||||||
city = 'Berlin, Deutschland'
|
city = 'Berlin, Deutschland'
|
||||||
|
is_personal = false
|
||||||
else
|
else
|
||||||
city = set_location
|
city = set_location
|
||||||
|
is_personal = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local lat, lng = weather:get_city_coordinates(city, config)
|
local lat, lng = weather:get_city_coordinates(city, config)
|
||||||
@ -184,7 +187,7 @@ function weather:inline_callback(inline_query, config, matches)
|
|||||||
thumb_url = thumb_url..'cloudy.jpg'
|
thumb_url = thumb_url..'cloudy.jpg'
|
||||||
end
|
end
|
||||||
local results = '[{"type":"article","id":"19122006","title":"'..title..'","description":"'..description..'","thumb_url":"'..thumb_url..'","thumb_width":80,"thumb_height":80,"input_message_content":{"message_text":"'..text..'", "parse_mode":"Markdown"}}]'
|
local results = '[{"type":"article","id":"19122006","title":"'..title..'","description":"'..description..'","thumb_url":"'..thumb_url..'","thumb_width":80,"thumb_height":80,"input_message_content":{"message_text":"'..text..'", "parse_mode":"Markdown"}}]'
|
||||||
utilities.answer_inline_query(self, inline_query, results, ttl)
|
utilities.answer_inline_query(self, inline_query, results, ttl, is_personal)
|
||||||
end
|
end
|
||||||
|
|
||||||
function weather:action(msg, config, matches)
|
function weather:action(msg, config, matches)
|
||||||
|
Reference in New Issue
Block a user