diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 41bf7abcd..06b0abd22 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,8 +1,7 @@ github: - Lulalaby patreon: aiko_it_systems -community_bridge: ba6d3dfc-e110-483d-803b-572da206c4ff +# community_bridge: ba6d3dfc-e110-483d-803b-572da206c4ff custom: - https://paypal.me/aitsys - https://paypal.me/Geferon -# - mortAlice diff --git a/DisCatSharp.Docs/articles/application_commands/translations/using.md b/DisCatSharp.Docs/articles/application_commands/translations/using.md index 31b121d52..84221cf1c 100644 --- a/DisCatSharp.Docs/articles/application_commands/translations/using.md +++ b/DisCatSharp.Docs/articles/application_commands/translations/using.md @@ -1,201 +1,201 @@ --- uid: application_commands_translations_using title: Using Translations --- # Using Translations ## Why Do We Outsource Translation In External JSON Files Pretty simple: It's common to have translations external stored. This makes it easier to modify them, while keeping the code itself clean. ## Adding Translations Translations are added the same way like permissions are added to Application Commands: ```cs const string TRANSLATION_PATH = "translations/"; -Client.GetShard(0).GetApplicationCommands().RegisterCommands(1215484634894646844, perms => { +Client.GetApplicationCommands().RegisterGuildCommands(1215484634894646844, perms => { perms.AddRole(915747497668915230, true); }, translations => { string json = File.ReadAllText(TRANSLATION_PATH + "my_command.json"); translations.AddTranslation(json); }); -Client.GetShard(0).GetApplicationCommands().RegisterCommands(1215484634894646844, perms => { +Client.GetApplicationCommands().RegisterGuildCommands(1215484634894646844, perms => { perms.AddRole(915747497668915230, true); }, translations => { string json = File.ReadAllText(TRANSLATION_PATH + "my_simple_command.json"); translations.AddTranslation(json); }); ``` > [!WARNING] > If you add a translation to a class, you have to supply translations for every command in this class. Otherwise it will fail. ## Creating The Translation JSON We split the translation in two categories. One for slash command groups and one for normal slash commands and context menu commands. The `name` key in the JSON will be mapped to the command / option / choice names internally. ### Translation For Slash Command Groups Imagine, your class look like the following example: ```cs public class MyCommand : ApplicationCommandsModule { [SlashCommandGroup("my_command", "This is decription of the command group.")] public class MyCommandGroup : ApplicationCommandsModule { [SlashCommand("first", "This is decription of the command.")] public async Task MySlashCommand(InteractionContext context) { await context.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder() { Content = "This is first subcommand." }); } [SlashCommand("second", "This is decription of the command.")] public async Task MySecondCommand(InteractionContext context, [Option("value", "Some string value.")] string value) { await context.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder() { Content = "This is second subcommand. The value was " + value }); } } } ``` The translation json is a object of [Command Group Objects](xref:application_commands_translations_reference#command-group-object) A correct translation json for english and german would look like that: ```json [ { "name": "my_command", "name_translations": { "en-US": "my_command", "de": "mein_befehl" }, "description_translations": { "en-US": "This is decription of the command group.", "de": "Das ist die Beschreibung der Befehl Gruppe." }, "commands": [ { "name": "first", "type": 1, // Type 1 for slash command "name_translations": { "en-US": "first", "de": "erste" }, "description_translations": { "en-US": "This is decription of the command.", "de": "Das ist die Beschreibung des Befehls." } }, { "name": "second", "type": 1, // Type 1 for slash command "name_translations": { "en-US": "second", "de": "zweite" }, "description_translations": { "en-US": "This is decription of the command.", "de": "Das ist die Beschreibung des Befehls." }, "options": [ { "name": "value", "name_translations": { "en-US": "value", "de": "wert" }, "description_translations": { "en-US": "Some string value.", "de": "Ein string Wert." } } ] } ] } ] ``` ### Translation For Slash Commands & Context Menu Commands Now imagine, that your class look like this example: ```cs public class MySimpleCommands : ApplicationCommandsModule { [SlashCommand("my_command", "This is decription of the command.")] public async Task MySlashCommand(InteractionContext context) { } [ContextMenu(ApplicationCommandType.User, "My Command")] public async Task MyContextMenuCommand(ContextMenuContext context) { } } ``` The slash command is a simple [Command Object](xref:application_commands_translations_reference#command-object). Same goes for the context menu command, but note that it can't have a description. Slash Commands has the [type](xref:application_commands_translations_reference#application-command-type) `1` and context menu commands the [type](xref:application_commands_translations_reference#application-command-type) `2` or `3`. We use this to determine, where the translation belongs to. A correct json for this example would look like that: ```json [ { "name":"my_command", "type": 1, // Type 1 for slash command "name_translations":{ "en-US":"my_command", "de":"mein_befehl" }, "description_translations":{ "en-US":"This is decription of the command.", "de":"Das ist die Beschreibung des Befehls." } }, { "name":"My Command", "type": 2, // Type 2 for user context menu command "name_translations":{ "en-US":"My Command", "de":"Mein Befehl" } } ] ``` ## Available Locales Discord has a limited choice of locales, in particular, the ones you can select in the client. To see the available locales, visit [this](xref:application_commands_translations_reference#valid-locales) page. ## Can We Get The User And Guild Locale? Yes, you can! Discord sends the user on all [interaction types](xref:DisCatSharp.InteractionType), except `Ping`. We introduced two new properties `Locale` and `GuildLocale` on [InteractionContext](xref:DisCatSharp.ApplicationCommands.InteractionContext), [ContextMenuContext](xref:DisCatSharp.ApplicationCommands.ContextMenuContext), [AutoCompleteContext](xref:DisCatSharp.ApplicationCommands.AutocompleteContext) and [DiscordInteraction](xref:DisCatSharp.Entities.DiscordInteraction). `Locale` is the locale of the user and always represented. `GuildLocale` is only represented, when the interaction is **not** in a DM. Furthermore we cache known user locales on the [DiscordUser](xref:DisCatSharp.Entities.DiscordUser#DisCatSharp_Entities_DiscordUser_Locale) object. diff --git a/DisCatSharp.Docs/articles/important_changes/9_8_5.md b/DisCatSharp.Docs/articles/important_changes/9_8_5.md new file mode 100644 index 000000000..286107fe7 --- /dev/null +++ b/DisCatSharp.Docs/articles/important_changes/9_8_5.md @@ -0,0 +1,171 @@ +--- +uid: important_changes_9_8_5 +title: Version 9.8.5 +--- + +# Upgrade from **9.8.4** to **9.8.5** + +## What is new in DisCatSharp? +- Enforced Naming Conventions +- Reworked ApplicationCommands Module +- Timeouts +- RestClient +- DisCatSharp.Common Extensions +- Attachment manipulation and alt text +- Modals +- Slash Attachments + +## What changed? + +### ApplicationCommands Module + +First of all, the complete module was rewritten to be significant faster. +We could decrease the application command startup to ~30 seconds. +Before it was like 5 minutes for big bots. + +On startup, depending on the size, it can take a few minutes till application commands can be used. +The lib automatically catches this during the startup and warns the user. + +We added `GuildCommands` & `GlobalCommands` to the [Application​Commands​Extension](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#properties). + +Every guild command will be added to [DiscordGuild.RegisteredApplicationCommands](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_RegisteredApplicationCommands) and the permissions to [DiscordGuild.GuildApplicationCommandPermissions](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GuildApplicationCommandPermissions) + +Furthermore: +- Instead of registering commands when the client is ready, it waits for all guilds to be downloaded. +- The module now checks for existing commands and only executes API calls when needed. + + +#### Default Help Module +You can add `EnableDefaultHelp = false` in the [ApplicationCommandsConfiguration](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsConfiguration.html#DisCatSharp_ApplicationCommands_ApplicationCommandsConfiguration_EnableDefaultHelp) to disable the module. + +If not supplied, DisCatSharp automatically generates a global `/help` command. + +Many thanks to Will for adding this to our lib ❤️ + +##### Example +```csharp +DiscordClient.UseApplicationCommands(new ApplicationCommandsConfiguration() { + EnableDefaultHelp = true +}); +``` + +#### Permissions + +You can now set [global permissions](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsGlobalPermissionContext.html) ❤️ + +But we had to change the way the module works for it. + +The new methods for adding commands are now: + +- Global Commands +```csharp +ApplicationCommandsExtension.RegisterGlobalCommands(perms => { + perms.AddRole(some_cool_guild_id, some_cool_role_id, false); +}); +``` + +- Guild Commands +```csharp +ApplicationCommandsExtension.RegisterGuildCommands(some_cool_guild_id, perms => { + perms.AddRole(some_cool_role_id, true); +}); +``` + +#### Options & Attributes +Discord supports integers as input but we only added `long` for some unknown reason. +We added to the Option type [number](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommandOptionType.html) now `int`. + +#### Events +We added the following events for you: +- [ApplicationCommandsModuleReady](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_ApplicationCommandsModuleReady) Fired when the module finished the basic startup. +- [ApplicationCommandsModuleStartupFinished](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_ApplicationCommandsModuleStartupFinished) Fired when all commands are registered. +- [GuildApplicationCommandsRegistered](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_GuildApplicationCommandsRegistered) Fired when guild commands in a guild finished the registration. +- [GlobalApplicationCommandsRegistered](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_GlobalApplicationCommandsRegistered) Fired when global commands finished the registration. + + +### Timeouts + +#### Methods +You have the following methods to use timeouts: + +- [DiscordGuild.TimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_TimeoutAsync_System_UInt64_System_DateTime_System_String_) - has three overloads +- [DiscordGuild.RemoveTimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_RemoveTimeoutAsync_System_UInt64_System_String_) +- [DiscordMember.TimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_TimeoutAsync_System_DateTime_System_String_) - has three overloads +- [DiscordMember.RemoveTimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_RemoveTimeoutAsync_System_String_) + +#### Properties +We added a property called [CommunicationDisabledUntil](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_CommunicationDisabledUntil) to [DiscordMember](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html) + +#### Events (Unstable) +We added the following events for timeouts: +- [GuildMemberTimeoutAdded](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutAdded) Fired when a timeout gets added. +- [GuildMemberTimeoutChanged](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutChanged) Fired when a timeout gets updated. +- [GuildMemberTimeoutRemoved](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutRemoved) Fired when a timeout gets removed. + +#### Auditlogs +You can find the documentation for the timeout auditlog [here](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogMemberUpdateEntry.html#DisCatSharp_Entities_DiscordAuditLogMemberUpdateEntry_AddedRoles). + +### RestClient (Experimental) +We exposed our internal http client as the property [RestClient](https://docs.dcs.aitsys.dev/api/DisCatSharp.BaseDiscordClient.html#DisCatSharp_BaseDiscordClient_RestClient) on [DiscordBaseClient](https://docs.dcs.aitsys.dev/api/DisCatSharp.BaseDiscordClient.html) + +### DisCatSharp.Common +We added the following RegEx to this extension: +- [RegularExpressions.CommonRegEx](https://docs.dcs.aitsys.dev/api/DisCatSharp.Common.RegularExpressions.CommonRegEx.html) +- [RegularExpressions.DiscordRegEx](https://docs.dcs.aitsys.dev/api/DisCatSharp.Common.RegularExpressions.DiscordRegEx.html) +We use them mostly internally + +### Attachments +You can now set the alt text on your attachments! + +Visit the following docs for more infos: +[DiscordMessageFile.Description](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMessageFile.html#DisCatSharp_Entities_DiscordMessageFile_Description) +[DiscordAttachment.Description](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAttachment.html#DisCatSharp_Entities_DiscordAttachment_Description) + +Our last changelogs for that: +```diff ++ Added support for file description (aka. Alt Text) +You can supply a description to {DiscordMessageBuilder|DiscordFollowupMessageBuilder|DiscordInteractionResponseBuilder|DiscordWebhookBuilder}.WithFile +You can view the description property of files with {DiscordMessageFile|DiscordAttachment}.Description ++ Added function DiscordWebhookBuilder.KeepAttachments +This allows you to add / modify & replace / keep attachments on DiscordWebhookBuilders. ++ Full support for attachment operations on messages, webhooks & interactions +Methods are now ModifyAttachments, KeepAttachments & ClearAttachments +``` + +Snippet: +```csharp +[Command("ufwd"), Description(Download a jpg file from an url and upload upload it to discord with a description (alt text).")] +public async Task UploadFileWithDescriptionAsync(CommandContext ctx, [Description("Url of file")] string url, [RemainingText, Description("Description of file")] string description) +{ + Uri uri = new(url); + var stream = await ctx.Client.RestClient.GetStreamAsync(uri); + DiscordMessageBuilder builder = new(); + builder.WithFile("test.jpg", stream, false, description); + await ctx.RespondAsync(builder); +} +``` + +## Additional Notes +### Users +`DiscordClient.GetUserAsync` defaults now to `fetch=true`. + +### Interaction Locales +We already support the newly introduced `locale` and `guild_locale` fields on interactions! +- [ApplicationCommands.BaseContext.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_BaseContext_Locale) +- [ApplicationCommands.BaseContext.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_BaseContext_GuildLocale) +- [ApplicationCommands.AutocompleteContext.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_AutocompleteContext_Locale) +- [ApplicationCommands.AutocompleteContext.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_AutocompleteContext_GuildLocale) +- [DiscordInteraction.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordInteraction.html#DisCatSharp_Entities_DiscordInteraction_Locale) +- [DiscordInteraction.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordInteraction.html#DisCatSharp_Entities_DiscordInteraction_GuildLocale) + +### Modals & Slash Attachments +These who things are still in private beta sadly, but we added it already. + +Docs will be added on release from discord's side. + +### Application Command Translations +Wait.. this is a thing?! YES!!!! + +It's not yet released but I know that you love to see upcoming things. + +So feel free to take a look into [Articles](https://docs.dcs.aitsys.dev/articles/application_commands/translations/using.html). diff --git a/DisCatSharp.Docs/articles/preamble.md b/DisCatSharp.Docs/articles/preamble.md index 1b75ebf8a..9edb8bd6b 100644 --- a/DisCatSharp.Docs/articles/preamble.md +++ b/DisCatSharp.Docs/articles/preamble.md @@ -1,39 +1,39 @@ --- uid: preamble title: Article Preamble --- ## Knowledge Prerequisites Before attempting to write a Discord bot, you should be familiar with the concepts of [Object Oriented Programing](https://en.wikipedia.org/wiki/Object-oriented_programming), [the C# programming language](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/), and [Task-based Asynchronous Pattern](https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap). If you're brand new to C#, or programming in general, this library may prove difficult for you to use.
Fortunately, there are resources that can help you get started with the language! An excellent tutorial series to go through would be [C# Fundamentals for Absolute Beginners](https://channel9.msdn.com/Series/CSharp-Fundamentals-for-Absolute-Beginners) by Bob Tabor. His videos go through all the basics, from setting up your development environment up to some of the more advanced concepts. If you're not sure what to do first, Bob's tutorial series should be your starting point! ## Supported .NET Implementations DisCatSharp targets .NET Standard 2.1 means that there are many implementations that *may* function with DisCatSharp. However, the following versions we will *explicitly* provide support for. Implementation|Support|Notes :---: |:---:|:--- [.NET Core](https://en.wikipedia.org/wiki/.NET_Core)|✔️|LTS versions 2.1 & 3.1 & 5.0 and the current 6.0 are supported. [.NET Framework](https://en.wikipedia.org/wiki/.NET_Framework)|⚠️|Versions 4.6.1 through 4.8 *should* work fine.
But we recommend that you use the latest LTS version of .NET Core. [Mono](https://en.wikipedia.org/wiki/Mono_(software))|❌️|If you need a cross platform runtime, use .NET Core. [Unity](https://en.wikipedia.org/wiki/Unity_(game_engine))|❌️|Consider using the official [Discord GameSDK](https://discord.com/developers/docs/game-sdk/sdk-starter-guide) instead. If you use an unsupported implementation and encounter issues, you may ask for support but mostly you're on your own. ## Getting Started If you're writing a Discord bot for the first time, you'll want to start with *[creating a bot account](xref:basics_bot_account)*.
Otherwise, if you have a bot account already, start off with the *[writing your first bot](xref:basics_first_bot)* article.
Once you're up and running, feel free to browse through the [API Documentation](/api/index.html)! ## Support and Questions You can get in contact with us on Discord through the following guild: **DisCatSharp Guild**:
-[![DisCatSharp](https://discordapp.com/api/guilds/858089281214087179/embed.png?style=banner2)](https://discord.gg/discatsharp) +[![DisCatSharp](https://discordapp.com/api/guilds/858089281214087179/embed.png?style=banner2)](https://discord.gg/U4BGHpKSF7) diff --git a/DisCatSharp.Docs/index.md b/DisCatSharp.Docs/index.md index c6c6b0045..92c12b6f4 100644 --- a/DisCatSharp.Docs/index.md +++ b/DisCatSharp.Docs/index.md @@ -1,19 +1,19 @@ --- uid: index -title: DisCatSharp 9.X Documentation +title: DisCatSharp 9.8.5 Documentation --- -

DisCatSharp 9.X Documentation

+

DisCatSharp 9.8.5 Documentation

![DisCatSharp Logo](/logobig.png "DisCatSharp Documentation")

-## DisCatSharp 9.X Documentation -[DisCatSharp](https://github.com/Aiko-IT-Systems/DisCatSharp) (DCS) is an unofficial .NET wrapper for the [Discord API](https://discordapp.com/developers/docs/intro "Discord API") based on [DSharpPlus](https://github.com/DSharpPlus/DSharpPlus).
+## DisCatSharp 9.8.5 Documentation +[DisCatSharp](https://github.com/Aiko-IT-Systems/DisCatSharp) (DCS) is an unofficial .NET wrapper for the [Discord API](https://discordapp.com/developers/docs/intro "Discord API") based off [DSharpPlus](https://github.com/DSharpPlus/DSharpPlus).
The library has been rewritten to fit quality and API standards as well as target wider range of .NET implementations. Furthermore this lib will includes many new features of Discord and is pretty fast with keeping up with Discords API. ## Getting Started New users probably want to take a look into the [articles](xref:preamble) for quick start guides, tutorials, and examples of use.
Once you've gotten through the articles, head over to the [API Documentation](/api/index.html) for all classes and methods provided by this library. ## Source and Contributors DisCatSharp is licensed under MIT License, as detailed in the [license](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/master/LICENSE.md) found in the repository.
The repository containing the source code for this library can be found [here](https://github.com/Aiko-IT-Systems/DisCatSharp). Contributions are welcomed.
-You can find our [official guild here](https://discord.gg/discatsharp). +You can find our [official guild here](https://discord.gg/U4BGHpKSF7). diff --git a/README.md b/README.md index 3f26cd3c6..f2fd644b1 100644 --- a/README.md +++ b/README.md @@ -1,101 +1,102 @@ # DisCatSharp [![GitHub](https://img.shields.io/github/license/Aiko-IT-Systems/DisCatSharp?label=License)](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/LICENSE.md) [![Sponsors](https://img.shields.io/github/sponsors/Lulalaby?label=Sponsors)](https://github.com/sponsors/Lulalaby) [![Discord Server](https://img.shields.io/discord/858089281214087179.svg?label=Discord)](https://discord.gg/U4BGHpKSF7) ![dcs](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/DisCatSharp.Logos/android-chrome-192x192.png?raw=true) Discord Bot Library written in C# for .NET. #### Status [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.svg?label=NuGet%20Overall%20Version)](https://nuget.dcs.aitsys.dev) [![Build status](https://ci.appveyor.com/api/projects/status/fy4xn9s3cq7j30j7/branch/main?svg=true)](https://ci.appveyor.com/project/AITSYS/discatsharp/branch/main) #### Commit Activities [![GitHub last commit](https://img.shields.io/github/last-commit/Aiko-IT-Systems/DisCatSharp?label=Last%20Commit)](https://aitsys.dev/source/DisCatSharp/history/) [![GitHub commit activity](https://img.shields.io/github/commit-activity/w/Aiko-IT-Systems/DisCatSharp?label=Commit%20Activity)](https://github.com/Aiko-IT-Systems/DisCatSharp/commits/main) [![wakatime](https://wakatime.com/badge/github/Aiko-IT-Systems/DisCatSharp.svg)](https://wakatime.com/badge/github/Aiko-IT-Systems/DisCatSharp) #### Stats [![GitHub pull requests](https://img.shields.io/github/issues-pr/Aiko-IT-Systems/DisCatSharp?label=PRs)](https://github.com/Aiko-IT-Systems/DisCatSharp/pulls) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Aiko-IT-Systems/DisCatSharp?label=Size)](#) [![GitHub contributors](https://img.shields.io/github/contributors/Aiko-IT-Systems/DisCatSharp)](https://github.com/Aiko-IT-Systems/DisCatSharp/graphs/contributors) [![GitHub Repo stars](https://img.shields.io/github/stars/Aiko-IT-Systems/DisCatSharp?label=Stars)](https://github.com/Aiko-IT-Systems/DisCatSharp/stargazers) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5282/badge)](https://bestpractices.coreinfrastructure.org/projects/5282) [![StackShare](http://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/aiko-it-systems/discatsharp) ## Why DisCatSharp? We want the lib always up-to-date. The newest features are important for us. So the API version is always the newest, in the actual case `v9`. ## Where is the Changelog? On [our guild!](https://discord.gg/U4BGHpKSF7) You find it in [this channel](https://discord.com/channels/858089281214087179/858099438580006913). ## Installing You can install the library from following source: The latest release is always available on [NuGet](https://nuget.dcs.aitsys.dev). ## Documentation The documentation for the latest stable version is available at [docs.dcs.aitsys.dev/lts](https://docs.dcs.aitsys.dev/lts). The documentation of the latest nightly versions is available at [docs.dcs.aitsys.dev](https://docs.dcs.aitsys.dev). ## Bugs or Feature requests? Either join our [support guild](https://discord.gg/U4BGHpKSF7) and open a support ticket. Or write a mail to dcs@aitsys.dev. All requests are tracked at [aitsys.dev](https://aitsys.dev). ## Tutorials * [Howto](https://docs.dcs.aitsys.dev/articles/basics/bot_account.html) * [Examples](https://examples.dcs.aitsys.dev) ## Snippts [Snippets for Visual Studio](https://github.com/Aiko-IT-Systems/DisCatSharp.Snippets) ## Latest NuGet Packages | Package | NuGet | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | DisCatSharp | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp) | | DisCatSharp.ApplicationCommands | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.ApplicationCommands.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.ApplicationCommands) | | DisCatSharp.CommandsNext | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.CommandsNext.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.CommandsNext) | | DisCatSharp.Common | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Common.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Common) | | DisCatSharp.Configuration | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Configuration.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Configuration) | | DisCatSharp.Hosting | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Hosting.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Hosting) | | DisCatSharp.Hosting.DependencyInjection | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Hosting.DependencyInjection.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Hosting.DependencyInjection) | | DisCatSharp.Interactivity | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Interactivity.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Interactivity) | | DisCatSharp.Lavalink | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.Lavalink.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.Lavalink) | | DisCatSharp.VoiceNext | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.VoiceNext.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.VoiceNext) | | DisCatSharp.VoiceNext.Natives | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.VoiceNext.Natives.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.VoiceNext.Natives) | | DisCatSharp.ProjectTemplates | [![NuGet](https://img.shields.io/nuget/v/DisCatSharp.ProjectTemplates.svg?label=)](https://nuget.dcs.aitsys.dev/DisCatSharp.ProjectTemplates) | ## Releasing To release a new version do the following steps: - Create locally a repo named `release/VERSION` (Don't forget to replace VERSION with the target version number) - Replace version number with the correct version in [appveyor.yml#L78](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/appveyor.yml#L78) with the new release number and [appveyor.yml#L5](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/appveyor.yml#L5) with the next-ahead release number. - Replace nuget version number in [Version.targets#L4](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/Version.targets#L4) - Publish branch to GitHub - Wait for the CI/CD to complete. - Merge the branch into main and delete it afterwards ## Testing Docs Just visit [this](https://github.com/Aiko-IT-Systems/DisCatSharp/actions/workflows/docs-preview.yml) Workflow. The workflow generates a docs artifact and deploys on Cloudflare Pages. Visit the channel [#github-feed](https://discord.com/channels/858089281214087179/861507952509976607) on discord and watch for this message: ![Deploy](./cf-deploy.png) If you can't see it, take a look into the selfroles channel. ## Thanks -Big thanks goes to the following people who helps us ♥️ +Big thanks goes to the following people who helped us ♥️ - [Auros Nexus](https://github.com/Auros) - [Lunar Starstrum](https://github.com/OoLunar) - [Johannes](https://github.com/JMLutra) - [Geferon](https://github.com/geferon) - [Alice](https://github.com/QuantuChi) +- [Will](https://github.com/villChurch) ## Special Thanks The special thanks goes to Nagisa. Make sure to check out her [instagram](https://www.instagram.com/nagisaarts_/) ♥️♥️ diff --git a/SECURITY.md b/SECURITY.md index 50b849644..2ae5dfaa1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,13 +1,13 @@ # Security Policy ## Supported Versions | Version | Supported | | ------- | ------------------ | | > 9.8 | :white_check_mark: | | 9.7 | :white_check_mark: | | < 9.7 | :x: | ## Reporting a Vulnerability -Write an mail to support@aitsys.dev or open an ticket at our [guild](https://discord.gg/discatsharp). +Write an mail to support@aitsys.dev or open an ticket at our [guild](https://discord.gg/U4BGHpKSF7). diff --git a/appveyor.yml b/appveyor.yml index 29e646bde..381ac4b6d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,140 +1,140 @@ - branches: only: - main - version: 9.8.5-nightly-{build} + version: 9.8.6-nightly-{build} pull_requests: do_not_increment_build_number: true skip_tags: true max_jobs: 1 image: Visual Studio 2022 clone_depth: 1 build_script: - ps: |- # Version number $BUILD_NUMBER = [int]$Env:APPVEYOR_BUILD_NUMBER $BUILD_SUFFIX = "nightly" # Branch $BRANCH = "$Env:APPVEYOR_REPO_BRANCH" $Env:DOCFX_SOURCE_BRANCH_NAME = "$BRANCH" # Output directory $Env:ARTIFACT_DIR = ".\artifacts" $dir = New-Item -type directory $env:ARTIFACT_DIR $dir = $dir.FullName # Verbosity Write-Host "Build: $BUILD_NUMBER / Branch: $BRANCH" Write-Host "Artifacts will be placed in: $dir" # Check if this is a PR if (-not $Env:APPVEYOR_PULL_REQUEST_NUMBER) { Write-Host "Commencing complete build" & .\rebuild-all.ps1 -ArtifactLocation "$dir" -Configuration "Release" -VersionSuffix "$BUILD_SUFFIX" -BuildNumber $BUILD_NUMBER & Remove-Item "$dir\*.symbols.nupkg" } else { Write-Host "Building from PR ($Env:APPVEYOR_PULL_REQUEST_NUMBER)" & .\rebuild-all.ps1 -ArtifactLocation "$dir" -Configuration "Release" -VersionSuffix "$BUILD_SUFFIX" -BuildNumber $BUILD_NUMBER & Remove-Item "$dir\*.symbols.nupkg" } artifacts: - path: artifacts\*.snupkg - path: artifacts\*.nupkg - path: artifacts\dcs-docs.tar.xz deploy: - provider: NuGet server: api_key: secure: eml4lPttwjBZg7WdwX3tbx34ZDNssgb2zwthatNbolRY0PnaCIswbuPClf9IWrw7 skip_symbols: false - provider: GitHub auth_token: secure: oMF8sv9mhVjO7pBctQOwlmfd5aHQ4hvMoVCz77bgO9+1zBQSelPHxk0bCVfXNCCp prerelease: true force_update: true - provider: NuGet server: https://nuget.pkg.github.com/Aiko-IT-Systems/index.json username: lulalaby api_key: secure: SBGo8KrGJ7t5wwMNHKD0WSzrQ+PLJbqXE3FtDH2yGkSrQewO+kzmwp/xGk5a84He skip_symbols: true on_success: - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - ps: ./send.ps1 success $env:WEBHOOK_URL on_failure: - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - ps: ./send.ps1 failure $env:WEBHOOK_URL # Releases - branches: only: - /release/ - version: 9.8.4 + version: 9.8.5 pull_requests: do_not_increment_build_number: true skip_tags: true max_jobs: 1 image: Visual Studio 2022 clone_depth: 1 build_script: - ps: |- # Version number $BUILD_NUMBER = [int]$Env:APPVEYOR_BUILD_NUMBER # Branch $BRANCH = "$Env:APPVEYOR_REPO_BRANCH" $Env:DOCFX_SOURCE_BRANCH_NAME = "$BRANCH" # Output directory $Env:ARTIFACT_DIR = ".\artifacts" $dir = New-Item -type directory $env:ARTIFACT_DIR $dir = $dir.FullName # Verbosity Write-Host "Build: $BUILD_NUMBER / Branch: $BRANCH" Write-Host "Artifacts will be placed in: $dir" # Check if this is a PR if (-not $Env:APPVEYOR_PULL_REQUEST_NUMBER) { Write-Host "Commencing complete build" & .\rebuild-all.ps1 -ArtifactLocation "$dir" -Configuration "Release" -VersionSuffix "$BUILD_SUFFIX" -BuildNumber $BUILD_NUMBER & Remove-Item "$dir\*.symbols.nupkg" } else { Write-Host "Building from PR ($Env:APPVEYOR_PULL_REQUEST_NUMBER)" & .\rebuild-all.ps1 -ArtifactLocation "$dir" -Configuration "Release" -VersionSuffix "$BUILD_SUFFIX" -BuildNumber $BUILD_NUMBER & Remove-Item "$dir\*.symbols.nupkg" } artifacts: - path: artifacts\*.snupkg - path: artifacts\*.nupkg - path: artifacts\dcs-docs.tar.xz deploy: - provider: NuGet server: api_key: secure: eml4lPttwjBZg7WdwX3tbx34ZDNssgb2zwthatNbolRY0PnaCIswbuPClf9IWrw7 skip_symbols: false - provider: GitHub auth_token: secure: oMF8sv9mhVjO7pBctQOwlmfd5aHQ4hvMoVCz77bgO9+1zBQSelPHxk0bCVfXNCCp prerelease: false force_update: true - provider: NuGet server: https://nuget.pkg.github.com/Aiko-IT-Systems/index.json username: lulalaby api_key: secure: SBGo8KrGJ7t5wwMNHKD0WSzrQ+PLJbqXE3FtDH2yGkSrQewO+kzmwp/xGk5a84He skip_symbols: true on_success: - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - ps: ./send.ps1 success $env:WEBHOOK_URL on_failure: - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - ps: ./send.ps1 failure $env:WEBHOOK_URL