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.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
[](https://www.nuget.org/packages/Discord.Net)
|
||||
[](https://www.myget.org/feed/Packages/discord-net)
|
||||
[](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev)
|
||||
[](https://discord.gg/jkrBmQR)
|
||||
[](https://discord.gg/jkrBmQR)
|
||||
|
||||
An unofficial .NET API Wrapper for the Discord client (http://discordapp.com).
|
||||
|
||||
|
||||
@@ -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).")
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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
|
||||
[Rich Presence Intro]: https://discord.com/developers/docs/rich-presence/best-practices
|
||||
|
||||
@@ -31,7 +31,7 @@ the Discord Applications Portal first.
|
||||
|
||||

|
||||
|
||||
[Discord Applications Portal]: https://discordapp.com/developers/applications/
|
||||
[Discord Applications Portal]: https://discord.com/developers/applications/
|
||||
|
||||
## Adding your bot to a server
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ title: Home
|
||||
[](https://www.nuget.org/packages/Discord.Net)
|
||||
[](https://www.myget.org/feed/Packages/discord-net)
|
||||
[](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev)
|
||||
[](https://discord.gg/jkrBmQR)
|
||||
[](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?
|
||||
|
||||
|
||||
@@ -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"))
|
||||
using (var client = new DiscordWebhookClient("https://discord.com/api/webhooks/123/abc123"))
|
||||
{
|
||||
var embed = new EmbedBuilder
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Discord
|
||||
/// <returns>
|
||||
/// An <see cref="int"/> representing the API version that Discord.Net uses to communicate with Discord.
|
||||
/// <para>A list of available API version can be seen on the official
|
||||
/// <see href="https://discordapp.com/developers/docs/reference#api-versioning">Discord API documentation</see>
|
||||
/// <see href="https://discord.com/developers/docs/reference#api-versioning">Discord API documentation</see>
|
||||
/// .</para>
|
||||
/// </returns>
|
||||
public const int APIVersion = 6;
|
||||
@@ -50,7 +50,7 @@ namespace Discord
|
||||
/// <returns>
|
||||
/// The Discord API URL using <see cref="APIVersion"/>.
|
||||
/// </returns>
|
||||
public static readonly string APIUrl = $"https://discordapp.com/api/v{APIVersion}/";
|
||||
public static readonly string APIUrl = $"https://discord.com/api/v{APIVersion}/";
|
||||
/// <summary>
|
||||
/// Returns the base Discord CDN URL.
|
||||
/// </summary>
|
||||
|
||||
@@ -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}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Discord.Net
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An
|
||||
/// <see href="https://discordapp.com/developers/docs/topics/opcodes-and-status-codes#http">HTTP status code</see>
|
||||
/// <see href="https://discord.com/developers/docs/topics/opcodes-and-status-codes#http">HTTP status code</see>
|
||||
/// from Discord.
|
||||
/// </returns>
|
||||
public HttpStatusCode HttpCode { get; }
|
||||
@@ -22,7 +22,7 @@ namespace Discord.Net
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A
|
||||
/// <see href="https://discordapp.com/developers/docs/topics/opcodes-and-status-codes#json">JSON error code</see>
|
||||
/// <see href="https://discord.com/developers/docs/topics/opcodes-and-status-codes#json">JSON error code</see>
|
||||
/// from Discord, or <c>null</c> if none.
|
||||
/// </returns>
|
||||
public int? DiscordCode { get; }
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Discord.Net
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A
|
||||
/// <see href="https://discordapp.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes">close code</see>
|
||||
/// <see href="https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes">close code</see>
|
||||
/// from Discord.
|
||||
/// </returns>
|
||||
public int CloseCode { get; }
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Discord.WebSocket
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For more information, please see
|
||||
/// <see href="https://discordapp.com/developers/docs/topics/gateway#request-guild-members">Request Guild Members</see>
|
||||
/// <see href="https://discord.com/developers/docs/topics/gateway#request-guild-members">Request Guild Members</see>
|
||||
/// on the official Discord API documentation.
|
||||
/// </para>
|
||||
/// <note>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<ArgumentException>(() =>
|
||||
|
||||
Reference in New Issue
Block a user