Update all code styles

This commit is contained in:
Cooldude2606
2024-09-28 01:56:54 +01:00
parent 5e2a62ab27
commit 292c1a1b68
194 changed files with 9817 additions and 9703 deletions

View File

@@ -17,17 +17,17 @@ Event.add(defines.events.on_console_chat, function(event)
local prefix = config.command_prefix
for key_word, reply in pairs(config.messages) do
if message:find(key_word) then
local is_command = message:find(prefix..key_word)
if type(reply) == 'function' then
local is_command = message:find(prefix .. key_word)
if type(reply) == "function" then
reply = reply(player, is_command)
end
if is_command and allowed then
game.print{'chat-bot.reply', reply}
game.print{ "chat-bot.reply", reply }
elseif is_command then
player.print{'chat-bot.disallow'}
player.print{ "chat-bot.disallow" }
elseif not allowed then
player.print{'chat-bot.reply', reply}
player.print{ "chat-bot.reply", reply }
end
end
end
@@ -35,18 +35,16 @@ Event.add(defines.events.on_console_chat, function(event)
if not allowed then return end
for key_word, reply in pairs(config.commands) do
if message:find(prefix..key_word) then
if type(reply) == 'function' then
if message:find(prefix .. key_word) then
if type(reply) == "function" then
local msg = reply(player, true)
if reply then
game.print{'chat-bot.reply', msg}
game.print{ "chat-bot.reply", msg }
end
else
game.print{'chat-bot.reply', reply}
game.print{ "chat-bot.reply", reply }
end
end
end
end)
end)