- Quotes: HTML bei Liste
- Post-Photo: Ignorieren, wenn Caption "#ignore" enthält
This commit is contained in:
parent
f94b936c17
commit
c629d07bcb
@ -9,6 +9,7 @@ post_photo.triggers = {
|
|||||||
|
|
||||||
function post_photo:pre_process(msg, config)
|
function post_photo:pre_process(msg, config)
|
||||||
if not msg.document then return msg end -- Ignore
|
if not msg.document then return msg end -- Ignore
|
||||||
|
if msg.caption:match("#ignore") then return msg end -- Ignore, when Caption contains "#ignore"
|
||||||
local mime_type = msg.document.mime_type
|
local mime_type = msg.document.mime_type
|
||||||
local valid_mimetypes = {['image/jpeg'] = true, ['image/png'] = true, ['image/bmp'] = true}
|
local valid_mimetypes = {['image/jpeg'] = true, ['image/png'] = true, ['image/bmp'] = true}
|
||||||
if not valid_mimetypes[mime_type] then return msg end
|
if not valid_mimetypes[mime_type] then return msg end
|
||||||
|
@ -63,7 +63,7 @@ function quotes:callback(callback, msg, self, config)
|
|||||||
local text = ""
|
local text = ""
|
||||||
|
|
||||||
for num,quote in pairs(quotes_table) do
|
for num,quote in pairs(quotes_table) do
|
||||||
text = text..num..") "..quote..'\n'
|
text = text..'<b>'..num..")</b> "..quote..'\n'
|
||||||
end
|
end
|
||||||
|
|
||||||
if not text or text == "" then
|
if not text or text == "" then
|
||||||
@ -75,7 +75,7 @@ function quotes:callback(callback, msg, self, config)
|
|||||||
while text_len > 4096 do
|
while text_len > 4096 do
|
||||||
to_send_text = string.sub(text, 1, 4096)
|
to_send_text = string.sub(text, 1, 4096)
|
||||||
text = string.sub(text, 4096, text_len)
|
text = string.sub(text, 4096, text_len)
|
||||||
local res = utilities.send_message(callback.from.id, to_send_text)
|
local res = utilities.send_message(callback.from.id, to_send_text, true, nil, 'HTML')
|
||||||
|
|
||||||
if not res then
|
if not res then
|
||||||
utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true)
|
utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true)
|
||||||
@ -84,7 +84,7 @@ function quotes:callback(callback, msg, self, config)
|
|||||||
text_len = string.len(text)
|
text_len = string.len(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
local res = utilities.send_message(callback.from.id, text)
|
local res = utilities.send_message(callback.from.id, to_send_text, true, nil, 'HTML')
|
||||||
if not res then
|
if not res then
|
||||||
utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true)
|
utilities.answer_callback_query(callback, 'Bitte starte den Bot zuerst privat!', true)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user