<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Types;

namespace DwellerBot.Commands
{
    class ShutdownCommand: CommandBase
    {
        private DwellerBot _dwellerBot;

        public ShutdownCommand(Api bot, DwellerBot dwellerBot):base(bot)
        {
            _dwellerBot = dwellerBot;
        }

        public override async Task ExecuteAsync(Update update, Dictionary<string, string> parsedMessage)
        {
            if (!DwellerBot.IsUserOwner(update.Message.From))
                return;

            _dwellerBot.Commands.FirstOrDefault(x => x.Key == "/savestate").Value?.ExecuteAsync(update, parsedMessage);
            _dwellerBot.IsOnline = false;

            await _bot.SendTextMessage(update.Message.Chat.Id, "Shutting down.", false, update.Message.MessageId);
        }
    }
}<commit_msg>Fixed continuous shutting down after restart<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Types;

namespace DwellerBot.Commands
{
    class ShutdownCommand: CommandBase
    {
        private DwellerBot _dwellerBot;

        public ShutdownCommand(Api bot, DwellerBot dwellerBot):base(bot)
        {
            _dwellerBot = dwellerBot;
        }

        public override async Task ExecuteAsync(Update update, Dictionary<string, string> parsedMessage)
        {
            if (!DwellerBot.IsUserOwner(update.Message.From))
                return;

            _dwellerBot.Commands.FirstOrDefault(x => x.Key == "/savestate").Value?.ExecuteAsync(update, parsedMessage);
            _dwellerBot.IsOnline = false;

            await _bot.SendTextMessage(update.Message.Chat.Id, "Shutting down.", false, update.Message.MessageId);
            await _bot.GetUpdates(update.Id + 1);
        }
    }
}
{'fraction_non_alphanumeric': 0.09606540623403168, 'fraction_numerical': 0.000510986203372509, 'mean_word_length': 2.884920634920635, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4653775', 'n_tokens_mistral': 568, 'n_tokens_neox': 559, 'n_words': 114}