コード例 #1
0
ファイル: Standard.cs プロジェクト: Googie2149/MinitoriCore
        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);
        }
コード例 #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);
        }