diff --git a/DisCatSharp.Docs/articles/getting_started/templates.md b/DisCatSharp.Docs/articles/getting_started/templates.md index 0128cbe620..5019638bb4 100644 --- a/DisCatSharp.Docs/articles/getting_started/templates.md +++ b/DisCatSharp.Docs/articles/getting_started/templates.md @@ -4,6 +4,9 @@ title: Project Templates author: DisCatSharp Team --- +> [!WARNING] +> The project templates are currently unmaintained and may not work as expected. + # Prerequisites Install the following packages: diff --git a/DisCatSharp.Docs/articles/toc.yml b/DisCatSharp.Docs/articles/toc.yml index 6d0bda885b..9c5b459991 100644 --- a/DisCatSharp.Docs/articles/toc.yml +++ b/DisCatSharp.Docs/articles/toc.yml @@ -1,92 +1,58 @@ items: - name: Preamble - href: index.md + uid: preamble - name: FAQ - href: faq.md + uid: faq - name: Getting Started items: - name: Creating a Bot Account - href: getting_started/bot_account.md + uid: getting_started_bot_account - name: Writing Your First Bot - href: getting_started/first_bot.md + uid: getting_started_first_bot - name: Bot as Hosted Service - href: getting_started/web_app.md + uid: getting_started_web_app - name: Project Templates - href: getting_started/templates.md - - name: Experimental - items: - - name: Preamble - uid: experimental_preamble - - name: ElasticSearch-Based Member Search - uid: experimental_search_guild_members - - name: GCP Attachments - uid: experimental_gcp_attachments - - name: Topics - items: - - name: Events - href: topics/events.md - - name: Logging - items: - - name: The Default Logger - href: topics/logging/default.md - - name: Third Party Loggers - href: topics/logging/third_party.md - - name: Dependency Injection Loggers - href: topics/logging/di.md - - name: Intents - href: topics/intents.md - - name: Sharding - href: topics/sharding.md - - name: Message Builder - href: topics/messagebuilder.md - - name: Components - items: - - name: Buttons - href: topics/components/buttons.md - - name: Select Menu - href: topics/components/select_menus.md - - name: Workarounds - href: topics/workarounds.md + uid: getting_started_templates - name: Modules items: - name: Application Commands items: - name: Introduction - href: modules/application_commands/intro.md + uid: modules_application_commands_intro - name: Options - href: modules/application_commands/options.md + uid: modules_application_commands_options - name: Events - href: modules/application_commands/events.md + uid: modules_application_commands_events - name: Translations items: - name: Using Translations - href: modules/application_commands/translations/using.md + uid: modules_application_commands_translations_using - name: Translation Reference - href: modules/application_commands/translations/reference.md + uid: modules_application_commands_translations_reference - name: Modals - href: modules/application_commands/modals.md + uid: modules_application_commands_modals - name: Paginated Modals - href: modules/application_commands/paginated_modals.md + uid: modules_application_commands_paginated_modals - name: Cooldowns - href: modules/application_commands/cooldowns.md + uid: modules_application_commands_cooldowns - name: CommandsNext items: - name: Introduction - href: modules/commandsnext/intro.md + uid: modules_commandsnext_intro - name: Command Attributes - href: modules/commandsnext/command_attributes.md + uid: modules_commandsnext_command_attributes - name: Dependency Injection - href: modules/commandsnext/dependency_injection.md + uid: modules_commandsnext_dependency_injection - name: Customization items: - name: Help Formatter - href: modules/commandsnext/customization/help_formatter.md + uid: modules_commandsnext_customization_help_formatter - name: Argument Converters - href: modules/commandsnext/customization/argument_converters.md + uid: modules_commandsnext_customization_argument_converters - name: Command Handler - href: modules/commandsnext/customization/command_handler.md + uid: modules_commandsnext_customization_command_handler - name: Cooldowns - href: modules/commandsnext/cooldowns.md + uid: modules_commandsnext_cooldowns - name: Audio items: - name: Lavalink V4 @@ -121,19 +87,53 @@ items: items: - name: Interactivity Introduction uid: modules_interactivity_introduction + - name: Topics + items: + - name: Events + uid: topics_events + - name: Logging + items: + - name: The Default Logger + uid: topics_logging_default + - name: Third Party Loggers + uid: topics_logging_third_party + - name: Dependency Injection Loggers + uid: topics_logging_di + - name: Intents + uid: topics_intents + - name: Sharding + uid: topics_sharding + - name: Message Builder + uid: topics_sharding + - name: Components + items: + - name: Buttons + uid: topics_components_buttons + - name: Select Menu + uid: topics_components_select_menus + - name: Components V2 + href: '#' + - name: Workarounds + uid: topics_workarounds + - name: Experimental + items: + - name: Preamble + uid: experimental_preamble + - name: ElasticSearch-Based Member Search + uid: experimental_search_guild_members + - name: GCP Attachments + uid: experimental_gcp_attachments - name: Miscellaneous items: - name: Nightly Builds - href: misc/nightly_builds.md + uid: misc_nightly_builds - name: Reporting Issues - href: misc/reporting_issues.md + uid: misc_reporting_issues - name: Hosting - href: misc/hosting.md - - name: Voice Activities - href: misc/voice_activities.md + uid: misc_hosting - name: Sentry - href: misc/sentry.md + uid: misc_sentry - name: Security & Compliance items: - name: Sentry Safety Report - href: sec_comp/sentry.md \ No newline at end of file + uid: sec_comp_sentry \ No newline at end of file diff --git a/DisCatSharp.Docs/changelogs/v9/9_8_2.md b/DisCatSharp.Docs/changelogs/v9/9_8_2.md deleted file mode 100644 index 858287735c..0000000000 --- a/DisCatSharp.Docs/changelogs/v9/9_8_2.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -uid: changelogs_v9_9_8_2 -title: Version 9.8.2 -author: DisCatSharp Team ---- - -# What changed? - -Discord [changed](https://discord.com/developers/docs/interactions/slash-commands) **SlashCommands** into **Application Commands** in favor of the new context menu stuff. -You can read about it [here](https://discord.com/developers/docs/interactions/application-commands). - -## Upgrade from **DisCatSharp.SlashCommands** to **DisCatSharp.ApplicationCommands** - -In **DisCatSharp.SlashCommands** you used Application Commands like this: - -```cs -// Usage directives -using DisCatSharp.SlashCommands; -using DisCatSharp.SlashCommands.EventArgs; - -// Extension - public static SlashCommandsExtension Slash; - -// Injecting SlashCommands - Client.UseSlashCommands(); - Slash = Client.GetSlashCommands(); - -// Registration of commands and events - Slash.SlashCommandErrored += Slash_SlashCommandErrored; - Slash.SlashCommandExecuted += Slash_SlashCommandExecuted; - - Slash.RegisterCommands(); - -// Events - public static Task Slash_SlashCommandExecuted(SlashCommandsExtension sender, SlashCommandExecutedEventArgs e) - { - Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); - return Task.CompletedTask; - } - - public static Task Slash_SlashCommandErrored(SlashCommandsExtension sender, SlashCommandErrorEventArgs e) - { - Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); - return Task.CompletedTask; - } - -// Commands -using DisCatSharp; -using DisCatSharp.Entities; -using DisCatSharp.SlashCommands; -using DisCatSharp.SlashCommands.Attributes; -namespace TestBot.SlashCommands -{ - internal class Main : SlashCommandModule - { - - [SlashCommand("test", "A slash command made to test the DisCatSharp library!")] - public static async Task TestCommand(InteractionContext ctx) - { - await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource); - await Task.Delay(5000); - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("5 second delay complete!")); - } - } -} -``` - -In **DisCatSharp.ApplicationCommands** you use them like this: - -```cs -// Usage directives -using DisCatSharp.ApplicationCommands; -using DisCatSharp.ApplicationCommands.EventArgs; - -// Extension - public static ApplicationCommandsExtension ApplicationCommands; - -// Injecting SlashCommands - Client.UseApplicationCommands(); - ApplicationCommands = Client.GetApplicationCommands(); - -// Registration of commands and events - ApplicationCommands.SlashCommandExecuted += Ac_SlashCommandExecuted; - ApplicationCommands.SlashCommandErrored += Ac_SlashCommandErrored; - /* New stuff - context menu */ - ApplicationCommands.ContextMenuExecuted += Ac_ContextMenuExecuted; - ApplicationCommands.ContextMenuErrored += Ac_ContextMenuErrored; - - ApplicationCommands.RegisterCommands(); - -// Events - public static Task Ac_SlashCommandExecuted(ApplicationCommandsExtension sender, SlashCommandExecutedEventArgs e) - { - Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); - return Task.CompletedTask; - } - - public static Task Ac_SlashCommandErrored(ApplicationCommandsExtension sender, SlashCommandErrorEventArgs e) - { - Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); - return Task.CompletedTask; - } - - public static Task Ac_ContextMenuExecuted(ApplicationCommandsExtension sender, ContextMenuExecutedEventArgs e) - { - Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); - return Task.CompletedTask; - } - - public static Task Ac_ContextMenuErrored(ApplicationCommandsExtension sender, ContextMenuErrorEventArgs e) - { - Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); - return Task.CompletedTask; - } - -// Commands -using DisCatSharp; -using DisCatSharp.Entities; -using DisCatSharp.Enums; -using DisCatSharp.ApplicationCommands; -using DisCatSharp.ApplicationCommands.Attributes; -namespace TestBot.ApplicationCommands -{ - internal class Main : ApplicationCommandsModule - { - - [SlashCommand("test", "A slash command made to test the DisCatSharp library!")] - public static async Task TestCommand(InteractionContext ctx) - { - await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource); - await Task.Delay(5000); - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("5 second delay complete!")); - } - } -} -``` diff --git a/DisCatSharp.Docs/changelogs/v9/9_8_3.md b/DisCatSharp.Docs/changelogs/v9/9_8_3.md deleted file mode 100644 index 2c998e0adc..0000000000 --- a/DisCatSharp.Docs/changelogs/v9/9_8_3.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -uid: changelogs_v9_9_8_3 -title: Version 9.8.3 -author: DisCatSharp Team ---- - -# What changed? - -We [changed](https://canary.discord.com/channels/858089281214087179/858099438580006913/890973133148926004) the option to restrict channel types in Slash Commands to an extra Attribute named `ChannelTypes` in favor of the application command autocompletion. -You can read about it [here](https://github.com/discord/discord-api-docs/pull/3849). - -## Upgrade from **9.8.2** to **9.8.3** - -In **DisCatSharp.ApplicationCommands** you restricted channel types like this: - -```cs -[SlashCommand("openstage", "Opens a stage")] -public static async Task OpenStageAsync(InteractionContext ctx, - [Option("stage", "Stage Channel", ChannelType.Stage)] DiscordChannel stage, - [Option("topic", "Topic of stage")] string topic, - [Option("notify", "Whether to notify people")] bool notify = false, - [Option("make_public", "Whether the stage channel will be public")] bool make_public = false) -{ - try - { - await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Opening stage").AsEphemeral(true)); - await stage.OpenStageAsync(topic, notify, make_public ? StagePrivacyLevel.PUBLIC : StagePrivacyLevel.GUILD_ONLY); - await ctx.EditResponseAsync(new() - { - Content = "Stage channel has been successfully opened." - }); - } - catch (Exception ex) - { - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent(ex.Message + " " + ex.StackTrace)); - } -} -``` - -In **DisCatSharp.ApplicationCommands** you restrict channel types now like this: - -```cs -[SlashCommand("openstage", "Opens a stage")] -public static async Task OpenStageAsync(InteractionContext ctx, - [Option("stage", "Stage Channel"), ChannelTypes(ChannelType.Stage)] DiscordChannel stage, - [Option("topic", "Topic of stage")] string topic, - [Option("notify", "Whether to notify people")] bool notify = false, - [Option("make_public", "Whether the stage channel will be public")] bool make_public = false) -{ - try - { - await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Opening stage").AsEphemeral(true)); - await stage.OpenStageAsync(topic, notify, make_public ? StagePrivacyLevel.PUBLIC : StagePrivacyLevel.GUILD_ONLY); - await ctx.EditResponseAsync(new() - { - Content = "Stage channel has been successfully opened." - }); - } - catch (Exception ex) - { - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent(ex.Message + " " + ex.StackTrace)); - } -} -``` - -## New function: Application Command Autocompletion: - -Examples: - -> Autocomplete Option: https://github.com/Aiko-IT-Systems/DisCatSharp.Examples/blob/main/ApplicationCommands/src/Commands/Tags.cs#L34 - -> Autocomplete Provider: https://github.com/Aiko-IT-Systems/DisCatSharp.Examples/blob/main/ApplicationCommands/src/Commands/Tags.cs#L168 - -Docs: -https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.Attributes.AutocompleteAttribute.html -https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.Attributes.IAutocompleteProvider.html -https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplicationCommandAutocompleteChoice.html -https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.OptionAttribute.html#DisCatSharp_ApplicationCommands_OptionAttribute__ctor_System_String_System_String_System_Boolean_ diff --git a/DisCatSharp.Docs/changelogs/v9/9_8_4.md b/DisCatSharp.Docs/changelogs/v9/9_8_4.md deleted file mode 100644 index ae9cce76e8..0000000000 --- a/DisCatSharp.Docs/changelogs/v9/9_8_4.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -uid: changelogs_v9_9_8_4 -title: Version 9.8.4 -author: DisCatSharp Team ---- - -# Upgrade from **9.8.3** to **9.8.4** - -## What is new in #discatsharp? - -- Components -- Scheduled Events -- New Application Fields -- A ExecuteRawRequest Method -- Threads -- Hosting Packages -- New Templates -- Better Guild Channel Operations -- New Permissions -- New Application Command Permission (Not v2 yet) -- A new Logo :3 :heart: - -## What changed? - -### Threads - -We have fixed many bugs in threads over time, and they work completely now. - -- [DisCatSharp.Net.Models.ThreadEditModel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Net.Models.ThreadEditModel.html) has a new field called [PerUserRateLimit](https://docs.dcs.aitsys.dev/api/DisCatSharp.Net.Models.ThreadEditModel.html#DisCatSharp_Net_Models_ThreadEditModel_PerUserRateLimit). -- [DisCatSharp.Entities.DiscordThreadChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordThreadChannel.html) now supports [DisCatSharp.Entities.DiscordThreadChannel#GetMemberAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordThreadChannel.html?q=DiscordThreadChannel#DisCatSharp_Entities_DiscordThreadChannel_GetMemberAsync_System_UInt64_) - -### Components - -We support every Component available on the API. - -### Discord Application Object - -[DiscordApplication](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html) now includes the property fields: - -- [CustomInstallUrl](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_CustomInstallUrl) -- [InstallParams](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_InstallParams) -- [Tags](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_Tags) - -You can find the settings for these fields in the [Discord Developer Portal](https://discord.com/developers/applications). - -### Scheduled Events - -The new scheduled events are already fully supported by us. - -**Entities:** - -- [DisCatSharp.Entities.DiscordScheduledEvent](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEvent.html) -- [DisCatSharp.Entities.DiscordScheduledEventEntityMetadata](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEventEntityMetadata.html) -- [DisCatSharp.Entities.DiscordScheduledEventUser](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEventUser.html) - -**Emums:** - -- [DisCatSharp.ScheduledEventEntityType](https://docs.dcs.aitsys.dev/api/DisCatSharp.ScheduledEventEntityType.html) -- [DisCatSharp.ScheduledEventStatus](https://docs.dcs.aitsys.dev/api/DisCatSharp.ScheduledEventStatus.html) - -**Events:** - -- [DisCatSharp.EventArgs.GuildScheduledEventCreateEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventCreateEventArgs.html) -- [DisCatSharp.EventArgs.GuildScheduledEventUpdateEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUpdateEventArgs.html) -- [DisCatSharp.EventArgs.GuildScheduledEventDeleteEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventDeleteEventArgs.html) -- [DisCatSharp.EventArgs.GuildScheduledEventUserAddEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUserAddEventArgs.html) -- [DisCatSharp.EventArgs.GuildScheduledEventUserRemoveEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUserRemoveEventArgs.html) - -**Models:** - -- [DisCatSharp.Net.Models.ScheduledEventEditModel](https://docs.dcs.aitsys.dev/events/api/DisCatSharp.Net.Models.ScheduledEventEditModel.html) - -**Extra Properties:** - -- [DisCatSharp.Entities.DiscordGuild#ScheduledEvents](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_ScheduledEvents) - -**Extra Methods:** - -- [DisCatSharp.Entities.DiscordGuild#CreateScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_CreateScheduledEventAsync_System_String_DateTimeOffset_System_Nullable_DateTimeOffset__DisCatSharp_Entities_DiscordChannel_DisCatSharp_Entities_DiscordScheduledEventEntityMetadata_System_String_DisCatSharp_ScheduledEventEntityType_System_String_) -- [DisCatSharp.Entities.DiscordGuild#CreateExternalScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_CreateExternalScheduledEventAsync_System_String_DateTimeOffset_DateTimeOffset_System_String_System_String_System_String_) -- [DisCatSharp.Entities.DiscordGuild#GetScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetScheduledEventAsync_DisCatSharp_Entities_DiscordScheduledEvent_System_Nullable_System_Boolean__) -- [DisCatSharp.Entities.DiscordGuild#GetScheduledEventsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetScheduledEventsAsync_System_Nullable_System_Boolean__) -- [DisCatSharp.Entities.DiscordChannel#CreateScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_CreateScheduledEventAsync_System_String_DateTimeOffset_System_String_System_String_) - -### Audit Log - -- [DisCatSharp.Entities.DiscordAuditLogGuildEntry](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogGuildEntry.html) has the new field [PremiumProgressBarChange](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogGuildEntry.html#DisCatSharp_Entities_DiscordAuditLogGuildEntry_PremiumProgressBarChange) -- Added [DisCatSharp.Entities.DiscordAuditLogScheduledEventEntry](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogScheduledEventEntry.html) - -### Enums - -We've updated some enums to reflect the [API Documentation](https://discord.com/developers/docs/intro) of Discord: - -- [DisCatSharp.PremiumTier](https://docs.dcs.aitsys.dev/api/DisCatSharp.PremiumTier.html) -- [DisCatSharp.StagePrivacyLevel](https://docs.dcs.aitsys.dev/api/DisCatSharp.StagePrivacyLevel.html) -- [DisCatSharp.UserFlags](https://docs.dcs.aitsys.dev/api/DisCatSharp.UserFlags.html) - -### DisCatSharp.CommandsNext - -- `RequireDiscordEmployeeAttribute` is now `RequireStaffAttribute` -- `RequireDiscordCertifiedModeratorAttribute` is now `RequireCertifiedModeratorAttribute` - -### ExecuteRawRequest - -We added the [ExecuteRawRequestAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_ExecuteRawRequestAsync_RestRequestMethod_System_String_System_Object_System_String_Dictionary_System_String_System_String__System_Nullable_System_Double__) method. - -### Better Guild Channel Operations - -We did some engineering in the Discord API to create a method which gets an [ordered channel dictionary](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_OrderedChannels). - -Furthermore, we added a few new functions to [DisCatSharp.Entities.DiscordGuild](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.): - -- [DisCatSharp.Entities.DiscordGuild#GetOrderedChannels](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetOrderedChannels) -- [DisCatSharp.Entities.DiscordGuild#GetOrderedChannelsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetOrderedChannelsAsync) - -And a couple more methods to [DisCatSharp.Entities.DiscordChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel): - -- [DisCatSharp.Entities.DiscordChannel#GetMinPosition](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_GetMinPosition) -- [DisCatSharp.Entities.DiscordChannel#GetMaxPosition](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_GetMaxPosition) -- [DisCatSharp.Entities.DiscordChannel#ModifyPositionAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyPositionAsync_System_Int32_System_String_) -- [DisCatSharp.Entities.DiscordChannel#RefreshPositionsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_RefreshPositionsAsync) -- [DisCatSharp.Entities.DiscordChannel#ModifyPositionInCategorySmartAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyPositionInCategoryAsync_System_Int32_System_String_) -- [DisCatSharp.Entities.DiscordChannel#ModifyParentAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyParentAsync_DisCatSharp_Entities_DiscordChannel_System_Nullable_System_Boolean__System_String_) -- [DisCatSharp.Entities.DiscordChannel#RemoveParentAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_RemoveParentAsync_System_String_) - -### New Permissions - -- SendMessagesInThreads -- StartEmbeddedActivities -- ManageEvents - -### New Application Command Permission (Not v2 yet) - -- [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddUser](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddUser_System_UInt64_System_Boolean_) -- [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddRole](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddRole_System_UInt64_System_Boolean_) -- [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddChannel_System_UInt64_System_Boolean_) - -### New Templates - -We added a few templates for you: - -- [DisCatSharp.ProjectTemplates](https://github.com/Aiko-IT-Systems/DisCatSharp.ProjectTemplates) -- [DisCatSharp.TemplateBot](https://github.com/Aiko-IT-Systems/DisCatSharp.TemplateBot) - -### Hosting Packages - -You can run your bot as a hosted service now! - -If you're interested, check out this [article](https://docs.dcs.aitsys.dev/articles/getting_started/web_app.html). - -You can also check out our new [templates](https://docs.dcs.aitsys.dev/articles/getting_started/templates.html)! diff --git a/DisCatSharp.Docs/changelogs/v9/9_8_5.md b/DisCatSharp.Docs/changelogs/v9/9_8_5.md deleted file mode 100644 index 103adc019a..0000000000 --- a/DisCatSharp.Docs/changelogs/v9/9_8_5.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -uid: changelogs_v9_9_8_5 -title: Version 9.8.5 -author: DisCatSharp Team ---- - -# 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/changelogs/v9/9_9_0.md b/DisCatSharp.Docs/changelogs/v9/9_9_0.md deleted file mode 100644 index 0bda45495c..0000000000 --- a/DisCatSharp.Docs/changelogs/v9/9_9_0.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -uid: changelogs_v9_9_9_0 -title: Version 9.9.0 -author: DisCatSharp Team ---- - -# Upgrade from **9.8.6** to **9.9.0** - -## What is new in DisCatSharp? - -- Slash Attachments -- [DisCatSharp.Common.RegularExpressions](xref:DisCatSharp.Common.RegularExpressions) - -## What changed? - -This will be a quick one: - -- [DiscordInvite](xref:DisCatSharp.Entities.DiscordInvite) has the property `InviteTarget` to support user invites. -- A few NRE's where fixed -- Guild scheduled events support uploading a cover image -- [DiscordThreadChannel](xref:DisCatSharp.Entities.DiscordThreadChannel) has the new property `CreateTimestamp` -- The AsEphemeral functions defaulting to `true` now -- Slash Attachments fully works -- You can let the [ApplicationCommandsModule](xref:DisCatSharp.ApplicationCommands.ApplicationCommandsModule) auto defer all responses diff --git a/DisCatSharp.Docs/vs/toc.yml b/DisCatSharp.Docs/vs/toc.yml index 1406671477..e8bc3e5421 100644 --- a/DisCatSharp.Docs/vs/toc.yml +++ b/DisCatSharp.Docs/vs/toc.yml @@ -1,20 +1,20 @@ items: - name: Visual Studio Tools - href: index.md + uid: vs - name: Analyzer expanded: true items: - name: DisCatSharp Analyzer items: - name: DCS0001 - href: analyzer/dcs/0001.md + uid: vs_analyzer_dcs_0001 - name: DCS0002 - href: analyzer/dcs/0002.md + uid: vs_analyzer_dcs_0002 - name: DCS0101 - href: analyzer/dcs/0101.md + uid: vs_analyzer_dcs_0101 - name: DCS0102 - href: analyzer/dcs/0102.md + uid: vs_analyzer_dcs_0102 - name: DCS0103 - href: analyzer/dcs/0103.md + uid: vs_analyzer_dcs_0103 - name: DCS0200 - href: analyzer/dcs/0200.md + uid: vs_analyzer_dcs_0200