returnapi.send_message(chat_id,'Please separate the question and answer with a pipe character (|).\nExample: <code>/customcaptcha set What colour is the sky? | blue</code>',{parse_mode='html'})
end
question=question:match('^%s*(.-)%s*$')
answer=answer:match('^%s*(.-)%s*$')
if#question>300then
returnapi.send_message(chat_id,'The question must be 300 characters or fewer.')
end
if#answer>100then
returnapi.send_message(chat_id,'The answer must be 100 characters or fewer.')
returnapi.send_message(chat_id,'Custom captcha removed. Default math captcha will be used.')
else
returnapi.send_message(chat_id,'Usage: <code>/customcaptcha set <question> | <answer></code> or <code>/customcaptcha clear</code>',{parse_mode='html'})
end
end
functionplugin.on_member_join(api,message,ctx)
ifnotctx.is_groupthenreturnend
localchat_id=message.chat.id
-- Check if a custom captcha is configured for this chat
'Welcome, <a href="tg://user?id=%d">%s</a>! To verify you\'re human, please answer the following question:\n\n<b>%s</b>\n\nType your answer in the chat. You have %d seconds.',