diff --git a/otouto/plugins/imdb.lua b/otouto/plugins/imdb.lua index 3905cd0..754b50f 100644 --- a/otouto/plugins/imdb.lua +++ b/otouto/plugins/imdb.lua @@ -39,9 +39,15 @@ function imdb:inline_callback(inline_query, config, matches) local movie_info = imdb:get_imdb_info(imdb_id) local title = movie_info.Title local year = movie_info.Year - local description = movie_info.Plot - local text = ''..movie_info.Title.. ' ('..movie_info.Year..') von '..movie_info.Director..'\\n'..string.gsub(movie_info.imdbRating, '%.', ',')..'/10 | '..movie_info.Runtime..' | '.. movie_info.Genre..'\\n' .. movie_info.Plot .. '' + local text = ''..movie_info.Title.. ' ('..movie_info.Year..') von '..movie_info.Director..'\\n'..string.gsub(movie_info.imdbRating, '%.', ',')..'/10 | '..movie_info.Runtime..' | '.. movie_info.Genre + if movie_info.Plot then + text = text..'\\n'..movie_info.Plot..'' + description = movie_info.Plot + else + description = 'Keine Beschreibung verfügbar' + end local text = text:gsub('"', '\\"') + local text = text:gsub("'", "\'") if movie_info.Poster == "N/A" then img_url = 'https://anditest.perseus.uberspace.de/inlineQuerys/imdb/logo.jpg' @@ -53,7 +59,7 @@ function imdb:inline_callback(inline_query, config, matches) local results = results:sub(0, -2) local results = results..']' - utilities.answer_inline_query(self, inline_query, results, 10000) + utilities.answer_inline_query(self, inline_query, results, 1) end function imdb:action(msg, config)