diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 2fc441b..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // 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/net5.0/DiscordBot.dll", - "args": [], - "cwd": "${workspaceFolder}/DiscordBot", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6705416 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "rpc.enabled": true, + "discord.enabled": true +} \ No newline at end of file diff --git a/.vscode/solution-explorer/class.cs-template b/.vscode/solution-explorer/class.cs-template deleted file mode 100644 index 20c7109..0000000 --- a/.vscode/solution-explorer/class.cs-template +++ /dev/null @@ -1,5 +0,0 @@ -namespace {{namespace}}; - -public class {{name}} -{ -} diff --git a/.vscode/solution-explorer/class.ts-template b/.vscode/solution-explorer/class.ts-template deleted file mode 100644 index ff2edef..0000000 --- a/.vscode/solution-explorer/class.ts-template +++ /dev/null @@ -1,3 +0,0 @@ -export class {{name}} { - -} \ No newline at end of file diff --git a/.vscode/solution-explorer/class.vb-template b/.vscode/solution-explorer/class.vb-template deleted file mode 100644 index 38ef67f..0000000 --- a/.vscode/solution-explorer/class.vb-template +++ /dev/null @@ -1,9 +0,0 @@ -Imports System - -Namespace {{namespace}} - - Public Class {{name}} - - End Class - -End Namespace diff --git a/.vscode/solution-explorer/default.ts-template b/.vscode/solution-explorer/default.ts-template deleted file mode 100644 index 04af870..0000000 --- a/.vscode/solution-explorer/default.ts-template +++ /dev/null @@ -1,3 +0,0 @@ -export default {{name}} { - -} \ No newline at end of file diff --git a/.vscode/solution-explorer/enum.cs-template b/.vscode/solution-explorer/enum.cs-template deleted file mode 100644 index 1ded8c0..0000000 --- a/.vscode/solution-explorer/enum.cs-template +++ /dev/null @@ -1,5 +0,0 @@ -namespace {{namespace}}; - -public enum {{name}} -{ -} diff --git a/.vscode/solution-explorer/interface.cs-template b/.vscode/solution-explorer/interface.cs-template deleted file mode 100644 index bf25cbb..0000000 --- a/.vscode/solution-explorer/interface.cs-template +++ /dev/null @@ -1,5 +0,0 @@ -namespace {{namespace}}; - -public interface {{name}} -{ -} diff --git a/.vscode/solution-explorer/interface.ts-template b/.vscode/solution-explorer/interface.ts-template deleted file mode 100644 index 3ea404b..0000000 --- a/.vscode/solution-explorer/interface.ts-template +++ /dev/null @@ -1,3 +0,0 @@ -export interface {{name}} { - -} \ No newline at end of file diff --git a/.vscode/solution-explorer/template-list.json b/.vscode/solution-explorer/template-list.json deleted file mode 100644 index 2849622..0000000 --- a/.vscode/solution-explorer/template-list.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "templates": [ - { - "name": "Class", - "extension": "cs", - "file": "./class.cs-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Interface", - "extension": "cs", - "file": "./interface.cs-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Enum", - "extension": "cs", - "file": "./enum.cs-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Class", - "extension": "ts", - "file": "./class.ts-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Interface", - "extension": "ts", - "file": "./interface.ts-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Default", - "extension": "ts", - "file": "./default.ts-template", - "parameters": "./template-parameters.js" - }, - { - "name": "Class", - "extension": "vb", - "file": "./class.vb-template", - "parameters": "./template-parameters.js" - } - ] -} \ No newline at end of file diff --git a/.vscode/solution-explorer/template-parameters.js b/.vscode/solution-explorer/template-parameters.js deleted file mode 100644 index daba8b2..0000000 --- a/.vscode/solution-explorer/template-parameters.js +++ /dev/null @@ -1,17 +0,0 @@ -var path = require("path"); - -module.exports = function(filename, projectPath, folderPath) { - var namespace = "Unknown"; - if (projectPath) { - namespace = path.basename(projectPath, path.extname(projectPath)); - if (folderPath) { - namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, "."); - } - namespace = namespace.replace(/[\\\-]/g, "_"); - } - - return { - namespace: namespace, - name: path.basename(filename, path.extname(filename)) - } -}; \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index adf4d42..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "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", - "${workspaceFolder}/DiscordBot/DiscordBot.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/BUILDS/net6.0/CMD_Utils.deps.json b/BUILDS/net6.0/CMD_Utils.deps.json index f5694d6..4ac17c3 100644 --- a/BUILDS/net6.0/CMD_Utils.deps.json +++ b/BUILDS/net6.0/CMD_Utils.deps.json @@ -14,28 +14,28 @@ "CMD_Utils.dll": {} } }, - "Discord.Net/3.6.1": { + "Discord.Net/3.7.2": { "dependencies": { - "Discord.Net.Commands": "3.6.1", - "Discord.Net.Core": "3.6.1", - "Discord.Net.Interactions": "3.6.1", - "Discord.Net.Rest": "3.6.1", - "Discord.Net.WebSocket": "3.6.1", - "Discord.Net.Webhook": "3.6.1" + "Discord.Net.Commands": "3.7.2", + "Discord.Net.Core": "3.7.2", + "Discord.Net.Interactions": "3.7.2", + "Discord.Net.Rest": "3.7.2", + "Discord.Net.WebSocket": "3.7.2", + "Discord.Net.Webhook": "3.7.2" } }, - "Discord.Net.Commands/3.6.1": { + "Discord.Net.Commands/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1" + "Discord.Net.Core": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Commands.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Core/3.6.1": { + "Discord.Net.Core/3.7.2": { "dependencies": { "Newtonsoft.Json": "13.0.1", "System.Collections.Immutable": "5.0.0", @@ -44,59 +44,59 @@ }, "runtime": { "lib/net6.0/Discord.Net.Core.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Interactions/3.6.1": { + "Discord.Net.Interactions/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1", - "Discord.Net.WebSocket": "3.6.1", + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2", + "Discord.Net.WebSocket": "3.7.2", "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0", "System.Collections.Immutable": "5.0.0", "System.Reactive": "5.0.0" }, "runtime": { "lib/net6.0/Discord.Net.Interactions.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Rest/3.6.1": { + "Discord.Net.Rest/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1" + "Discord.Net.Core": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Rest.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Webhook/3.6.1": { + "Discord.Net.Webhook/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1" + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Webhook.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.WebSocket/3.6.1": { + "Discord.Net.WebSocket/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1" + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.WebSocket.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, @@ -147,7 +147,7 @@ "System.ValueTuple/4.5.0": {}, "PluginManager/1.0.0": { "dependencies": { - "Discord.Net": "3.6.1" + "Discord.Net": "3.7.2" }, "runtime": { "PluginManager.dll": {} @@ -161,54 +161,54 @@ "serviceable": false, "sha512": "" }, - "Discord.Net/3.6.1": { + "Discord.Net/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-TfcL/HG57fVt//WVJ2XyF2PlytY9IYkkwwkPLIhvu5FW4wf9rm7+N8RPh4qtELLfsa5ES0FK2RbgYjABRR9AjA==", - "path": "discord.net/3.6.1", - "hashPath": "discord.net.3.6.1.nupkg.sha512" + "sha512": "sha512-FAiCLGu5rp6+Z10FjKbbJ6LLpKjbMBGpozixkJlz5LZvuncPx8f4AWFAw7pBecKUuAh983qiZ8CZYZcNXsI4qg==", + "path": "discord.net/3.7.2", + "hashPath": "discord.net.3.7.2.nupkg.sha512" }, - "Discord.Net.Commands/3.6.1": { + "Discord.Net.Commands/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-kK7m571yzSzPd93o+n8Z+TfvX62BT1HtOEZIWXKwXWO8itP/sgqBNExjWK/6DOpkbD6+khc2f3rp+TA0rJD88g==", - "path": "discord.net.commands/3.6.1", - "hashPath": "discord.net.commands.3.6.1.nupkg.sha512" + "sha512": "sha512-aOEGP04X64htsTr7ozKj9qHpmvOfitSw5gfR8Tw9TX0+FdswD2LNL2KfOAIaxRKZmRTm34aXQEJrVq0K8AptmQ==", + "path": "discord.net.commands/3.7.2", + "hashPath": "discord.net.commands.3.7.2.nupkg.sha512" }, - "Discord.Net.Core/3.6.1": { + "Discord.Net.Core/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-ibVjQiWzgqh0GyP/GXE2kv3TA/9ysmmNFG/WmRE7GepQQAXXGxVUO9IMJ8h14EvIXMQ0m0DktMe5DkUnilo3Ag==", - "path": "discord.net.core/3.6.1", - "hashPath": "discord.net.core.3.6.1.nupkg.sha512" + "sha512": "sha512-apwswc6LjN4dj3u27SO3Hr56Jzl91wzReahieoD7IQhV+BJQaRxhTRiEEWFTrBzHfeFHEOQ7r6vZnra3zeFhKA==", + "path": "discord.net.core/3.7.2", + "hashPath": "discord.net.core.3.7.2.nupkg.sha512" }, - "Discord.Net.Interactions/3.6.1": { + "Discord.Net.Interactions/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-WGOxz6SMUu4WS5b/JdrhlwQletcplBIYqvjFBBDfnqE+uNJqcNGtAdyjLqIILfXGx8aSSSSYZSCeAUa7FZ8Yew==", - "path": "discord.net.interactions/3.6.1", - "hashPath": "discord.net.interactions.3.6.1.nupkg.sha512" + "sha512": "sha512-dwGhEdDB0yyo/lGtjwIDVZmsuD52di7lIZWu/sBtvvA05dMgYZq5S6ILdsBXjOyaHeXd+EV4YMlj2VS/rm619w==", + "path": "discord.net.interactions/3.7.2", + "hashPath": "discord.net.interactions.3.7.2.nupkg.sha512" }, - "Discord.Net.Rest/3.6.1": { + "Discord.Net.Rest/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-T7RRThIS23roFEJwTL1l7aawjVyn7ZB5yH3tMge0d6TiCzzp4V4FAZ+ArTt19LHRFhPly90v8V3sWqmTMN+5Zg==", - "path": "discord.net.rest/3.6.1", - "hashPath": "discord.net.rest.3.6.1.nupkg.sha512" + "sha512": "sha512-dyp8YaMBNJ837EH1KNz2PNGZqc2y71WFd1+pdldF+pLQJ3Gf/+V7685paAR7bQw7yFNyqEBR/QRBCNp+QIQ7Wg==", + "path": "discord.net.rest/3.7.2", + "hashPath": "discord.net.rest.3.7.2.nupkg.sha512" }, - "Discord.Net.Webhook/3.6.1": { + "Discord.Net.Webhook/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-xikKHIGAIMz0BzHkaTKb48DNpFjKW8mvJjLJSezJ1xQOu+laHNk/hav4qxVtyZz7HSI/vGTkmlq9hKVhWzpaUA==", - "path": "discord.net.webhook/3.6.1", - "hashPath": "discord.net.webhook.3.6.1.nupkg.sha512" + "sha512": "sha512-da3i/mTq2y7mfj3xlHH14S4PivHbflJCVr8OUikJtQrxBOxvPkqP7ZYk3Y9S28q0K8qik+TUjCcjL5gELKrh/A==", + "path": "discord.net.webhook/3.7.2", + "hashPath": "discord.net.webhook.3.7.2.nupkg.sha512" }, - "Discord.Net.WebSocket/3.6.1": { + "Discord.Net.WebSocket/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-hF22Xy7URlVEDQZ69INOgzPvFUsIDfd+r6U+1yF9HWdBn3d4THnvAAhkv1TraSx/T/MKS7g+jvk/HZ3mh5S3aw==", - "path": "discord.net.websocket/3.6.1", - "hashPath": "discord.net.websocket.3.6.1.nupkg.sha512" + "sha512": "sha512-pYCd6ET44ADaNiyEw82TaJnR7TKYHfrKCytWFWMPL5faJhoh260avZn3Hwunlf331lEQ0f4K1CujPkQbNuq7kQ==", + "path": "discord.net.websocket/3.7.2", + "hashPath": "discord.net.websocket.3.7.2.nupkg.sha512" }, "Microsoft.Extensions.DependencyInjection.Abstractions/5.0.0": { "type": "package", diff --git a/BUILDS/net6.0/CMD_Utils.dll b/BUILDS/net6.0/CMD_Utils.dll index ca84625..d30bcd7 100644 Binary files a/BUILDS/net6.0/CMD_Utils.dll and b/BUILDS/net6.0/CMD_Utils.dll differ diff --git a/BUILDS/net6.0/MusicCommands.deps.json b/BUILDS/net6.0/MusicCommands.deps.json index d7cba47..bf027a3 100644 --- a/BUILDS/net6.0/MusicCommands.deps.json +++ b/BUILDS/net6.0/MusicCommands.deps.json @@ -14,28 +14,28 @@ "MusicCommands.dll": {} } }, - "Discord.Net/3.6.1": { + "Discord.Net/3.7.2": { "dependencies": { - "Discord.Net.Commands": "3.6.1", - "Discord.Net.Core": "3.6.1", - "Discord.Net.Interactions": "3.6.1", - "Discord.Net.Rest": "3.6.1", - "Discord.Net.WebSocket": "3.6.1", - "Discord.Net.Webhook": "3.6.1" + "Discord.Net.Commands": "3.7.2", + "Discord.Net.Core": "3.7.2", + "Discord.Net.Interactions": "3.7.2", + "Discord.Net.Rest": "3.7.2", + "Discord.Net.WebSocket": "3.7.2", + "Discord.Net.Webhook": "3.7.2" } }, - "Discord.Net.Commands/3.6.1": { + "Discord.Net.Commands/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1" + "Discord.Net.Core": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Commands.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Core/3.6.1": { + "Discord.Net.Core/3.7.2": { "dependencies": { "Newtonsoft.Json": "13.0.1", "System.Collections.Immutable": "5.0.0", @@ -44,59 +44,59 @@ }, "runtime": { "lib/net6.0/Discord.Net.Core.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Interactions/3.6.1": { + "Discord.Net.Interactions/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1", - "Discord.Net.WebSocket": "3.6.1", + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2", + "Discord.Net.WebSocket": "3.7.2", "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0", "System.Collections.Immutable": "5.0.0", "System.Reactive": "5.0.0" }, "runtime": { "lib/net6.0/Discord.Net.Interactions.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Rest/3.6.1": { + "Discord.Net.Rest/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1" + "Discord.Net.Core": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Rest.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.Webhook/3.6.1": { + "Discord.Net.Webhook/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1" + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.Webhook.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, - "Discord.Net.WebSocket/3.6.1": { + "Discord.Net.WebSocket/3.7.2": { "dependencies": { - "Discord.Net.Core": "3.6.1", - "Discord.Net.Rest": "3.6.1" + "Discord.Net.Core": "3.7.2", + "Discord.Net.Rest": "3.7.2" }, "runtime": { "lib/net6.0/Discord.Net.WebSocket.dll": { - "assemblyVersion": "3.6.1.0", - "fileVersion": "3.6.1.0" + "assemblyVersion": "3.7.2.0", + "fileVersion": "3.7.2.0" } } }, @@ -147,7 +147,7 @@ "System.ValueTuple/4.5.0": {}, "PluginManager/1.0.0": { "dependencies": { - "Discord.Net": "3.6.1" + "Discord.Net": "3.7.2" }, "runtime": { "PluginManager.dll": {} @@ -161,54 +161,54 @@ "serviceable": false, "sha512": "" }, - "Discord.Net/3.6.1": { + "Discord.Net/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-TfcL/HG57fVt//WVJ2XyF2PlytY9IYkkwwkPLIhvu5FW4wf9rm7+N8RPh4qtELLfsa5ES0FK2RbgYjABRR9AjA==", - "path": "discord.net/3.6.1", - "hashPath": "discord.net.3.6.1.nupkg.sha512" + "sha512": "sha512-FAiCLGu5rp6+Z10FjKbbJ6LLpKjbMBGpozixkJlz5LZvuncPx8f4AWFAw7pBecKUuAh983qiZ8CZYZcNXsI4qg==", + "path": "discord.net/3.7.2", + "hashPath": "discord.net.3.7.2.nupkg.sha512" }, - "Discord.Net.Commands/3.6.1": { + "Discord.Net.Commands/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-kK7m571yzSzPd93o+n8Z+TfvX62BT1HtOEZIWXKwXWO8itP/sgqBNExjWK/6DOpkbD6+khc2f3rp+TA0rJD88g==", - "path": "discord.net.commands/3.6.1", - "hashPath": "discord.net.commands.3.6.1.nupkg.sha512" + "sha512": "sha512-aOEGP04X64htsTr7ozKj9qHpmvOfitSw5gfR8Tw9TX0+FdswD2LNL2KfOAIaxRKZmRTm34aXQEJrVq0K8AptmQ==", + "path": "discord.net.commands/3.7.2", + "hashPath": "discord.net.commands.3.7.2.nupkg.sha512" }, - "Discord.Net.Core/3.6.1": { + "Discord.Net.Core/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-ibVjQiWzgqh0GyP/GXE2kv3TA/9ysmmNFG/WmRE7GepQQAXXGxVUO9IMJ8h14EvIXMQ0m0DktMe5DkUnilo3Ag==", - "path": "discord.net.core/3.6.1", - "hashPath": "discord.net.core.3.6.1.nupkg.sha512" + "sha512": "sha512-apwswc6LjN4dj3u27SO3Hr56Jzl91wzReahieoD7IQhV+BJQaRxhTRiEEWFTrBzHfeFHEOQ7r6vZnra3zeFhKA==", + "path": "discord.net.core/3.7.2", + "hashPath": "discord.net.core.3.7.2.nupkg.sha512" }, - "Discord.Net.Interactions/3.6.1": { + "Discord.Net.Interactions/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-WGOxz6SMUu4WS5b/JdrhlwQletcplBIYqvjFBBDfnqE+uNJqcNGtAdyjLqIILfXGx8aSSSSYZSCeAUa7FZ8Yew==", - "path": "discord.net.interactions/3.6.1", - "hashPath": "discord.net.interactions.3.6.1.nupkg.sha512" + "sha512": "sha512-dwGhEdDB0yyo/lGtjwIDVZmsuD52di7lIZWu/sBtvvA05dMgYZq5S6ILdsBXjOyaHeXd+EV4YMlj2VS/rm619w==", + "path": "discord.net.interactions/3.7.2", + "hashPath": "discord.net.interactions.3.7.2.nupkg.sha512" }, - "Discord.Net.Rest/3.6.1": { + "Discord.Net.Rest/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-T7RRThIS23roFEJwTL1l7aawjVyn7ZB5yH3tMge0d6TiCzzp4V4FAZ+ArTt19LHRFhPly90v8V3sWqmTMN+5Zg==", - "path": "discord.net.rest/3.6.1", - "hashPath": "discord.net.rest.3.6.1.nupkg.sha512" + "sha512": "sha512-dyp8YaMBNJ837EH1KNz2PNGZqc2y71WFd1+pdldF+pLQJ3Gf/+V7685paAR7bQw7yFNyqEBR/QRBCNp+QIQ7Wg==", + "path": "discord.net.rest/3.7.2", + "hashPath": "discord.net.rest.3.7.2.nupkg.sha512" }, - "Discord.Net.Webhook/3.6.1": { + "Discord.Net.Webhook/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-xikKHIGAIMz0BzHkaTKb48DNpFjKW8mvJjLJSezJ1xQOu+laHNk/hav4qxVtyZz7HSI/vGTkmlq9hKVhWzpaUA==", - "path": "discord.net.webhook/3.6.1", - "hashPath": "discord.net.webhook.3.6.1.nupkg.sha512" + "sha512": "sha512-da3i/mTq2y7mfj3xlHH14S4PivHbflJCVr8OUikJtQrxBOxvPkqP7ZYk3Y9S28q0K8qik+TUjCcjL5gELKrh/A==", + "path": "discord.net.webhook/3.7.2", + "hashPath": "discord.net.webhook.3.7.2.nupkg.sha512" }, - "Discord.Net.WebSocket/3.6.1": { + "Discord.Net.WebSocket/3.7.2": { "type": "package", "serviceable": true, - "sha512": "sha512-hF22Xy7URlVEDQZ69INOgzPvFUsIDfd+r6U+1yF9HWdBn3d4THnvAAhkv1TraSx/T/MKS7g+jvk/HZ3mh5S3aw==", - "path": "discord.net.websocket/3.6.1", - "hashPath": "discord.net.websocket.3.6.1.nupkg.sha512" + "sha512": "sha512-pYCd6ET44ADaNiyEw82TaJnR7TKYHfrKCytWFWMPL5faJhoh260avZn3Hwunlf331lEQ0f4K1CujPkQbNuq7kQ==", + "path": "discord.net.websocket/3.7.2", + "hashPath": "discord.net.websocket.3.7.2.nupkg.sha512" }, "Microsoft.Extensions.DependencyInjection.Abstractions/5.0.0": { "type": "package", diff --git a/BUILDS/net6.0/MusicCommands.dll b/BUILDS/net6.0/MusicCommands.dll index dac55eb..19a1e1a 100644 Binary files a/BUILDS/net6.0/MusicCommands.dll and b/BUILDS/net6.0/MusicCommands.dll differ diff --git a/BUILDS/net6.0/PluginManager.dll b/BUILDS/net6.0/PluginManager.dll index 6be9c72..bb6f20f 100644 Binary files a/BUILDS/net6.0/PluginManager.dll and b/BUILDS/net6.0/PluginManager.dll differ diff --git a/BUILDS/net6.0/Plugins/Commands/CMD_LevelingSystem.dll b/BUILDS/net6.0/Plugins/Commands/CMD_LevelingSystem.dll new file mode 100644 index 0000000..c1c7ecf Binary files /dev/null and b/BUILDS/net6.0/Plugins/Commands/CMD_LevelingSystem.dll differ diff --git a/BUILDS/net6.0/Plugins/Commands/CMD_Utils.dll b/BUILDS/net6.0/Plugins/Commands/CMD_Utils.dll new file mode 100644 index 0000000..d30bcd7 Binary files /dev/null and b/BUILDS/net6.0/Plugins/Commands/CMD_Utils.dll differ diff --git a/BUILDS/net6.0/Plugins/Commands/MusicCommands.dll b/BUILDS/net6.0/Plugins/Commands/MusicCommands.dll new file mode 100644 index 0000000..b690a8c Binary files /dev/null and b/BUILDS/net6.0/Plugins/Commands/MusicCommands.dll differ diff --git a/BUILDS/net6.0/Plugins/Events/EVE_LevelingSystem.dll b/BUILDS/net6.0/Plugins/Events/EVE_LevelingSystem.dll new file mode 100644 index 0000000..efc3f15 Binary files /dev/null and b/BUILDS/net6.0/Plugins/Events/EVE_LevelingSystem.dll differ diff --git a/CMD_Utils/CMD_Utils.csproj b/CMD_Utils/CMD_Utils.csproj index 9d3154b..40c79f6 100644 --- a/CMD_Utils/CMD_Utils.csproj +++ b/CMD_Utils/CMD_Utils.csproj @@ -2,6 +2,7 @@ net6.0 + diff --git a/CMD_Utils/Random.cs b/CMD_Utils/Random.cs index 2cbc564..7a93e0d 100644 --- a/CMD_Utils/Random.cs +++ b/CMD_Utils/Random.cs @@ -24,9 +24,9 @@ public class Random : DBCommand if (a > b) { - var x = a; - a = b; - b = x; + var temp = a; + a = b; + b = temp; } await message.Channel.SendMessageAsync("Your random generated number is " + new System.Random().Next(a, b)); diff --git a/DiscordBot/Discord/Core/CommandHandler.cs b/DiscordBot/Discord/Core/CommandHandler.cs index b876858..3a87dbc 100644 --- a/DiscordBot/Discord/Core/CommandHandler.cs +++ b/DiscordBot/Discord/Core/CommandHandler.cs @@ -121,7 +121,6 @@ internal class CommandHandler plugin.Execute(context, message, client, false); Functions.WriteLogFile($"[{message.Author.Id}] Executed command : " + plugin.Command); - return; } } } diff --git a/DiscordBot/DiscordBot.csproj b/DiscordBot/DiscordBot.csproj index f83d305..da11f94 100644 --- a/DiscordBot/DiscordBot.csproj +++ b/DiscordBot/DiscordBot.csproj @@ -8,6 +8,7 @@ False True + 1.0.0.1 @@ -37,7 +38,7 @@ - + diff --git a/DiscordBot/Program.cs b/DiscordBot/Program.cs index 7a9f374..c78d07d 100644 --- a/DiscordBot/Program.cs +++ b/DiscordBot/Program.cs @@ -1,264 +1,312 @@ -using DiscordBot.Discord.Core; -using PluginManager; -using PluginManager.Items; -using PluginManager.Others; -using System; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using DiscordBot.Discord.Core; +using PluginManager; +using PluginManager.Items; using PluginManager.Online; +using PluginManager.Others; -namespace DiscordBot +namespace DiscordBot; + +public class Program { - public class Program + private static bool loadPluginsOnStartup; + private static bool listPluginsAtStartup; + + /// + /// The main entry point for the application. + /// + [STAThread] + [Obsolete] + public static void Main(string[] args) { - private static bool loadPluginsOnStartup = false; - private static bool listPluginsAtStartup = false; + Directory.CreateDirectory("./Data/Resources"); + Directory.CreateDirectory("./Data/Plugins/Commands"); + Directory.CreateDirectory("./Data/Plugins/Events"); + PreLoadComponents().Wait(); - /// - /// The main entry point for the application. - /// - [STAThread] - [Obsolete] - public static void Main(string[] args) + if (!Config.ContainsKey("token") || Config.GetValue("token") == null || Config.GetValue("token")?.Length != 70) { - Directory.CreateDirectory("./Data/Resources"); - Directory.CreateDirectory("./Data/Plugins/Commands"); - Directory.CreateDirectory("./Data/Plugins/Events"); - PreLoadComponents().Wait(); + Console.WriteLine("Please insert your token"); + Console.Write("Token = "); + var token = Console.ReadLine(); + if (token?.Length == 59 || token?.Length == 70) + Config.AddValueToVariables("token", token, true); + else + Console.WriteLine("Invalid token"); - if (!Config.ContainsKey("token") || Config.GetValue("token") == null || Config.GetValue("token")?.Length != 70) - { - while (true) - { - Console.WriteLine("Please insert your token"); - Console.Write("Token = "); - string token = Console.ReadLine(); - if (token?.Length == 59 || token?.Length == 70) - Config.AddValueToVariables("token", token, true); - else - { - Console.WriteLine("Invalid token"); - continue; - } + Console.WriteLine("Please insert your prefix (max. 1 character long):"); + Console.WriteLine("For a prefix longer then one character, the first character will be saved and the others will be ignored.\n No spaces or numbers allowed"); + Console.Write("Prefix = "); + var prefix = Console.ReadLine()![0]; - Console.WriteLine("Please insert your prefix (max. 1 character long):"); - Console.WriteLine("For a prefix longer then one character, the first character will be saved and the others will be ignored.\n No spaces or numbers allowed"); - Console.Write("Prefix = "); - char prefix = Console.ReadLine()![0]; - - if (prefix == ' ' || char.IsDigit(prefix)) continue; - Config.AddValueToVariables("prefix", prefix.ToString(), false); - break; - } - } - - if (!Config.ContainsKey("prefix")) - { - Console.WriteLine("Please insert your prefix (max. 1 character long):"); - Console.WriteLine("For a prefix longer then one character, the first character will be saved and the others will be ignored.\n No spaces or numbers allowed"); - Console.Write("Prefix = "); - char prefix = Console.ReadLine()![0]; - - if (prefix == ' ' || char.IsDigit(prefix)) return; - Config.AddValueToVariables("prefix", prefix.ToString(), false); - } - - HandleInput(args).Wait(); + if (prefix == ' ' || char.IsDigit(prefix)) return; + Config.AddValueToVariables("prefix", prefix.ToString(), false); } - /// - /// The main loop for the discord bot - /// - /// The discord booter used to start the application - private static Task NoGUI(Boot discordbooter) + if (!Config.ContainsKey("prefix") || Config.GetValue("prefix") == default) { - ConsoleCommandsHandler consoleCommandsHandler = new ConsoleCommandsHandler(discordbooter.client); - if (loadPluginsOnStartup) consoleCommandsHandler.HandleCommand("lp"); - if (listPluginsAtStartup) consoleCommandsHandler.HandleCommand("listplugs"); - Config.SaveConfig(); - while (true) - { - Console.ForegroundColor = ConsoleColor.White; - string cmd = Console.ReadLine(); - consoleCommandsHandler.HandleCommand(cmd); - } + Console.WriteLine("Please insert your prefix (max. 1 character long):"); + Console.WriteLine("For a prefix longer then one character, the first character will be saved and the others will be ignored.\n No spaces or numbers allowed"); + Console.Write("Prefix = "); + var prefix = Console.ReadLine()![0]; + if (prefix == ' ') return; + Config.AddValueToVariables("prefix", prefix.ToString(), false); } - /// - /// Start the bot without user interface - /// - /// Returns the boot loader for the Discord Bot - private static async Task StartNoGUI() - { - Console.Clear(); - Console.ForegroundColor = ConsoleColor.DarkYellow; - Console.WriteLine("Discord BOT for Cross Platform"); - Console.WriteLine("Created by: Wizzy\nDiscord: Wizzy#9181"); + HandleInput(args).Wait(); + } + + /// + /// The main loop for the discord bot + /// + /// The discord booter used to start the application + private static Task NoGUI(Boot discordbooter) + { + var consoleCommandsHandler = new ConsoleCommandsHandler(discordbooter.client); + if (loadPluginsOnStartup) consoleCommandsHandler.HandleCommand("lp"); + if (listPluginsAtStartup) consoleCommandsHandler.HandleCommand("listplugs"); + + Config.SaveConfig(); + + + while (true) + { Console.ForegroundColor = ConsoleColor.White; - Console.WriteLine("============================ Discord BOT - Cross Platform ============================"); + var cmd = Console.ReadLine(); + if (!consoleCommandsHandler.HandleCommand(cmd)) + Console.WriteLine("Failed to run command " + cmd); + } + } + /// + /// Start the bot without user interface + /// + /// Returns the boot loader for the Discord Bot + private static async Task StartNoGUI() + { + Console.Clear(); + Console.ForegroundColor = ConsoleColor.DarkYellow; + + List startupMessageList = await ServerCom.ReadTextFromFile("https://raw.githubusercontent.com/Wizzy69/installer/discord-bot-files/StartupMessage"); + + foreach (var message in startupMessageList) Console.WriteLine(message); + + Console.WriteLine($"Running on version: {Config.GetValue("Version") ?? System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()}"); + Console.WriteLine($"Git URL: {Config.GetValue("GitURL") ?? " Could not find Git URL"}"); + + Console.ForegroundColor = ConsoleColor.White; + Console.WriteLine($"============================ LOG ============================"); + + try + { + var token = Config.GetValue("token"); + var prefix = Config.GetValue("prefix"); + + var discordbooter = new Boot(token, prefix); + await discordbooter.Awake(); + return discordbooter; + } + catch (Exception ex) + { + Console.WriteLine(ex); + return null; + } + } + + /// + /// Clear folder + /// + /// Directory path + private static Task ClearFolder(string d) + { + var files = Directory.GetFiles(d); + var fileNumb = files.Length; + for (var i = 0; i < fileNumb; i++) + { + File.Delete(files[i]); + Console.WriteLine("Deleting : " + files[i]); + } + + return Task.CompletedTask; + } + + /// + /// Handle user input arguments from the startup of the application + /// + /// The arguments + private static async Task HandleInput(string[] args) + { + var len = args.Length; + + if (len == 3 && args[0] == "/download") + { + var url = args[1]; + var location = args[2]; + + await ServerCom.DownloadFileAsync(url, location); + + return; + } + + if (len > 0 && (args.Contains("--cmd") || args.Contains("--args") || args.Contains("--nomessage"))) + { + if (args.Contains("lp") || args.Contains("loadplugins")) loadPluginsOnStartup = true; + if (args.Contains("listplugs")) listPluginsAtStartup = true; + len = 0; + } + + + if (len == 0 || (args[0] != "--exec" && args[0] != "--execute")) + { + var b = await StartNoGUI(); + await NoGUI(b); + return; + } + + + Console.ForegroundColor = ConsoleColor.DarkYellow; + Console.WriteLine("Execute command interface noGUI\n\n"); + Console.WriteLine( + "\tCommand name\t\t\t\tDescription\n" + + "-- help | -help\t\t ------ \tDisplay the help message\n" + + "--reset-full\t\t ------ \tReset all files (clear files)\n" + + "--reset-logs\t\t ------ \tClear up the output folder\n" + + "--start\t\t ------ \tStart the bot\n" + + "exit\t\t\t ------ \tClose the application" + ); + while (true) + { + Console.ForegroundColor = ConsoleColor.White; + Console.Write("> "); + var message = Console.ReadLine().Split(' '); + + switch (message[0]) + { + case "--help": + case "-help": + Console.ForegroundColor = ConsoleColor.DarkYellow; + Console.WriteLine( + "\tCommand name\t\t\t\tDescription\n" + + "-- help | -help\t\t ------ \tDisplay the help message\n" + + "--reset-full\t\t ------ \tReset all files (clear files)\n" + + "--reset-settings\t ------ \tReset only bot settings\n" + + "--reset-logs\t\t ------ \tClear up the output folder\n" + + "--start\t\t ------ \tStart the bot\n" + + "exit\t\t\t ------ \tClose the application" + ); + break; + case "--reset-full": + await ClearFolder("./Data/Resources/"); + await ClearFolder("./Output/Logs/"); + await ClearFolder("./Output/Errors"); + await ClearFolder("./Data/Languages/"); + await ClearFolder("./Data/Plugins/Commands"); + await ClearFolder("./Data/Plugins/Events"); + Console.WriteLine("Successfully cleared all folders"); + break; + case "--reset-logs": + await ClearFolder("./Output/Logs"); + await ClearFolder("./Output/Errors"); + Console.WriteLine("Successfully cleard logs folder"); + break; + case "--exit": + case "exit": + Environment.Exit(0); + break; + case "--start": + var booter = await StartNoGUI(); + await NoGUI(booter); + return; + + default: + Console.WriteLine("Failed to execute command " + message[0]); + break; + } + } + } + + private static async Task PreLoadComponents() + { + await Config.LoadConfig(); + if (Config.ContainsKey("DeleteLogsAtStartup")) + if (Config.GetValue("DeleteLogsAtStartup")) + foreach (var file in Directory.GetFiles("./Output/Logs/")) + File.Delete(file); + List OnlineDefaultKeys = await ServerCom.ReadTextFromFile("https://raw.githubusercontent.com/Wizzy69/installer/discord-bot-files/SetupKeys"); + + Config.PluginConfig.Load(); + + if (!Config.ContainsKey("Version")) + Config.AddValueToVariables("Version", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), false); + else + Config.SetValue("Version", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + + foreach (var key in OnlineDefaultKeys) + { + if (key.Length <= 3 || !key.Contains(' ')) continue; + string[] s = key.Split(' '); try { - string token = Config.GetValue("token"); - string prefix = Config.GetValue("prefix"); - - var discordbooter = new Boot(token, prefix); - await discordbooter.Awake(); - return discordbooter; + Config.GetAndAddValueToVariable(s[0], s[1], s[2].Equals("true", StringComparison.CurrentCultureIgnoreCase)); } catch (Exception ex) { - Console.WriteLine(ex); - return null; + Functions.WriteErrFile(ex.Message); } } - /// - /// Clear folder - /// - /// Directory path - private static Task ClearFolder(string d) + List onlineSettingsList = await ServerCom.ReadTextFromFile("https://raw.githubusercontent.com/Wizzy69/installer/discord-bot-files/OnlineData"); + foreach (var key in onlineSettingsList) { - string[] files = Directory.GetFiles(d); - int fileNumb = files.Length; - for (var i = 0; i < fileNumb; i++) - { - File.Delete(files[i]); - Console.WriteLine("Deleting : " + files[i]); - } + if (key.Length <= 3 || !key.Contains(' ')) continue; - return Task.CompletedTask; - } - - /// - /// Handle user input arguments from the startup of the application - /// - /// The arguments - private static async Task HandleInput(string[] args) - { - int len = args.Length; - if (len == 1 && args[0] == "--help") + string[] s = key.Split(' '); + switch (s[0]) { - Console.WriteLine("Available commands:\n--exec -> start the bot with tools enabled"); - return; - } - - if (len == 1 && args[0] == "--logout") - { - File.Delete(Functions.dataFolder + "config.json"); - await Task.Run(async () => + case "CurrentVersion": + string newVersion = s[1]; + if (!newVersion.Equals(Config.GetValue("Version"))) { - await Task.Delay(1000); - Environment.Exit(0x08); - } - ); - return; - } + Console.WriteLine("A new version has been released on github page."); + Console.WriteLine("Download the new version using the following link wrote in yellow"); + Console_Utilities.WriteColorText("&y" + Config.GetValue("GitURL") + "&c"); - if (len >= 2 && args[0] == "--encrypt") - { - string s2e = args.MergeStrings(1); - Console.WriteLine("MD5: " + await Cryptography.CreateMD5(s2e)); - Console.WriteLine("SHA356: " + await Cryptography.CreateSHA256(s2e)); - return; - } - - if (len == 3 && args[0] == "/download") - { - string url = args[1]; - string location = args[2]; - - await ServerCom.DownloadFileAsync(url, location); - - return; - } - - if (len > 0 && (args.Contains("--cmd") || args.Contains("--args") || args.Contains("--nomessage"))) - { - if (args.Contains("lp") || args.Contains("loadplugins")) loadPluginsOnStartup = true; - if (args.Contains("listplugs")) listPluginsAtStartup = true; - len = 0; - } - - - if (len == 0 || args[0] != "--exec" && args[0] != "--execute") - { - Boot b = await StartNoGUI(); - await NoGUI(b); - return; - } - - - Console.ForegroundColor = ConsoleColor.DarkYellow; - Console.WriteLine("Execute command interface noGUI\n\n"); - Console.WriteLine( - "\tCommand name\t\t\t\tDescription\n" + - "-- help | -help\t\t ------ \tDisplay the help message\n" + - "--reset-full\t\t ------ \tReset all files (clear files)\n" + - "--reset-logs\t\t ------ \tClear up the output folder\n" + - "--start\t\t ------ \tStart the bot\n" + - "exit\t\t\t ------ \tClose the application" - ); - while (true) - { - Console.ForegroundColor = ConsoleColor.White; - Console.Write("> "); - string[] message = Console.ReadLine().Split(' '); - - switch (message[0]) - { - case "--help": - case "-help": - Console.ForegroundColor = ConsoleColor.DarkYellow; - Console.WriteLine( - "\tCommand name\t\t\t\tDescription\n" + - "-- help | -help\t\t ------ \tDisplay the help message\n" + - "--reset-full\t\t ------ \tReset all files (clear files)\n" + - "--reset-settings\t ------ \tReset only bot settings\n" + - "--reset-logs\t\t ------ \tClear up the output folder\n" + - "--start\t\t ------ \tStart the bot\n" + - "exit\t\t\t ------ \tClose the application" + Console.WriteLine(); + Console.WriteLine("Your product will work just fine on this outdated version, but an update is recommended.\n" + + "From now on, this version is no longer supported" ); - break; - case "--reset-full": - await ClearFolder("./Data/Resources/"); - await ClearFolder("./Output/Logs/"); - await ClearFolder("./Output/Errors"); - await ClearFolder("./Data/Languages/"); - await ClearFolder("./Data/Plugins/Commands"); - await ClearFolder("./Data/Plugins/Events"); - Console.WriteLine("Successfully cleared all folders"); - break; - case "--reset-logs": - await ClearFolder("./Output/Logs"); - await ClearFolder("./Output/Errors"); - Console.WriteLine("Successfully cleard logs folder"); - break; - case "--exit": - case "exit": - Environment.Exit(0); - break; - case "--start": - Boot booter = await StartNoGUI(); - await NoGUI(booter); - return; + Console_Utilities.WriteColorText("&rUse at your own risk&c"); - default: - Console.WriteLine("Failed to execute command " + message[0]); - break; - } + Console_Utilities.WriteColorText("&mCurrent Version: " + Config.GetValue("Version") + "&c"); + Console_Utilities.WriteColorText("&gNew Version: " + newVersion + "&c"); + + Console.WriteLine("\n\n"); + await Task.Delay(1000); + + int waitTime = 20; //wait time to proceed + + Console.Write($"The bot will start in {waitTime} seconds"); + while (waitTime > 0) + { + await Task.Delay(1000); + waitTime--; + Console.SetCursorPosition("The bot will start in ".Length, Console.CursorTop); + Console.Write(" "); + Console.SetCursorPosition("The bot will start in ".Length, Console.CursorTop); + Console.Write(waitTime + " seconds"); + } + } + + break; } } - private static async Task PreLoadComponents() - { - await Config.LoadConfig(); - if (Config.ContainsKey("DeleteLogsAtStartup")) - if (Config.GetValue("DeleteLogsAtStartup")) - foreach (string file in Directory.GetFiles("./Output/Logs/")) - File.Delete(file); - } + + Config.SaveConfig(); } } diff --git a/DiscordBotGUI/.gitignore b/DiscordBotGUI/.gitignore deleted file mode 100644 index 8afdcb6..0000000 --- a/DiscordBotGUI/.gitignore +++ /dev/null @@ -1,454 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# JetBrains Rider -.idea/ -*.sln.iml - -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json diff --git a/DiscordBotGUI/App.axaml b/DiscordBotGUI/App.axaml deleted file mode 100644 index 49aa2e5..0000000 --- a/DiscordBotGUI/App.axaml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DiscordBotGUI/App.axaml.cs b/DiscordBotGUI/App.axaml.cs deleted file mode 100644 index 983b886..0000000 --- a/DiscordBotGUI/App.axaml.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace DiscordBotGUI; - -public class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) desktop.MainWindow = new AppUpdater { Width = 300, Height = 50, WindowStartupLocation = WindowStartupLocation.CenterScreen }; - - base.OnFrameworkInitializationCompleted(); - } -} diff --git a/DiscordBotGUI/AppUpdater.axaml b/DiscordBotGUI/AppUpdater.axaml deleted file mode 100644 index 939c0d6..0000000 --- a/DiscordBotGUI/AppUpdater.axaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/DiscordBotGUI/AppUpdater.axaml.cs b/DiscordBotGUI/AppUpdater.axaml.cs deleted file mode 100644 index fcf519f..0000000 --- a/DiscordBotGUI/AppUpdater.axaml.cs +++ /dev/null @@ -1,170 +0,0 @@ -using Avalonia.Controls; -using PluginManager.Online; -using PluginManager.Others; -using System.Threading.Tasks; -using System; -using System.IO; -using System.Threading; -using PluginManager; - -namespace DiscordBotGUI -{ - public partial class AppUpdater : Window - { - private string _version = ""; - - public AppUpdater() - { - InitializeComponent(); - Config.LoadConfig().Wait(); - if (!File.Exists("./Version.txt")) - { - File.WriteAllText("./Version.txt", "DiscordBotVersion=0"); - DownloadDiscordBotClientNoGUIAsDLL(); - } - - if (!File.Exists("./DiscordBot.exe")) DownloadDiscordBotClientNoGUIAsDLL(); - Updates(); - } - - private async void DownloadDiscordBotClientNoGUIAsDLL() - { - //await Task.Delay(5000); - string url_bot_dll = "https://sethdiscordbot.000webhostapp.com/Storage/Discord%20Bot/Updates/DiscordBot.zip"; - int actiontype = 0; //0 - downolad, 1- extract - IProgress progress = new Progress((percent) => - { - if (actiontype == 0) - textBox1.Text = "Downloading DiscordBot ... " + MathF.Round(percent, 2) + "%"; - else - textBox1.Text = "Extracting package ..." + MathF.Round(percent, 2) + "%"; - this.progressBar1.Value = percent; - }); - - this.progressBar1.IsIndeterminate = false; - try - { - await ServerCom.DownloadFileAsync(url_bot_dll, "./DiscordBot.zip", progress); - - actiontype++; - - await Functions.ExtractArchive("./DiscordBot.zip", "./", progress); - } - catch - { - textBox1.Text = "Error downloading DiscordBot.dll. Server is not responding."; - - await Task.Delay(1000); - - new MainWindow() { Height = 425, Width = 500 }.Show(); - Close(); - } - } - - private async void Updates() - { - this.progressBar1.IsIndeterminate = true; - await Task.Delay(1000); - if (!await CheckForUpdates()) - { - //await Task.Delay(5000); - textBox1.Text = $"You are running on the latest version ({_version}) !"; - await Task.Delay(2000); - new MainWindow() { Height = 425, Width = 650 }.Show(); - this.Close(); - return; - } - - string file = await DownloadNewUpdate(); - if (file == null) - { - textBox1.Text = "There was an error while downloading the update !"; - await Task.Delay(2000); - new MainWindow() { Height = 425, Width = 650 }.Show(); - this.Close(); - return; - } - - IProgress progress = new Progress((percent) => { this.progressBar1.Value = percent; }); - - textBox1.Text = "Extracting update files ..."; - await Functions.ExtractArchive(file, "./", progress); - progressBar1.IsIndeterminate = true; - textBox1.Text = "Setting up the new version ..."; - File.Delete(file); - File.WriteAllText("./Version.txt", "DiscordBotVersion=" + _version); - await Task.Delay(5000); - new MainWindow() { Height = 425, Width = 650 }.Show(); - this.Close(); - } - - private async Task DownloadNewUpdate() - { - string urlNewUpdateZip = (await ServerCom.ReadTextFromFile("https://sethdiscordbot.000webhostapp.com/Storage/Discord%20Bot/Updates/Version"))[1]; - int secondsPast = 0; - - bool isDownloading = true; - this.progressBar1.IsIndeterminate = true; - textBox1.Text = "Downloading update ..."; - - - IProgress downloaded = new Progress((bytes) => - { - (double, string) download = Functions.ConvertBytes(bytes); - textBox1.Text = $"Downloading update ... {Math.Round(download.Item1 / secondsPast, 2)} {download.Item2}/s"; - }); - IProgress progress = new Progress((percent) => - { - progressBar1.IsIndeterminate = false; - this.progressBar1.Value = percent; - }); - - - string FileName = $"{urlNewUpdateZip.Split('/')[urlNewUpdateZip.Split('/').Length - 1]}"; - try - { - new Thread(new Task(() => - { - while (isDownloading) - { - Thread.Sleep(1000); - secondsPast++; - } - }).Start).Start(); - await ServerCom.DownloadFileAsync(urlNewUpdateZip, FileName, progress, downloaded); - } - catch - { - textBox1.Text = "Error downloading the update. Server is not responding."; - isDownloading = false; - await Task.Delay(1000); - return null; - } - - isDownloading = false; - return FileName; - } - - private async Task CheckForUpdates() - { - try - { - string current_version = Config.GetValue("Version"); - if (current_version == null) - if (!Config.SetValue("Version", "0")) - Config.AddValueToVariables("Version", "0", false); - string latest_version = (await ServerCom.ReadTextFromFile("https://sethdiscordbot.000webhostapp.com/Storage/Discord%20Bot/Updates/Version"))[0]; - _version = latest_version; - if (current_version != latest_version) { return true; } - - return false; - } - catch (Exception ex) - { - textBox1.Text = "Error while checking for updates. Server is not responding."; - Functions.WriteErrFile(ex.Message); - return false; - } - } - } -} diff --git a/DiscordBotGUI/DiscordBotGUI.csproj b/DiscordBotGUI/DiscordBotGUI.csproj deleted file mode 100644 index 568b686..0000000 --- a/DiscordBotGUI/DiscordBotGUI.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - WinExe - net6.0 - enable - - copyused - true - ..\BUILDS\DiscordBotUI\ - - - False - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DiscordBotGUI/MainWindow.axaml b/DiscordBotGUI/MainWindow.axaml deleted file mode 100644 index c011ce7..0000000 --- a/DiscordBotGUI/MainWindow.axaml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - -