mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-17 21:08:08 +02:00
Add donator commands
This commit is contained in:
parent
3075b0c64d
commit
b090a736a8
@ -239,6 +239,10 @@ global.config = {
|
||||
admin_commands = {
|
||||
enabled = true
|
||||
},
|
||||
-- adds commands for donators
|
||||
donator_commands = {
|
||||
enabled = true
|
||||
},
|
||||
player_colors = {
|
||||
enabled = true
|
||||
},
|
||||
|
@ -50,6 +50,9 @@ end
|
||||
if config.redmew_commands.enabled then
|
||||
require 'features.redmew_commands'
|
||||
end
|
||||
if config.donator_commands.enabled then
|
||||
require 'features.donator_commands'
|
||||
end
|
||||
if config.market.enabled then
|
||||
require 'features.market'
|
||||
end
|
||||
|
26
features/donator_commands.lua
Normal file
26
features/donator_commands.lua
Normal file
@ -0,0 +1,26 @@
|
||||
-- Dependencies
|
||||
local Game = require 'utils.game'
|
||||
local Command = require 'utils.command'
|
||||
local Donator = require 'features.donator'
|
||||
local Color = require 'resources.color_presets'
|
||||
|
||||
-- Local functions
|
||||
|
||||
--- Saves the player's message to the server
|
||||
local function set_donator_message(args, player)
|
||||
Donator.change_donator_data(player.name, {welcome_messages = args.message})
|
||||
Game.player_print('Welcome message updated.', Color.green)
|
||||
end
|
||||
|
||||
-- Commands
|
||||
|
||||
Command.add(
|
||||
'donator-join-message',
|
||||
{
|
||||
description = 'Changes your on-join message',
|
||||
arguments = {'message'},
|
||||
capture_excess_arguments = true,
|
||||
donator_only = true
|
||||
},
|
||||
set_donator_message
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user