updated .vscode

This commit is contained in:
2023-04-08 13:45:41 +03:00
parent 6124f89cb0
commit d7a5cb5a64
4 changed files with 91 additions and 1 deletions

1
.gitignore vendored
View File

@@ -371,6 +371,5 @@ FodyWeavers.xsd
/DiscordBot.rar /DiscordBot.rar
/DiscordBot/Data/ /DiscordBot/Data/
/DiscordBot/Updater/ /DiscordBot/Updater/
.vscode/
.idea/ .idea/
/DiscordBotWeb/ /DiscordBotWeb/

42
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/DiscordBotPlugins/DiscordBotUI/bin/Debug/net7.0/DiscordBotUI.exe",
"args": [],
"cwd": "${workspaceFolder}/DiscordBotPlugins/DiscordBotUI/bin/Debug/net7.0",
"stopAtEntry": false,
"console": "externalTerminal",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/DiscordBot/bin/Debug/net6.0/DiscordBot.exe",
"args": [],
"cwd": "${workspaceFolder}/DiscordBot/bin/Debug/net6.0",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "externalTerminal",
"stopAtEntry": false
}
]
}

41
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/DiscordBot/DiscordBot.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/DiscordBot/DiscordBot.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/DiscordBot/DiscordBot.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@@ -34,4 +34,12 @@ app.MapControllerRoute(
name: "default", name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"); pattern: "{controller=Home}/{action=Index}/{id?}");
app.Lifetime.ApplicationStopping.Register(async () =>
{
await Task.Run(() => {
PluginManager.Logger.Log("Stopping bot...");
PluginManager.Config.Data.Save();
PluginManager.Config.Plugins.Save();
});
});
app.Run(); app.Run();