From df8a0f7cd658d99f04964051ae81bfa0797c4447 Mon Sep 17 00:00:00 2001 From: Bram <35614609+BramEsendam@users.noreply.github.com> Date: Fri, 4 Sep 2020 18:56:05 +0200 Subject: [PATCH] Fix: Not using the new domain name. (#1571) * Fix: Using the correct discord domain. * Fix: Using the correct discord domain. * Docs: Using the correct discord domain. * Fix: Changed canary and ptb to the new domain. --- README.md | 2 +- .../Common/EmbedObjectBuilder.Inclusion.md | 6 +++--- docs/faq/basics/client-basics.md | 2 +- docs/faq/misc/glossary.md | 4 ++-- docs/guides/getting_started/first-bot.md | 10 +++++----- docs/index.md | 4 ++-- samples/04_webhook_client/Program.cs | 8 ++++---- src/Discord.Net.Core/DiscordConfig.cs | 4 ++-- src/Discord.Net.Core/Extensions/MessageExtensions.cs | 2 +- src/Discord.Net.Core/Net/HttpException.cs | 4 ++-- src/Discord.Net.Core/Net/WebSocketClosedException.cs | 2 +- src/Discord.Net.WebSocket/DiscordSocketConfig.cs | 2 +- test/Discord.Net.Tests.Unit/TokenUtilsTests.cs | 2 +- test/Discord.Net.Tests/Tests.DiscordWebhookClient.cs | 12 ++++++------ 14 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index f4bc5811e..1d9235331 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NuGet](https://img.shields.io/nuget/vpre/Discord.Net.svg?maxAge=2592000?style=plastic)](https://www.nuget.org/packages/Discord.Net) [![MyGet](https://img.shields.io/myget/discord-net/vpre/Discord.Net.svg)](https://www.myget.org/feed/Packages/discord-net) [![Build Status](https://dev.azure.com/discord-net/Discord.Net/_apis/build/status/discord-net.Discord.Net?branchName=dev)](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev) -[![Discord](https://discordapp.com/api/guilds/81384788765712384/widget.png)](https://discord.gg/jkrBmQR) +[![Discord](https://discord.com/api/guilds/81384788765712384/widget.png)](https://discord.gg/jkrBmQR) An unofficial .NET API Wrapper for the Discord client (http://discordapp.com). diff --git a/docs/_overwrites/Common/EmbedObjectBuilder.Inclusion.md b/docs/_overwrites/Common/EmbedObjectBuilder.Inclusion.md index eac0d9ca5..a9d3539ed 100644 --- a/docs/_overwrites/Common/EmbedObjectBuilder.Inclusion.md +++ b/docs/_overwrites/Common/EmbedObjectBuilder.Inclusion.md @@ -4,10 +4,10 @@ field, and 2 normal fields using an @Discord.EmbedBuilder: ```cs var exampleAuthor = new EmbedAuthorBuilder() .WithName("I am a bot") - .WithIconUrl("https://discordapp.com/assets/e05ead6e6ebc08df9291738d0aa6986d.png"); + .WithIconUrl("https://discord.com/assets/e05ead6e6ebc08df9291738d0aa6986d.png"); var exampleFooter = new EmbedFooterBuilder() .WithText("I am a nice footer") - .WithIconUrl("https://discordapp.com/assets/28174a34e77bb5e5310ced9f95cb480b.png"); + .WithIconUrl("https://discord.com/assets/28174a34e77bb5e5310ced9f95cb480b.png"); var exampleField = new EmbedFieldBuilder() .WithName("Title of Another Field") .WithValue("I am an [example](https://example.com).") @@ -22,4 +22,4 @@ var embed = new EmbedBuilder() .WithAuthor(exampleAuthor) .WithFooter(exampleFooter) .Build(); -``` \ No newline at end of file +``` diff --git a/docs/faq/basics/client-basics.md b/docs/faq/basics/client-basics.md index 9377ac2e9..1176ee3fd 100644 --- a/docs/faq/basics/client-basics.md +++ b/docs/faq/basics/client-basics.md @@ -30,7 +30,7 @@ There are few possible reasons why this may occur. [TokenType]: xref:Discord.TokenType [827]: https://github.com/RogueException/Discord.Net/issues/827 [958]: https://github.com/RogueException/Discord.Net/issues/958 -[Discord API Terms of Service]: https://discordapp.com/developers/docs/legal +[Discord API Terms of Service]: https://discord.com/developers/docs/legal ## How do I do X, Y, Z when my bot connects/logs on? Why do I get a `NullReferenceException` upon calling any client methods after connect? diff --git a/docs/faq/misc/glossary.md b/docs/faq/misc/glossary.md index 95bdbaa03..4b661f65c 100644 --- a/docs/faq/misc/glossary.md +++ b/docs/faq/misc/glossary.md @@ -19,7 +19,7 @@ channels, and are often referred to as "servers". * A **Channel** ([IChannel]) represents a generic channel. - Example: #dotnet_discord-net - See [Channel Types](#channel-types) - + [IGuild]: xref:Discord.IGuild [IChannel]: xref:Discord.IChannel @@ -79,4 +79,4 @@ activity for listening to a song on Spotify. [RichGame]: xref:Discord.RichGame [StreamingGame]: xref:Discord.StreamingGame [SpotifyGame]: xref:Discord.SpotifyGame -[Rich Presence Intro]: https://discordapp.com/developers/docs/rich-presence/best-practices \ No newline at end of file +[Rich Presence Intro]: https://discord.com/developers/docs/rich-presence/best-practices diff --git a/docs/guides/getting_started/first-bot.md b/docs/guides/getting_started/first-bot.md index bdae80c7f..150466be1 100644 --- a/docs/guides/getting_started/first-bot.md +++ b/docs/guides/getting_started/first-bot.md @@ -31,7 +31,7 @@ the Discord Applications Portal first. ![Step 7](images/intro-public-bot.png) -[Discord Applications Portal]: https://discordapp.com/developers/applications/ +[Discord Applications Portal]: https://discord.com/developers/applications/ ## Adding your bot to a server @@ -165,11 +165,11 @@ or any other blocking method, such as reading from the console. > the source code for your bot. > > In the following example, we retrieve the token from a pre-defined -> variable, which is **NOT** secure, especially if you plan on +> variable, which is **NOT** secure, especially if you plan on > distributing the application in any shape or form. > -> We recommend alternative storage such as -> [Environment Variables], an external configuration file, or a +> We recommend alternative storage such as +> [Environment Variables], an external configuration file, or a > secrets manager for safe-handling of secrets. > > [Environment Variables]: https://en.wikipedia.org/wiki/Environment_variable @@ -221,4 +221,4 @@ should be to separate... 2. the modules (handle commands) 3. the services (persistent storage, pure functions, data manipulation) -[CommandService]: xref:Discord.Commands.CommandService \ No newline at end of file +[CommandService]: xref:Discord.Commands.CommandService diff --git a/docs/index.md b/docs/index.md index 34350df70..1d0f5aaf7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,12 +11,12 @@ title: Home [![NuGet](https://img.shields.io/nuget/vpre/Discord.Net.svg?maxAge=2592000?style=plastic)](https://www.nuget.org/packages/Discord.Net) [![MyGet](https://img.shields.io/myget/discord-net/vpre/Discord.Net.svg)](https://www.myget.org/feed/Packages/discord-net) [![Build Status](https://dev.azure.com/discord-net/Discord.Net/_apis/build/status/discord-net.Discord.Net?branchName=dev)](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev) -[![Discord](https://discordapp.com/api/guilds/81384788765712384/widget.png)](https://discord.gg/jkrBmQR) +[![Discord](https://discord.com/api/guilds/81384788765712384/widget.png)](https://discord.gg/jkrBmQR) ## What is Discord.Net? Discord.Net is an asynchronous, multi-platform .NET Library used to -interface with the [Discord API](https://discordapp.com/). +interface with the [Discord API](https://discord.com/). ## Where to begin? diff --git a/samples/04_webhook_client/Program.cs b/samples/04_webhook_client/Program.cs index c2e5faa03..f3a50036c 100644 --- a/samples/04_webhook_client/Program.cs +++ b/samples/04_webhook_client/Program.cs @@ -14,10 +14,10 @@ namespace _04_webhook_client public async Task MainAsync() { - // The webhook url follows the format https://discordapp.com/api/webhooks/{id}/{token} + // The webhook url follows the format https://discord.com/api/webhooks/{id}/{token} // Because anyone with the webhook URL can use your webhook - // you should NOT hard code the URL or ID + token into your application. - using (var client = new DiscordWebhookClient("https://discordapp.com/api/webhooks/123/abc123")) + // you should NOT hard code the URL or ID + token into your application. + using (var client = new DiscordWebhookClient("https://discord.com/api/webhooks/123/abc123")) { var embed = new EmbedBuilder { @@ -26,7 +26,7 @@ namespace _04_webhook_client }; // Webhooks are able to send multiple embeds per message - // As such, your embeds must be passed as a collection. + // As such, your embeds must be passed as a collection. await client.SendMessageAsync(text: "Send a message to this webhook!", embeds: new[] { embed.Build() }); } } diff --git a/src/Discord.Net.Core/DiscordConfig.cs b/src/Discord.Net.Core/DiscordConfig.cs index 51970a781..429ad7b0c 100644 --- a/src/Discord.Net.Core/DiscordConfig.cs +++ b/src/Discord.Net.Core/DiscordConfig.cs @@ -13,7 +13,7 @@ namespace Discord /// /// An representing the API version that Discord.Net uses to communicate with Discord. /// A list of available API version can be seen on the official - /// Discord API documentation + /// Discord API documentation /// . /// public const int APIVersion = 6; @@ -50,7 +50,7 @@ namespace Discord /// /// The Discord API URL using . /// - public static readonly string APIUrl = $"https://discordapp.com/api/v{APIVersion}/"; + public static readonly string APIUrl = $"https://discord.com/api/v{APIVersion}/"; /// /// Returns the base Discord CDN URL. /// diff --git a/src/Discord.Net.Core/Extensions/MessageExtensions.cs b/src/Discord.Net.Core/Extensions/MessageExtensions.cs index 64a1d89ab..e44e397fa 100644 --- a/src/Discord.Net.Core/Extensions/MessageExtensions.cs +++ b/src/Discord.Net.Core/Extensions/MessageExtensions.cs @@ -17,7 +17,7 @@ namespace Discord public static string GetJumpUrl(this IMessage msg) { var channel = msg.Channel; - return $"https://discordapp.com/channels/{(channel is IDMChannel ? "@me" : $"{(channel as ITextChannel).GuildId}")}/{channel.Id}/{msg.Id}"; + return $"https://discord.com/channels/{(channel is IDMChannel ? "@me" : $"{(channel as ITextChannel).GuildId}")}/{channel.Id}/{msg.Id}"; } /// diff --git a/src/Discord.Net.Core/Net/HttpException.cs b/src/Discord.Net.Core/Net/HttpException.cs index d36bd66f9..ff9cf91f2 100644 --- a/src/Discord.Net.Core/Net/HttpException.cs +++ b/src/Discord.Net.Core/Net/HttpException.cs @@ -13,7 +13,7 @@ namespace Discord.Net /// /// /// An - /// HTTP status code + /// HTTP status code /// from Discord. /// public HttpStatusCode HttpCode { get; } @@ -22,7 +22,7 @@ namespace Discord.Net /// /// /// A - /// JSON error code + /// JSON error code /// from Discord, or null if none. /// public int? DiscordCode { get; } diff --git a/src/Discord.Net.Core/Net/WebSocketClosedException.cs b/src/Discord.Net.Core/Net/WebSocketClosedException.cs index 6e2564f6e..c743cd696 100644 --- a/src/Discord.Net.Core/Net/WebSocketClosedException.cs +++ b/src/Discord.Net.Core/Net/WebSocketClosedException.cs @@ -11,7 +11,7 @@ namespace Discord.Net /// /// /// A - /// close code + /// close code /// from Discord. /// public int CloseCode { get; } diff --git a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs index 877ccd875..11e44d8dc 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs @@ -87,7 +87,7 @@ namespace Discord.WebSocket /// /// /// For more information, please see - /// Request Guild Members + /// Request Guild Members /// on the official Discord API documentation. /// /// diff --git a/test/Discord.Net.Tests.Unit/TokenUtilsTests.cs b/test/Discord.Net.Tests.Unit/TokenUtilsTests.cs index bbfbfe754..e9526b761 100644 --- a/test/Discord.Net.Tests.Unit/TokenUtilsTests.cs +++ b/test/Discord.Net.Tests.Unit/TokenUtilsTests.cs @@ -83,7 +83,7 @@ namespace Discord public void BotTokenDoesNotThrowExceptions(string token) { // This example token is pulled from the Discord Docs - // https://discordapp.com/developers/docs/reference#authentication-example-bot-token-authorization-header + // https://discord.com/developers/docs/reference#authentication-example-bot-token-authorization-header // should not throw any exception TokenUtils.ValidateToken(TokenType.Bot, token); } diff --git a/test/Discord.Net.Tests/Tests.DiscordWebhookClient.cs b/test/Discord.Net.Tests/Tests.DiscordWebhookClient.cs index 039525afc..52c39005b 100644 --- a/test/Discord.Net.Tests/Tests.DiscordWebhookClient.cs +++ b/test/Discord.Net.Tests/Tests.DiscordWebhookClient.cs @@ -12,18 +12,18 @@ namespace Discord public class DiscordWebhookClientTests { [Theory] - [InlineData("https://discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", + [InlineData("https://discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", 123412347732897802, "_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] // ptb, canary, etc will have slightly different urls - [InlineData("https://ptb.discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", + [InlineData("https://ptb.discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", 123412347732897802, "_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] - [InlineData("https://canary.discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", + [InlineData("https://canary.discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", 123412347732897802, "_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] // don't care about https - [InlineData("http://canary.discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", + [InlineData("http://canary.discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", 123412347732897802, "_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] // this is the minimum that the regex cares about - [InlineData("discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", + [InlineData("discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK", 123412347732897802, "_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] public void TestWebhook_Valid(string webhookurl, ulong expectedId, string expectedToken) { @@ -48,7 +48,7 @@ namespace Discord [Theory] [InlineData("123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK")] // trailing slash - [InlineData("https://discordapp.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK/")] + [InlineData("https://discord.com/api/webhooks/123412347732897802/_abcde123456789-ABCDEFGHIJKLMNOP12345678-abcdefghijklmnopABCDEFGHIJK/")] public void TestWebhook_Invalid(string webhookurl) { Assert.Throws(() =>