using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CrimsonFAQ.Structs;
using CrimsonFAQ.Systems;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.Network;
using Unity.Collections;
using Unity.Entities;
using VAMP;
using VAMP.Attributes;
using VAMP.Models;
using VAMP.Services;
using VAMP.Utilities;
using VampireCommandFramework;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CrimsonFAQ")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("AutoResponder System")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.0+2.Branch.master.Sha.080e0d90c23cce0cba8223762dddc6ffb695f354.080e0d90c23cce0cba8223762dddc6ffb695f354")]
[assembly: AssemblyProduct("CrimsonFAQ")]
[assembly: AssemblyTitle("CrimsonFAQ")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace CrimsonFAQ
{
[BepInPlugin("CrimsonFAQ", "CrimsonFAQ", "2.1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
private Harmony _harmony;
internal static Plugin Instance { get; private set; }
public static Settings Settings { get; private set; }
public static Harmony Harmony => Instance._harmony;
public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log;
public static Database DB { get; internal set; }
public static string ConfigFiles => Path.Combine(Paths.ConfigPath, "CrimsonFAQ");
public override void Load()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
Instance = this;
Settings = default(Settings);
if (Settings.InitConfig())
{
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
CommandRegistry.RegisterAll();
DB = new Database();
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CrimsonFAQ");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("2.1.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
}
log.LogInfo(val);
}
}
public override bool Unload()
{
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
return true;
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "CrimsonFAQ";
public const string PLUGIN_NAME = "CrimsonFAQ";
public const string PLUGIN_VERSION = "2.1.0";
}
}
namespace CrimsonFAQ.Systems
{
public class Database
{
public static string ResponsesFile = Path.Combine(Plugin.ConfigFiles, "responses.json");
public static string TrustedFile = Path.Combine(Plugin.ConfigFiles, "trusted.json");
[FileReload("LoadResponses")]
public static List<KeyResponse> Responses { get; set; }
public static List<string> Trusted { get; set; }
public Database()
{
CreateDatabaseFiles();
LoadDatabase();
}
public static bool LoadDatabase()
{
try
{
LoadResponses();
LoadTrusted();
return true;
}
catch (Exception ex)
{
Responses = new List<KeyResponse>();
Trusted = new List<string>();
Plugin.LogInstance.LogError((object)ex);
return false;
}
}
private static void LoadResponses()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
try
{
Responses = JsonSerializer.Deserialize<List<KeyResponse>>(File.ReadAllText(ResponsesFile));
ManualLogSource logInstance = Plugin.LogInstance;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(36, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Loaded Responses Database: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(Responses.Count);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" entries.");
}
logInstance.LogInfo(val);
}
catch
{
Responses = new List<KeyResponse>();
Plugin.LogInstance.LogError((object)"Failed to load Responses Database. Edit your responses.json file to reload.");
}
}
private static void LoadTrusted()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
try
{
Trusted = JsonSerializer.Deserialize<List<string>>(File.ReadAllText(TrustedFile));
ManualLogSource logInstance = Plugin.LogInstance;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(34, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Loaded Trusted Database: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(Trusted.Count);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" entries.");
}
logInstance.LogInfo(val);
}
catch
{
Trusted = new List<string>();
Plugin.LogInstance.LogError((object)"Failed to load Trusted Database.");
}
}
public static void SaveDatabase()
{
string contents = JsonSerializer.Serialize(Trusted);
File.WriteAllText(TrustedFile, contents);
}
public static void CreateDatabaseFiles()
{
if (!File.Exists(ResponsesFile))
{
List<KeyResponse> list = new List<KeyResponse>();
KeyResponse item = new KeyResponse("discord", "Join our discord at discord.gg/RBPesMj", "discord link", isGlobal: true, 0, 30);
list.Add(item);
string contents = JsonSerializer.Serialize(list, new JsonSerializerOptions
{
WriteIndented = true
});
File.WriteAllText(ResponsesFile, contents);
}
if (!File.Exists(TrustedFile))
{
string contents2 = JsonSerializer.Serialize(new List<string>(), new JsonSerializerOptions
{
WriteIndented = true
});
File.WriteAllText(TrustedFile, contents2);
}
}
public static bool GetResponse(string key, out KeyResponse response)
{
response = null;
if (Responses.Exists((KeyResponse x) => string.Equals(x.Key, key, StringComparison.OrdinalIgnoreCase)))
{
response = Responses.Find((KeyResponse x) => string.Equals(x.Key, key, StringComparison.OrdinalIgnoreCase));
return true;
}
return false;
}
public static bool IsTrusted(User user, int keyLevel)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
if (keyLevel == 1 && (user.IsAdmin || Trusted.Contains(user.PlatformId.ToString())))
{
return true;
}
if (keyLevel == 2 && user.IsAdmin)
{
return true;
}
return false;
}
public static bool AddTrusted(User user)
{
if (Trusted.Contains(user.PlatformId.ToString()))
{
return false;
}
Trusted.Add(user.PlatformId.ToString());
SaveDatabase();
return true;
}
public static bool RemoveTrusted(User user)
{
if (!Trusted.Contains(user.PlatformId.ToString()))
{
return false;
}
Trusted.Remove(user.PlatformId.ToString());
SaveDatabase();
return true;
}
}
public static class Responder
{
public static void Respond(ChatMessageEvent message, User user, Entity chatEntity)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
if (!((FixedString512Bytes)(ref message.MessageText)).Value.StartsWith(Settings.Prefix.Value) || !Database.GetResponse(((FixedString512Bytes)(ref message.MessageText)).Value.TrimStart(Settings.Prefix.Value[0]), out var response))
{
return;
}
string message2 = $"<color={Settings.HexResponse.Value}>{response.Response}</color>";
EntityManager entityManager;
if (response.PermissionLevel > 0)
{
if (Database.IsTrusted(user, response.PermissionLevel))
{
SendSafeMessage(message2, sendToAll: true, user, chatEntity);
response.GlobalLastUsed = DateTime.Now;
}
}
else if (response.IsGlobal)
{
if ((DateTime.Now - response.GlobalLastUsed).TotalSeconds > (double)response.GlobalCooldownSeconds)
{
SendSafeMessage(message2, sendToAll: true, user, chatEntity);
response.GlobalLastUsed = DateTime.Now;
}
else
{
SendSafeMessage(message2, sendToAll: false, user, chatEntity);
entityManager = Core.EntityManager;
((EntityManager)(ref entityManager)).DestroyEntity(chatEntity);
}
}
else
{
SendSafeMessage(message2, sendToAll: false, user, chatEntity);
entityManager = Core.EntityManager;
((EntityManager)(ref entityManager)).DestroyEntity(chatEntity);
}
}
private static void SendSafeMessage(string message, bool sendToAll, User sender, Entity chatEntity)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
if (string.IsNullOrEmpty(message))
{
return;
}
if (Encoding.UTF8.GetByteCount(message) <= ChatUtil.MESSAGE_LIMIT)
{
if (sendToAll)
{
ChatUtil.SystemSendAll(message);
}
else
{
ChatUtil.SystemSendUser(sender, message);
}
return;
}
string[] array = SplitMessage(message);
foreach (string text in array)
{
if (sendToAll)
{
ChatUtil.SystemSendAll(text);
}
else
{
ChatUtil.SystemSendUser(sender, text);
}
}
}
private static string[] SplitMessage(string message)
{
List<string> list = new List<string>();
string text = message;
while (!string.IsNullOrEmpty(text))
{
if (Encoding.UTF8.GetByteCount(text) <= ChatUtil.MESSAGE_LIMIT)
{
list.Add(text);
break;
}
int num = FindSplitPoint(text, ChatUtil.MESSAGE_LIMIT);
string item = text.Substring(0, num);
list.Add(item);
text = text.Substring(num).TrimStart();
}
return list.ToArray();
}
private static int FindSplitPoint(string text, int maxBytes)
{
int num = maxBytes - 50;
int num2 = Math.Min(num, text.Length);
while (num2 > 0 && Encoding.UTF8.GetByteCount(text.Substring(0, num2)) > num)
{
num2--;
}
int num3 = num2;
while (num3 > num2 - 50 && num3 > 0)
{
char c = text[num3 - 1];
if (c == ' ' || c == '>' || c == '\n')
{
return num3;
}
num3--;
}
return Math.Max(1, num2);
}
}
}
namespace CrimsonFAQ.Structs
{
public class KeyResponse
{
[JsonPropertyName("Key")]
public string Key { get; set; }
[JsonPropertyName("Response")]
public string Response { get; set; }
[JsonPropertyName("Description")]
public string Description { get; set; }
[JsonPropertyName("IsGlobal")]
public bool IsGlobal { get; set; }
[JsonPropertyName("PermissionLevel")]
public int PermissionLevel { get; set; }
[JsonPropertyName("GlobalCooldownSeconds")]
public int GlobalCooldownSeconds { get; set; }
[JsonIgnore]
public DateTime GlobalLastUsed { get; set; }
public KeyResponse()
{
GlobalLastUsed = DateTime.MinValue;
}
[JsonConstructor]
public KeyResponse(string key, string response, string description, bool isGlobal = false, int permissionLevel = 0, int globalCooldownSeconds = 0)
{
Key = key;
Response = response;
Description = description;
IsGlobal = isGlobal;
PermissionLevel = permissionLevel;
GlobalCooldownSeconds = globalCooldownSeconds;
GlobalLastUsed = DateTime.MinValue;
}
}
[StructLayout(LayoutKind.Sequential, Size = 1)]
public readonly struct Settings
{
private static readonly List<string> directoryPaths = new List<string> { Plugin.ConfigFiles };
public static ConfigEntry<bool> FAQ { get; private set; }
public static ConfigEntry<string> Prefix { get; private set; }
public static ConfigEntry<string> HexKey { get; private set; }
public static ConfigEntry<string> HexDescription { get; private set; }
public static ConfigEntry<string> HexMisc { get; private set; }
public static ConfigEntry<string> HexResponse { get; private set; }
public static bool InitConfig()
{
foreach (string directoryPath in directoryPaths)
{
CreateDirectories(directoryPath);
}
FAQ = InitConfigEntry("_Config", "ToggleMod", defaultValue: true, "Enable or disable the mod.");
Prefix = InitConfigEntry("_Config", "Prefix", "?", "The prefix before information requests i.e. \"?discord\"");
HexKey = InitConfigEntry("Response Colors", "KeyColor", "#9cb730", "The hex value color that will be displayed for keys in .faq list");
HexDescription = InitConfigEntry("Response Colors", "DescriptionColor", "#309CB7", "The hex value color that will be displayed for descriptions in .faq list");
HexMisc = InitConfigEntry("Response Colors", "MiscColor", "#b7309c", "The hex value color that will be used for formatting elements like the dash in .faq list");
HexResponse = InitConfigEntry("Response Colors", "ResponseColor", "#9cb730", "The hex value color that will be used for responding to user key queries");
return FAQ.Value;
}
private static ConfigEntry<T> InitConfigEntry<T>(string section, string key, T defaultValue, string description)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
ConfigEntry<T> val = ((BasePlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, description);
string text = Path.Combine(Paths.ConfigPath, "CrimsonFAQ.cfg");
ConfigEntry<T> val2 = default(ConfigEntry<T>);
if (File.Exists(text) && new ConfigFile(text, true).TryGetEntry<T>(section, key, ref val2))
{
val.Value = val2.Value;
}
return val;
}
private static void CreateDirectories(string path)
{
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
}
}
}
namespace CrimsonFAQ.Hooks
{
[HarmonyPatch]
public static class ChatMessageSystem_Patch
{
[HarmonyPatch(typeof(ChatMessageSystem), "OnUpdate")]
[HarmonyPrefix]
public static bool OnUpdate(ChatMessageSystem __instance)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Invalid comparison between Unknown and I4
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
if (!Settings.FAQ.Value)
{
return true;
}
_ = __instance.__query_661171423_0;
EntityQuery _query_661171423_ = __instance.__query_661171423_0;
NativeArray<Entity> val = ((EntityQuery)(ref _query_661171423_)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
Enumerator<Entity> enumerator = val.GetEnumerator();
while (enumerator.MoveNext())
{
Entity current = enumerator.Current;
EntityManager entityManager = ((ComponentSystemBase)__instance).EntityManager;
FromCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<FromCharacter>(current);
entityManager = ((ComponentSystemBase)__instance).EntityManager;
User componentData2 = ((EntityManager)(ref entityManager)).GetComponentData<User>(componentData.User);
entityManager = ((ComponentSystemBase)__instance).EntityManager;
ChatMessageEvent componentData3 = ((EntityManager)(ref entityManager)).GetComponentData<ChatMessageEvent>(current);
if ((int)componentData3.MessageType != 5)
{
Responder.Respond(componentData3, componentData2, current);
}
}
val.Dispose();
return true;
}
}
}
namespace CrimsonFAQ.Commands
{
[CommandGroup("faq", null)]
internal class Basic
{
private const int MESSAGE_LIMIT = 460;
private const int MESSAGES_PER_PAGE = 2;
[Command("List", "l", null, "shows the list of FAQ requests that can be queried", null, false)]
public static void ListFAQs(ChatCommandContext ctx, int page = 1)
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
List<string> list = new List<string> { "\n" };
int num = 0;
if (Database.Responses.Count == 0)
{
list[0] += "There are no FAQs setup on the server.";
}
else
{
foreach (KeyResponse response in Database.Responses)
{
if (response.PermissionLevel <= 0 || Database.IsTrusted(ctx.User, response.PermissionLevel))
{
string value = ((!string.IsNullOrEmpty(response.Description)) ? $"<color={Settings.HexMisc.Value}>-</color> <color={Settings.HexDescription.Value}>{response.Description}</color>" : "");
string text = $"<color={Settings.HexKey.Value}>{Settings.Prefix.Value}{response.Key}</color> {value}\n";
if (list[num].Length + text.Length > 460)
{
num++;
list.Add(text);
}
else
{
list[num] += text;
}
}
}
}
int num2 = (int)Math.Ceiling((double)list.Count / 2.0);
if (page < 1 || page > num2)
{
page = 1;
}
int num3 = (page - 1) * 2;
int num4 = Math.Min(num3 + 2, list.Count);
if (num2 > 1)
{
ctx.Reply($"Page {page} of {num2}:");
}
for (int i = num3; i < num4; i++)
{
ctx.Reply(list[i]);
}
}
[Command("Trust", "t", null, "adds a player to the list of trusted users", null, true)]
public static void AddTrusted(ChatCommandContext ctx, string playerName = "")
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
if (string.IsNullOrEmpty(playerName))
{
ctx.Reply("Must input a player name.");
}
Player val = default(Player);
if (!PlayerService.TryFindByName(playerName, ref val))
{
ctx.Reply("Unable to find player named " + playerName);
return;
}
Entity user = val.User;
if (!((Entity)(ref user)).Equals(Entity.Null) && EntityUtil.Has<User>(val.User))
{
if (Database.AddTrusted(EntityUtil.Read<User>(val.User)))
{
ctx.Reply(playerName + " added to trusted FAQ users.");
}
else
{
ctx.Reply(playerName + " is already a trusted user.");
}
}
else
{
ctx.Reply("Unable to find player named " + playerName);
}
}
[Command("Untrust", "ut", null, "removes a player from the list of trusted users", null, true)]
public static void RemoveTrusted(ChatCommandContext ctx, string playerName = "")
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
if (string.IsNullOrEmpty(playerName))
{
ctx.Reply("Must input a player name.");
}
Player val = default(Player);
if (!PlayerService.TryFindByName(playerName, ref val))
{
ctx.Reply("Unable to find player named " + playerName);
return;
}
Entity user = val.User;
if (!((Entity)(ref user)).Equals(Entity.Null) && EntityUtil.Has<User>(val.User))
{
if (Database.RemoveTrusted(EntityUtil.Read<User>(val.User)))
{
ctx.Reply(playerName + " removed from trusted FAQ users.");
}
else
{
ctx.Reply(playerName + " is not in the trusted list");
}
}
else
{
ctx.Reply("Unable to find player named " + playerName);
}
}
}
}