1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00

Merge pull request #111 from AwesomePatrol/post-join-team-on-discord

Send "join team" messages to discord
This commit is contained in:
MewMew 2020-01-07 02:05:20 +01:00 committed by GitHub
commit d31e27c0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
local Public = {} local Public = {}
local Server = require 'utils.server'
local bb_config = require "maps.biter_battles_v2.config" local bb_config = require "maps.biter_battles_v2.config"
local event = require 'utils.event' local event = require 'utils.event'
@ -309,7 +310,9 @@ function join_team(player, force_name, forced_join)
if not forced_join then if not forced_join then
local c = player.force.name local c = player.force.name
if global.tm_custom_name[player.force.name] then c = global.tm_custom_name[player.force.name] end if global.tm_custom_name[player.force.name] then c = global.tm_custom_name[player.force.name] end
game.print(player.name .. " has joined team " .. c .. "!", {r = 0.98, g = 0.66, b = 0.22}) local message = table.concat({player.name, " has joined team ", c, "!"})
game.print(message, {r = 0.98, g = 0.66, b = 0.22})
Server.to_discord_bold(message)
end end
local i = player.get_inventory(defines.inventory.character_main) local i = player.get_inventory(defines.inventory.character_main)
i.clear() i.clear()