Exemplo n.º 1
0
        public PerspectiveSetup GetSetup()
        {
            var setupDoc = Database.Load <PerspectiveSetup>(PerspectiveSetup.DocumentName());

            if (setupDoc == null)
            {
                setupDoc = new PerspectiveSetup();
                Database.Store(setupDoc, PerspectiveSetup.DocumentName());
            }

            return(setupDoc);
        }
Exemplo n.º 2
0
        //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;
        }
Exemplo n.º 3
0
 public void SetPerspectiveSetup(PerspectiveSetup doc)
 {
     Database.Store(doc, PerspectiveSetup.DocumentName());
 }