Banhammer-Warn-Text kann jetzt in der Config gesetzt werden

This commit is contained in:
Andreas Bielawski 2016-09-04 15:38:32 +02:00
parent 56142c9a11
commit 69787daf92
2 changed files with 12 additions and 2 deletions

View File

@ -18,8 +18,15 @@ Dies ist die BETA-Version von Brawlbot v2.
Sende /hilfe, um zu starten Sende /hilfe, um zu starten
]], ]],
-- The symbol that starts a command. Usually noted as '/' in documentation.
-- DO NOT CHANGE THIS
cmd_pat = '/', cmd_pat = '/',
-- Text for users, who are not approved
banhammer_text = [[
Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann.
This is a private bot, which can only be used after an approval.
]],
-- false = only whitelisted users can use inline querys -- false = only whitelisted users can use inline querys
-- NOTE that it doesn't matter, if the chat is whitelisted! The USER must be whitelisted! -- NOTE that it doesn't matter, if the chat is whitelisted! The USER must be whitelisted!

View File

@ -156,7 +156,10 @@ function banhammer:pre_process(msg, config)
end end
else else
if not has_been_warned then if not has_been_warned then
utilities.send_reply(msg, "Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann.\nThis is a private bot, which can only be after an approval.") utilities.send_reply(msg, config.banhammer_text or [[
Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann.
This is a private bot, which can only be used after an approval.
]])
redis:hset('user:'..user_id, 'has_been_warned', true) redis:hset('user:'..user_id, 'has_been_warned', true)
else else
print('User has already been warned!') print('User has already been warned!')