public static void EnqueueNamedCommand(IRCMessage msg, [Group(1)] string name, [Group(2)] string command) { if (name.Trim().EqualsIgnoreCase("all")) { IRCConnection.SendMessage(@"@{0}, you can’t use “all” as a name for queued commands.", msg.UserNickName, !msg.IsWhisper, msg.UserNickName); return; } TwitchGame.Instance.CommandQueue.Add(new CommandQueueItem(msg.Duplicate(command), name.Trim())); TwitchGame.ModuleCameras?.SetNotes(); IRCConnection.SendMessage("@{0}, command queued.", msg.UserNickName, !msg.IsWhisper, msg.UserNickName); }
public static void EnqueueUnnamedCommand(IRCMessage msg, [Group(1)] string command) { var simplifiedCommand = command.Trim().ToLowerInvariant(); if (!UserAccess.HasAccess(msg.UserNickName, AccessLevel.Admin, true) && (simplifiedCommand.StartsWith("!q") || simplifiedCommand.StartsWith("!bomb"))) { IRCConnection.SendMessage("@{0}, you cannot queue that command.", msg.UserNickName, !msg.IsWhisper, msg.UserNickName); return; } TwitchGame.Instance.CommandQueue.Add(new CommandQueueItem(msg.Duplicate(command))); TwitchGame.ModuleCameras?.SetNotes(); IRCConnection.SendMessage("@{0}, command queued.", msg.UserNickName, !msg.IsWhisper, msg.UserNickName); TwitchGame.Instance.CallUpdate(false); }
public static void EnqueueUnnamedCommand(IRCMessage msg, [Group(1)] string command) { TwitchGame.Instance.CommandQueue.Add(new CommandQueueItem(msg.Duplicate(command))); TwitchGame.ModuleCameras?.SetNotes(); IRCConnection.SendMessage("@{0}, command queued.", msg.UserNickName, !msg.IsWhisper, msg.UserNickName); }