Example #1
0
        public async Task ShutDown()
        {
            if (!config.OwnerIds.Contains(Context.User.Id))
            {
                await RespondAsync(":no_good::skin-tone-3: You don't have permission to run this command!");

                return;
            }

            events.Save();

            await RespondAsync("rip");

            await Context.Client.LogoutAsync();

            await Task.Delay(1000);

            Environment.Exit((int)ExitCodes.ExitCode.Success);
        }
Example #2
0
        // <Guild ID, <User ID, Time last used>>

        public static EventStorage Load()
        {
            if (File.Exists("events.json"))
            {
                var json = File.ReadAllText("events.json");
                return(JsonConvert.DeserializeObject <EventStorage>(json));
            }
            var events = new EventStorage();

            events.Save();

            return(events);
        }