1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00
RedMew/server.lua

83 lines
2.2 KiB
Lua
Raw Normal View History

2018-09-21 20:48:12 +02:00
local Public = {}
2018-10-03 22:03:19 +02:00
local raw_print = print
function print(str)
raw_print('[PRINT] ' .. str)
end
2018-09-22 18:41:20 +02:00
local discord_tag = '[DISCORD]'
local discord_raw_tag = '[DISCORD-RAW]'
2018-10-03 22:03:19 +02:00
local discord_bold_tag = '[DISCORD-BOLD]'
2018-09-22 18:41:20 +02:00
local discord_admin_tag = '[DISCORD-ADMIN]'
local discord_admin_raw_tag = '[DISCORD-ADMIN-RAW]'
local discord_embed_tag = '[DISCORD-EMBED]'
local discord_embed_raw_tag = '[DISCORD-EMBED-RAW]'
local discord_admin_embed_tag = '[DISCORD-ADMIN-EMBED]'
local discord_admin_embed_raw_tag = '[DISCORD-ADMIN-EMBED-RAW]'
2018-10-02 01:31:46 +02:00
local regular_promote_tag = '[REGULAR-PROMOTE]'
local regular_deomote_tag = '[REGULAR-DEOMOTE]'
2018-10-04 00:26:33 +02:00
local donator_set_tag = '[DONATOR-SET]'
2018-09-21 20:48:12 +02:00
2018-10-03 22:03:19 +02:00
Public.raw_print = raw_print
2018-09-21 20:48:12 +02:00
function Public.to_discord(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_tag .. message)
2018-09-21 20:48:12 +02:00
end
function Public.to_discord_raw(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_raw_tag .. message)
end
function Public.to_discord_bold(message)
raw_print(discord_bold_tag .. message)
2018-09-21 20:48:12 +02:00
end
function Public.to_admin(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_admin_tag .. message)
2018-09-21 20:48:12 +02:00
end
2018-09-22 18:41:20 +02:00
function Public.to_admin_raw(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_admin_raw_tag .. message)
2018-09-22 18:41:20 +02:00
end
2018-09-21 20:48:12 +02:00
function Public.to_discord_embed(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_embed_tag .. message)
2018-09-21 20:48:12 +02:00
end
2018-09-22 18:41:20 +02:00
function Public.to_discord_embed_raw(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_embed_raw_tag .. message)
2018-09-22 18:41:20 +02:00
end
function Public.to_admin_embed(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_admin_embed_tag .. message)
2018-09-22 18:41:20 +02:00
end
function Public.to_admin_embed_raw(message)
2018-10-03 22:03:19 +02:00
raw_print(discord_admin_embed_raw_tag .. message)
2018-09-22 18:41:20 +02:00
end
2018-10-02 01:31:46 +02:00
function Public.regular_promote(target, promotor)
2018-10-03 22:03:19 +02:00
local control_message = table.concat {regular_promote_tag, target, ' ', promotor}
local discord_message = table.concat {discord_bold_tag, promotor .. ' promoted ' .. target .. ' to regular.'}
raw_print(control_message)
raw_print(discord_message)
2018-10-02 01:31:46 +02:00
end
2018-10-03 22:03:19 +02:00
function Public.regular_deomote(target, demotor)
local discord_message = table.concat {discord_bold_tag, target, ' was demoted from regular by ', demotor, '.'}
raw_print(regular_deomote_tag .. target)
raw_print(discord_message)
2018-10-02 01:31:46 +02:00
end
2018-10-04 00:26:33 +02:00
function Public.donator_set(target, perks)
perks = perks or 'nil'
local message = table.concat {donator_set_tag, target, ' ', perks}
raw_print(message)
end
2018-09-21 20:48:12 +02:00
return Public