public PerspectiveSetup GetSetup() { var setupDoc = Database.Load <PerspectiveSetup>(PerspectiveSetup.DocumentName()); if (setupDoc == null) { setupDoc = new PerspectiveSetup(); Database.Store(setupDoc, PerspectiveSetup.DocumentName()); } return(setupDoc); }
//private Dictionary<ulong, ModerationConfig> ModerationConfigs { get; } public ModerationService(IDatabase database, DiscordShardedClient client, LocalManagementService localManagementService) { Database = database; //ModerationConfigs = new Dictionary<ulong, ModerationConfig>(); var setupDoc = database.Load <PerspectiveSetup>(PerspectiveSetup.DocumentName()); if (setupDoc == null) { setupDoc = new PerspectiveSetup(); database.Store(setupDoc, PerspectiveSetup.DocumentName()); } Perspective = setupDoc.PerspectiveToken != null ? new Perspective.Api(setupDoc.PerspectiveToken) : null; Client = client; LocalManagementService = localManagementService; Client.MessageReceived += MessageReceived; Client.UserJoined += UserJoined; //Client.GuildMemberUpdated += MemberUpdated; }
public void SetPerspectiveSetup(PerspectiveSetup doc) { Database.Store(doc, PerspectiveSetup.DocumentName()); }