diff --git a/miku/bot.lua b/miku/bot.lua index ce2fef9..bd45045 100644 --- a/miku/bot.lua +++ b/miku/bot.lua @@ -226,7 +226,7 @@ function bot:run(config) while self.is_started do -- Update loop - local res = bindings.getUpdates{ timeout = 20, offset = self.last_update+1 } + local res = bindings.getUpdates{ timeout = 120, offset = self.last_update+1, allowed_updates = {'message', 'inline_query', 'callback_query'} } if res then -- Iterate over every new message. for n=1, #res.result do diff --git a/miku/plugins/youtube.lua b/miku/plugins/youtube.lua index 09570f4..e7afa46 100644 --- a/miku/plugins/youtube.lua +++ b/miku/plugins/youtube.lua @@ -132,6 +132,19 @@ function send_youtube_data(data, msg, self, link, sendpic) if sendpic then local image_url = get_yt_thumbnail(data) -- need to change text, because Telegram captions can only be 200 characters long and don't support Markdown + -- hacky workaround + if data.statistics.likeCount then + likeCount = ' | šŸ‘ '..comma_value(data.statistics.likeCount)..' |' + dislikeCount = ' šŸ‘Ž '..comma_value(data.statistics.dislikeCount) + else + likeCount = '' + dislikeCount = '' + end + if data.statistics.commentCount then + commentCount = ' | šŸ—£ '..comma_value(data.statistics.commentCount) + else + commentCount = '' + end local text = link..'\n'..title..'\nšŸŽ„ '..uploader..', šŸ“… '..upload_date..'\nšŸ‘ '..viewCount..' | šŸ•’ '..duration..likeCount..dislikeCount..commentCount..'\n' if blocked then text = text..'\nACHTUNG, In Deutschland gesperrt!'