Skip to content

Commit 9ae9a83

Browse files
committed
Merge remote-tracking branch 'dspng/main'
2 parents bb6380b + e190561 commit 9ae9a83

File tree

596 files changed

+82904
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+82904
-414
lines changed

.editorconfig

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ root = true
33

44
#### Core EditorConfig Options ####
55

6-
# All files
7-
[*]
6+
# All files
7+
[*]
88

99
# General
1010
charset = utf-8
@@ -39,7 +39,7 @@ tab_width = 4
3939
# Organize usings
4040
dotnet_separate_import_directive_groups = false
4141
dotnet_sort_system_directives_first = true
42-
file_header_template = This file is part of the DSharpPlus project.\n\nCopyright (c) 2015 Mike Santiago\nCopyright (c) 2016-2021 DSharpPlus Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.
42+
file_header_template = This file is part of the DSharpPlusNextGen project.\n\nCopyright (c) 2021 AITSYS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.
4343

4444
# this. and Me. preferences
4545
dotnet_style_qualification_for_event = true:error
@@ -215,19 +215,19 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
215215

216216
dotnet_naming_symbols.interface.applicable_kinds = interface
217217
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
218-
dotnet_naming_symbols.interface.required_modifiers =
218+
dotnet_naming_symbols.interface.required_modifiers =
219219

220220
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
221221
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
222-
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
222+
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
223223

224224
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
225225
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
226-
dotnet_naming_symbols.types.required_modifiers =
226+
dotnet_naming_symbols.types.required_modifiers =
227227

228228
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
229229
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
230-
dotnet_naming_symbols.non_field_members.required_modifiers =
230+
dotnet_naming_symbols.non_field_members.required_modifiers =
231231

232232
dotnet_naming_symbols.async_methods.applicable_kinds = method
233233
dotnet_naming_symbols.async_methods.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
@@ -239,22 +239,22 @@ dotnet_naming_symbols.const_fields.required_modifiers = const
239239

240240
# Naming styles
241241

242-
dotnet_naming_style.pascal_case.required_prefix =
243-
dotnet_naming_style.pascal_case.required_suffix =
244-
dotnet_naming_style.pascal_case.word_separator =
242+
dotnet_naming_style.pascal_case.required_prefix =
243+
dotnet_naming_style.pascal_case.required_suffix =
244+
dotnet_naming_style.pascal_case.word_separator =
245245
dotnet_naming_style.pascal_case.capitalization = pascal_case
246246

247247
dotnet_naming_style.begins_with_i.required_prefix = I
248-
dotnet_naming_style.begins_with_i.required_suffix =
249-
dotnet_naming_style.begins_with_i.word_separator =
248+
dotnet_naming_style.begins_with_i.required_suffix =
249+
dotnet_naming_style.begins_with_i.word_separator =
250250
dotnet_naming_style.begins_with_i.capitalization = pascal_case
251251

252252
dotnet_naming_style.underscore_prefixed_camel_case.required_prefix = _
253-
dotnet_naming_style.underscore_prefixed_camel_case.required_suffix =
254-
dotnet_naming_style.underscore_prefixed_camel_case.word_separator =
253+
dotnet_naming_style.underscore_prefixed_camel_case.required_suffix =
254+
dotnet_naming_style.underscore_prefixed_camel_case.word_separator =
255255
dotnet_naming_style.underscore_prefixed_camel_case.capitalization = camel_case
256256

257-
dotnet_naming_style.async_suffix.required_prefix =
257+
dotnet_naming_style.async_suffix.required_prefix =
258258
dotnet_naming_style.async_suffix.required_suffix = Async
259-
dotnet_naming_style.async_suffix.word_separator =
259+
dotnet_naming_style.async_suffix.word_separator =
260260
dotnet_naming_style.async_suffix.capitalization = pascal_case

.github/FUNDING.yml

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
# These are supported funding model platforms
2-
3-
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
github:
5-
- Naamloos
6-
- Emzi0767
7-
#patreon: # Replace with a single Patreon username
8-
#open_collective: # Replace with a single Open Collective username
9-
#ko_fi: # Replace with a single Ko-fi username
10-
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
11-
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
12-
#liberapay: # Replace with a single Liberapay username
13-
#issuehunt: # Replace with a single IssueHunt username
14-
#otechie: # Replace with a single Otechie username
1+
github:
2+
- Lulalaby
3+
patreon: aiko_it_systems
154
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
16-
- https://ko-fi.com/naamloos
17-
- https://ko-fi.com/emzi0767
18-
- https://paypal.me/Emzi0767/5USD
19-
# insert Neuheit here
5+
- https://paypal.me/aitsys

.github/workflows/codeinspector.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on: [push]
2+
3+
jobs:
4+
check-quality:
5+
runs-on: ubuntu-latest
6+
name: A job to check the code quality
7+
steps:
8+
- name: Check code meets quality standards
9+
id: code-inspector
10+
uses: codeinspectorio/github-action@master
11+
with:
12+
repo_token: ${{ secrets.GITHUB_TOKEN }}
13+
code_inspector_access_key: ${{ secrets.CODE_INSPECTOR_ACCESS_KEY }}
14+
code_inspector_secret_key: ${{ secrets.CODE_INSPECTOR_SECRET_KEY }}
15+
min_quality_grade: 'WARNING'
16+
min_quality_score: '30'
17+
max_defects_rate: '0.1'
18+
max_complex_functions_rate: '0.1'
19+
max_long_functions_rate: '0.1'
20+
project_name: 'DSharpPlusNextGen'
21+
max_timeout_sec: '600'

.github/workflows/dotnet.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 5.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
- name: Build
23+
run: dotnet build --no-restore
24+
- name: Test
25+
run: dotnet test --no-build --verbosity normal

.gitignore

+1-5
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ artifacts/
296296

297297
### Test files
298298
config.json
299-
libsodium.dll
300-
libopus.dll
301-
sodium.dll
302-
opus.dll
303299
ffmpeg.exe
304300
*.pcm
305-
appveyor-test.ps1
301+
appveyor-test.ps1

.vscode/tasks.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
42
"version": "2.0.0",
53
"tasks": [
64
{
@@ -47,4 +45,4 @@
4745
"problemMatcher": "$msCompile"
4846
}
4947
]
50-
}
48+
}

BUILDING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Building DSharpPlus
2-
These are detailed instructions on how to build the DSharpPlus library under various environmnets.
2+
These are detailed instructions on how to build the DSharpPlusNextGen library under various environmnets.
33

44
It is recommended you have prior experience with multi-target .NET Core/Standard projects, as well as the `dotnet` CLI utility, and MSBuild.
55

@@ -55,20 +55,20 @@ Building through Visual Studio yields just binaries you can use in your projects
5555
#### Building with the build script
5656
Building this way outputs NuGet packages, and a documentation package. Ensure you have an internet connection available, as the script will install programs necessary to build the documentation.
5757

58-
1. Open PowerShell and navigate to the directory which you cloned DSharpPlus to.
58+
1. Open PowerShell and navigate to the directory which you cloned DSharpPlusNextGen to.
5959
2. Execute `.\rebuild-all.ps1 -configuration Release` and wait for the script to finish execution.
60-
3. Once it's done, the artifacts will be available in *dsp-artifacts* directory, next to the directory to which the repository is cloned.
60+
3. Once it's done, the artifacts will be available in *dsp-ng-artifacts* directory, next to the directory to which the repository is cloned.
6161

6262
### GNU/Linux
6363
When all necessary prerequisites are installed, you can proceed to building. There are technically 2 ways to build the library, though both of them perform the same steps, they are just invoked slightly differently.
6464

6565
#### Through Visual Studio Code
66-
1. Open Visual Studio Code and open the folder to which you cloned DSharpPlus as your workspace.
66+
1. Open Visual Studio Code and open the folder to which you cloned DSharpPlusNextGen as your workspace.
6767
2. Select Build > Run Task...
6868
3. Select `buildRelease` task and wait for it to finish.
69-
4. The artifacts will be placed in *dsp-artifacts* directory, next to whoch the repository is cloned.
69+
4. The artifacts will be placed in *dsp-ng-artifacts* directory, next to whoch the repository is cloned.
7070

7171
#### Through PowerShell
72-
1. Open PowerShell (`pwsh`) and navigate to the directory which you cloned DSharpPlus to.
72+
1. Open PowerShell (`pwsh`) and navigate to the directory which you cloned DSharpPlusNextGen to.
7373
2. Execute `.\rebuild-all.ps1 -configuration Release` and wait for the script to finish execution.
74-
3. Once it's done, the artifacts will be available in *dsp-artifacts* directory, next to the directory to which the repository is cloned.
74+
3. Once it's done, the artifacts will be available in *dsp-ng-artifacts* directory, next to the directory to which the repository is cloned.

CONTRIBUTING.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Contributing to DSharpPlus
1+
# Contributing to DSharpPlus-NextGen
22
We're really happy to accept contributions. However we also ask that you follow several rules when doing so.
33

44
# Proper base
5-
When opening a PR, please make sure your branch targets the latest release branch, in this case it would be `release/4.0`. Also make sure your branch is even with the target branch, to avoid unnecessary surprises.
5+
When opening a PR, please make sure your branch targets the latest release branch, in this case it would be `main`. Also make sure your branch is even with the target branch, to avoid unnecessary surprises.
66

77
# Versioning
8-
We follow [SemVer](https://semver.org/) versioning when it comes to pushing stable releases. Ideally, this means you should only be creating PRs for `patch` and `minor` changes. If you wish to introduce a `major` (breaking) change, please discuss it beforehand so we can determine how to integrate it into our next major version. If this involves removing a public facing property/method, mark it with the `Obsolete` attribute instead on the latest release branch.
8+
We follow [SemVer](https://semver.org/) versioning when it comes to pushing stable releases. Ideally, this means you should only be creating PRs for `patch` and `minor` changes. If you wish to introduce a `major` (breaking) change, please discuss it beforehand so we can determine how to integrate it into our next major version. If this involves removing a public facing property/method, mark it with the `Obsolete` attribute instead on the latest release branch.
99

1010
# Proper titles
11-
When opening issues, make sure the title reflects the purpose of the issue or the pull request. Prefer past tense, and
11+
When opening issues, make sure the title reflects the purpose of the issue or the pull request. Prefer past tense, and
1212
be brief. Further description belongs inside the issue or PR.
1313

1414
# Descriptive changes
15-
We require the commits describe the change made. It can be a short description. If you fixed or resolved an open issue,
15+
We require the commits describe the change made. It can be a short description. If you fixed or resolved an open issue,
1616
please reference it by using the # notation.
1717

1818
Examples of good commit messages:
@@ -23,7 +23,7 @@ Examples of good commit messages:
2323
* `Fixed a potential NRE.`
2424
* ```
2525
Changed message cache behaviour:
26-
26+
2727
- Messages are now stored globally.
2828
- Cache now deletes messages when they are deleted from discord.
2929
- Cache itself is now a ring buffer.
@@ -37,23 +37,23 @@ Examples of bad commit messages:
3737
* `Oops.`
3838

3939
# Code style
40-
We use [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions)
40+
We use [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions)
4141
throughout the repository, with several exceptions:
4242

4343
* Preference of `this`. While this one is not required, it's ill-advised to remove the existing instances thereof.
44-
* When working with async code, and your method consists of a single `await` statement not in any `if`, `while`, etc.
44+
* When working with async code, and your method consists of a single `await` statement not in any `if`, `while`, etc.
4545
blocks, pass the task through instead of awaiting it. For example:
46-
46+
4747
```cs
4848
public Task DoSomethingAsync()
4949
=> this.DoAnotherThingAsync();
50-
50+
5151
public Task DoAnotherThingAsync()
5252
{
5353
Console.WriteLine("42");
5454
return this.DoYetAnotherThingAsync(42);
5555
}
56-
56+
5757
public async Task DoYetAnotherThingAsync(int num)
5858
{
5959
if (num == 42)
@@ -71,15 +71,15 @@ In addition to these, we also have several preferences:
7171
StringNumber = "fourty-two",
7272
Number = 42
7373
};
74-
74+
7575
var b = new Dictionary<string, int>()
7676
{
7777
["fourty-two"] = 42,
7878
["sixty-nine"] = 69
7979
};
80-
80+
8181
var c = new List<int>() { 42, 69 };
82-
82+
8383
var d = new[] { 42, 69 };
8484
```
8585
* Inline `out` declarations when possible: `SomeOutMethod(42, out var stringified);`
@@ -107,17 +107,17 @@ In addition to these, we also have several preferences:
107107
* Non-public events.
108108

109109
# Code changes
110-
One of our requirements is that all code change commits must build successfully. This is verified by our CI. When you
111-
open a pull request, AppVeyor will start a build. You can view its summary by visiting it from the checks section on
110+
One of our requirements is that all code change commits must build successfully. This is verified by our CI. When you
111+
open a pull request, AppVeyor will start a build. You can view its summary by visiting it from the checks section on
112112
the PR overview page.
113113

114114
PRs that do not build will not be accepted.
115115

116116
Furthermore we require that methods you implement on Discord entities have a reflection in the Discord API.
117117

118-
In the event your code change is a style change, XML doc change, or otherwise does not change how the code works, tag
118+
In the event your code change is a style change, XML doc change, or otherwise does not change how the code works, tag
119119
the commit with `[ci skip]`.
120120

121121
# Non-code changes
122-
In the event you change something outside of code (i.e. a meta-change or documentation), you must tag your commit with
122+
In the event you change something outside of code (i.e. a meta-change or documentation), you must tag your commit with
123123
`[ci skip]`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// This file is part of the DSharpPlus project.
2+
//
3+
// Copyright (c) 2015 Mike Santiago
4+
// Copyright (c) 2016-2021 DSharpPlus Contributors
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
24+
using System;
25+
using System.Collections.Generic;
26+
using System.Collections.ObjectModel;
27+
using System.Linq;
28+
29+
namespace DSharpPlusNextGen.CommandsNext.Attributes
30+
{
31+
/// <summary>
32+
/// Adds aliases to this command or group.
33+
/// </summary>
34+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
35+
public sealed class AliasesAttribute : Attribute
36+
{
37+
/// <summary>
38+
/// Gets this group's aliases.
39+
/// </summary>
40+
public IReadOnlyList<string> Aliases { get; }
41+
42+
/// <summary>
43+
/// Adds aliases to this command or group.
44+
/// </summary>
45+
/// <param name="aliases">Aliases to add to this command or group.</param>
46+
public AliasesAttribute(params string[] aliases)
47+
{
48+
if (aliases.Any(xa => xa == null || xa.Any(xc => char.IsWhiteSpace(xc))))
49+
throw new ArgumentException("Aliases cannot contain whitespace characters or null strings.", nameof(aliases));
50+
51+
this.Aliases = new ReadOnlyCollection<string>(aliases);
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)