diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 2a368a8b2..c57e95d1a 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,9 +1,17 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
- "ghcr.io/devcontainers/features/common-utils:1",
- "ghcr.io/devcontainers/features/github-cli:1",
- "ghcr.io/devcontainers/features/git-lfs:1",
- "ghcr.io/devcontainers/features/sshd:1"
+ "ghcr.io/devcontainers/features/common-utils:1": {
+ "version": "latest"
+ },
+ "ghcr.io/devcontainers/features/github-cli:1": {
+ "version": "latest"
+ },
+ "ghcr.io/devcontainers/features/git-lfs:1": {
+ "version": "latest"
+ },
+ "ghcr.io/devcontainers/features/sshd:1": {
+ "version": "latest"
+ }
}
}
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index f0fc116ea..fa90ce9e8 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,105 +1,105 @@
name: "Documentation"
on:
push:
- branches: [ main ]
+ branches: [ main, hacktober/main ]
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
name: Build documentation
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: DisCatSharp
- name: Setup .NET
- uses: actions/setup-dotnet@v3.0.2
+ uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 6.0.400
- name: Restore packages
working-directory: DisCatSharp
run: dotnet restore
- name: Build library
working-directory: DisCatSharp
run: dotnet build -c Release
- name: Test library
working-directory: DisCatSharp
run: dotnet test -c Release
continue-on-error: true
- name: Build Docs
working-directory: DisCatSharp
shell: pwsh
run: ./rebuild-docs.ps1 -DocsPath "./DisCatSharp.Docs" -Output ".." -PackageName "dcs-docs"
- name: Upload packed docs
uses: actions/upload-artifact@v3
with:
name: dcs-docs.zip
path: dcs-docs.zip
retention-days: 30
documentation:
runs-on: windows-latest
name: Upload documentation
needs: build
steps:
- name: Checkout docs repository
uses: actions/checkout@v3
with:
repository: Aiko-IT-Systems/DisCatSharp.Docs
path: DisCatSharp.Docs
token: ${{ secrets.NYUW_TOKEN_GH }}
- name: Download packed docs
uses: actions/download-artifact@v3
with:
name: dcs-docs.zip
- name: Purge old docs
working-directory: DisCatSharp.Docs
shell: pwsh
- run: Get-ChildItem -Exclude .git* | Remove-Item -Recurse -Force
+ run: Get-ChildItem -Exclude .git*,.htaccess | Remove-Item -Recurse -Force
- name: Extract new docs
shell: pwsh
run: Expand-Archive -Path dcs-docs.zip DisCatSharp.Docs/
- - name: Delete packed docs
- uses: geekyeggo/delete-artifact@v2
- with:
- name: dcs-docs.zip
+ #- name: Delete packed docs
+ # uses: geekyeggo/delete-artifact@v2
+ # with:
+ # name: dcs-docs.zip
- name: Commit and push changes
uses: EndBug/add-and-commit@main
with:
cwd: DisCatSharp.Docs
default_author: user_info
author_name: DisCatSharp
author_email: team@aitsys.dev
committer_name: NyuwBot
committer_email: nyuw@aitsys.dev
commit: --signoff
message: 'Docs update for commit ${{ github.repository }} (${{ github.sha }})'
publish-main:
runs-on: ubuntu-latest
name: Publish documentation on main server
needs: documentation
steps:
- name: Get SSH Agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.AITSYS_SSH }}
- name: Publish on server
continue-on-error: true
- run: ssh -o StrictHostKeyChecking=no -T root@80.153.182.68 -f 'cd /var/www/dcs.aitsys.dev/docs && git pull -f'
+ run: ssh -o StrictHostKeyChecking=no -T root@80.153.182.68 -f 'cd /var/www/dcs.aitsys.dev/docs && git pull -f && service apache2 restart'
publish-backup:
runs-on: ubuntu-latest
name: Publish documentation on backup server
needs: documentation
steps:
- name: Get SSH Agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.AITSYS_SSH }}
- name: Publish on server
continue-on-error: true
- run: ssh -o StrictHostKeyChecking=no -T root@207.180.240.241 -f 'cd /var/www/dcsdocs && git pull -f'
+ run: ssh -o StrictHostKeyChecking=no -T root@207.180.240.241 -f 'cd /var/www/dcsdocs && git pull -f && service apache2 restart'
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index dd558fb61..f0567f0f9 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -1,26 +1,26 @@
name: "Build"
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
dotnet: [6.0.400]
runs-on: ${{ matrix.os }}
name: Build library
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
- uses: actions/setup-dotnet@v3.0.2
+ uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Restore dependencies
run: dotnet restore
- name: Build library
run: dotnet build -c Release
- name: Test library
run: dotnet test --verbosity normal -c Release
diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml
index 1b5a36d57..3ce379c7e 100644
--- a/.github/workflows/test_docs.yml
+++ b/.github/workflows/test_docs.yml
@@ -1,44 +1,44 @@
name: "Test Documentation"
on:
push:
branches: [ test ]
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
name: Build documentation
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: DisCatSharp
- name: Setup .NET
- uses: actions/setup-dotnet@v3.0.2
+ uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 6.0.400
- name: Restore packages
working-directory: DisCatSharp
run: dotnet restore
- name: Build library
working-directory: DisCatSharp
run: dotnet build -c Release
- name: Test library
working-directory: DisCatSharp
run: dotnet test -c Release
continue-on-error: true
- name: Build Docs
working-directory: DisCatSharp
shell: pwsh
run: ./rebuild-docs.ps1 -DocsPath "./DisCatSharp.Docs" -Output ".." -PackageName "dcs-docs"
- name: Upload packed docs
uses: actions/upload-artifact@v3
with:
name: dcs-docs.zip
path: dcs-docs.zip
retention-days: 30
diff --git a/DisCatSharp.ApplicationCommands/ApplicationCommandsExtension.cs b/DisCatSharp.ApplicationCommands/ApplicationCommandsExtension.cs
index d32a33448..095dea55b 100644
--- a/DisCatSharp.ApplicationCommands/ApplicationCommandsExtension.cs
+++ b/DisCatSharp.ApplicationCommands/ApplicationCommandsExtension.cs
@@ -1,2095 +1,2091 @@
// This file is part of the DisCatSharp project, based off DSharpPlus.
//
// Copyright (c) 2021-2022 AITSYS
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using DisCatSharp.ApplicationCommands.Attributes;
using DisCatSharp.ApplicationCommands.Context;
using DisCatSharp.ApplicationCommands.Entities;
using DisCatSharp.ApplicationCommands.Enums;
using DisCatSharp.ApplicationCommands.EventArgs;
using DisCatSharp.ApplicationCommands.Exceptions;
using DisCatSharp.ApplicationCommands.Workers;
using DisCatSharp.Common;
using DisCatSharp.Common.Utilities;
using DisCatSharp.Entities;
using DisCatSharp.Enums;
using DisCatSharp.EventArgs;
using DisCatSharp.Exceptions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace DisCatSharp.ApplicationCommands;
///
/// A class that handles slash commands for a client.
///
public sealed class ApplicationCommandsExtension : BaseExtension
{
///
/// A list of methods for top level commands.
///
private static List s_commandMethods { get; set; } = new();
///
/// List of groups.
///
private static List s_groupCommands { get; set; } = new();
///
/// List of groups with subgroups.
///
private static List s_subGroupCommands { get; set; } = new();
///
/// List of context menus.
///
private static List s_contextMenuCommands { get; set; } = new();
///
/// List of global commands on discords backend.
///
internal static List GlobalDiscordCommands { get; set; }
///
/// List of guild commands on discords backend.
///
internal static Dictionary> GuildDiscordCommands { get; set; }
///
/// Singleton modules.
///
private static List