예제 #1
0
        /// <summary>
        /// Saves all settings to appdata/locallow/Ciridium Wing Bot/Settings.json
        /// </summary>
        internal static async Task SaveSettings()
        {
            JSONObject json = new JSONObject();

            json.AddField(JSON_BOTTOKEN, token);
            JSONObject adminIDs = new JSONObject();

            foreach (var adminID in botAdminIDs)
            {
                adminIDs.Add(adminID.ToString());
            }
            json.AddField(JSON_ADMINIDS, adminIDs);
            JSONObject debugSettings = new JSONObject();

            foreach (bool b in debugLogging)
            {
                debugSettings.Add(b);
            }
            json.AddField(JSON_ENABLEDEBUG, debugSettings);
            json.AddField(JSON_DEBUGCHANNEL, DebugMessageChannelId.ToString());
            json.AddField(JSON_WELCOMINGCHANNEL, WelcomeMessageChannelId.ToString());
            json.AddField(JSON_WELCOMINGMESSAGE, welcomingMessage);
            json.AddField(JSON_MODERATORROLE, ModeratorRole.ToString());
            json.AddField(JSON_PILOTROLE, EscortPilotRole.ToString());
            json.AddField(JSON_BOTDEVROLE, BotDevRole.ToString());
            json.AddField(JSON_DISPATCHROLE, DispatchRole.ToString());
            json.AddField(JSON_INARA_APIKEY, Inara_APIkey);
            json.AddField(JSON_PREFIX, CommandService.Prefix);


            await ResourcesModel.WriteJSONObjectToFile(ResourcesModel.SettingsFilePath, json);
        }
예제 #2
0
        public static async Task SaveMissions()
        {
            JSONObject json = new JSONObject();

            foreach (ulong mission in missionList)
            {
                json.Add(mission.ToString());
            }
            await ResourcesModel.WriteJSONObjectToFile(ResourcesModel.MissionsFilePath, json);
        }
        public static async Task SaveMissionSettings()
        {
            JSONObject json = new JSONObject();

            json.AddField(JSON_MISSIONNUMBER, lastMissionNumber);
            json.AddField(JSON_MISSIONCATEGORYID, MissionCategoryId.ToString());
            json.AddField(JSON_DEFAULTTOPIC, DefaultTopic);
            json.AddField(JSON_EXPLORERQUESTIONS, ExplorerQuestions);
            json.AddField(JSON_TESTIMONIALPROMPT, TestimonialPrompt);
            json.AddField(JSON_FILEREPORTPROMPT, FileReportPrompt);
            await ResourcesModel.WriteJSONObjectToFile(ResourcesModel.MissionSettingsFilePath, json);
        }