Merge Upstream
This commit is contained in:
commit
d86d2ed844
@ -226,7 +226,7 @@ function bot:run(config)
|
|||||||
|
|
||||||
while self.is_started do
|
while self.is_started do
|
||||||
-- Update loop
|
-- 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
|
if res then
|
||||||
-- Iterate over every new message.
|
-- Iterate over every new message.
|
||||||
for n=1, #res.result do
|
for n=1, #res.result do
|
||||||
|
@ -132,6 +132,19 @@ function send_youtube_data(data, msg, self, link, sendpic)
|
|||||||
if sendpic then
|
if sendpic then
|
||||||
local image_url = get_yt_thumbnail(data)
|
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
|
-- 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'
|
local text = link..'\n'..title..'\n🎥 '..uploader..', 📅 '..upload_date..'\n👁 '..viewCount..' | 🕒 '..duration..likeCount..dislikeCount..commentCount..'\n'
|
||||||
if blocked then
|
if blocked then
|
||||||
text = text..'\nACHTUNG, In Deutschland gesperrt!'
|
text = text..'\nACHTUNG, In Deutschland gesperrt!'
|
||||||
|
Reference in New Issue
Block a user