-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSayCommand.cs
More file actions
29 lines (24 loc) · 1 KB
/
SayCommand.cs
File metadata and controls
29 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using BepInEx.Configuration;
using Nuclei.Enums;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace Nuclei.Features.Commands.DefaultCommands;
/// <summary>
/// Command to broadcast a message to all players, through the server account.
/// </summary>
public class SayCommand(ConfigFile config) : PermissionConfigurableCommand(config)
{
public override string Name { get; } = "say";
public override string Description { get; } = "Broadcast a message to all players, through the server account.";
public override string Usage { get; } = "say <message>";
public override bool Validate(Player player, string[] args)
{
return args.Length > 0;
}
public override bool Execute(Player player, string[] args)
{
var message = string.Join(" ", args);
ChatService.SendChatMessage($"{message}");
return true;
}
public override PermissionLevel DefaultPermissionLevel { get; } = PermissionLevel.Moderator;
}