Sørg for at botten ikke introducere hvis man skriver 'hvem er du' på en offentlig chat

This commit is contained in:
Jon Michael Aanes 2018-06-09 15:36:33 +02:00
parent ccda0ceb40
commit 1462d06b0e

View File

@ -520,7 +520,7 @@ local function handle_message(bot, user, channel, message, is_slow_channel)
end end
-- Bot introduction -- Bot introduction
if message:lower():match('%f[%a]hvem%f[%A]') and (message:lower():match('%f[%a]'..escape_pattern(CONFIG.IRC_NICK)..'%f[%A]') or message:lower():match '%f[%a]du%f[%A]') then if message:lower():match('%f[%a]hvem%f[%A]') and (message:lower():match('%f[%a]'..escape_pattern(CONFIG.IRC_NICK)..'%f[%A]') or not is_slow_channel and message:lower():match '%f[%a]du%f[%A]') then
human_delay() human_delay()
local msg = BOT_INTRODUCTION:format(CONFIG.IRC_NICK) local msg = BOT_INTRODUCTION:format(CONFIG.IRC_NICK)
bot:sendChat(channel, msg) bot:sendChat(channel, msg)