예제 #1
0
        public async Task Delete()
        {
            var msg = await Context.Channel.SendMessageAsync($"{Emojis.Warn} Are you sure you want to delete your system? If so, reply to this message with your system's ID (`{Context.SenderSystem.Hid}`).\n**Note: this action is permanent.**");

            var reply = await Context.AwaitMessage(Context.Channel, Context.User, timeout : TimeSpan.FromMinutes(1));

            if (reply.Content != Context.SenderSystem.Hid)
            {
                throw new PKError($"System deletion cancelled. Note that you must reply with your system ID (`{Context.SenderSystem.Hid}`) *verbatim*.");
            }

            await Systems.Delete(Context.SenderSystem);

            await Context.Channel.SendMessageAsync($"{Emojis.Success} System deleted.");

            await ProxyCache.InvalidateResultsForSystem(Context.SenderSystem);
        }