diff --git a/.gitignore b/.gitignore
index d72e0b5ea..654370842 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,7 +127,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
-# TODO: Comment the next line if you want to checkin your web deploy settings
+# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
@@ -151,7 +151,6 @@ AppPackages/
# Others
*.[Cc]ache
ClientBin/
-[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
@@ -206,4 +205,4 @@ docs/api/\.manifest
\.idea/
# Codealike UID
-codealike.json
\ No newline at end of file
+codealike.json
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 886754052..7f4041a7a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,96 @@
# Changelog
+## [2.3.0] - 2021-01-28
+### Added
+- #1491 Add INVITE_CREATE and INVITE_DELETE events (1ab670b)
+- #1520 Support reading multiple activities (421a0c1)
+- #1521 Allow for inherited commands in modules (a51cdf6)
+- #1526 Add Direction.Around to GetMessagesAsync (f2130f8)
+- #1537 Implement gateway ratelimit (ec673e1)
+- #1544 Add MESSAGE_REACTION_REMOVE_EMOJI and RemoveAllReactionsForEmoteAsync (a89f076)
+- #1549 Add GetUsersAsync to SocketGuild (30b5a83)
+- #1566 Support Gateway Intents (d5d10d3)
+- #1573 Add missing properties to Guild and deprecate GuildEmbed (ec212b1)
+- #1581 Add includeRoleIds to PruneUsersAsync (a80e5ff)
+- #1588 Add GetStreams to AudioClient (1e012ac)
+- #1596 Add missing channel properties (2d80037)
+- #1604 Add missing application properties (including Teams) (10fcde0)
+- #1619 Add "View Guild Insights" to GuildPermission (2592264)
+- #1637 Added CultureInvariant RegexOption to WebhookUrlRegex (e3925a7)
+- #1659 Add inline replies (e3850e1)
+- #1688 Send presence on Identify payload (25d5d36)
+- #1721 Add role tags (6a62c47)
+- #1722 Add user public flags (c683b29)
+- #1724 Add MessageFlags and AllowedMentions to message modify (225550d)
+- #1731 Add GuildUser IsPending property (8b25c9b)
+- #1690 Add max bitrate value to SocketGuild (aacfea0)
+
+### Fixed
+- #1244 Missing AddReactions permission for DM channels. (e40ca4a)
+- #1469 unsupported property causes an exception (468f826)
+- #1525 AllowedMentions and AllowedMentionTypes (3325031)
+- #1531 Add AllowedMentions to SendFileAsync (ab32607)
+- #1532 GuildEmbed.ChannelId as nullable per API documentation (971d519)
+- #1546 Different ratelimits for the same route (implement discord buckets) (2f6c017)
+- #1548 Incomplete Ready, DownloadUsersAsync, and optimize AlwaysDownloadUsers (dc8c959)
+- #1555 InvalidOperationException at MESSAGE_CREATE (bd4672a)
+- #1557 Sending 2 requests instead of 1 to create a Guild role. (5430cc8)
+- #1571 Not using the new domain name. (df8a0f7)
+- #1578 Trim token before passing it to the authorization header (42ba372)
+- #1580 Stop TaskCanceledException from bubbling up (b8fa464)
+- #1599 Invite audit log without inviter (b95b95b)
+- #1602 Add AllowedMentions to webhooks (bd4516b)
+- #1603 Cancel reconnection when 4014 (f396cd9)
+- #1608 Voice overwrites and CategoryId remarks (43c8fc0)
+- #1614 Check error 404 and return null for GetBanAsync (ae9fff6)
+- #1621 Parse mentions from message payload (366ca9a)
+- #1622 Do not update overwrite cache locally (3860da0)
+- #1623 Invoke UserUpdated from GuildMemberUpdated if needed (3085e88)
+- #1624 Handle null PreferredLocale in rare cases (c1d04b4)
+- #1639 Invite and InviteMetadata properties (dd2e524)
+- #1642 Add missing permissions (4b389f3)
+- #1647 handicap member downloading for verified bots (fa5ef5e)
+- #1652 Update README.MD to reflect new discord domain (03b831e)
+- #1667 Audio stream dispose (a2af985)
+- #1671 Crosspost throwing InvalidOperationException (9134443)
+- #1672 Team is nullable, not optional (be60d81)
+- #1681 Emoji url encode (04389a4)
+- #1683 SocketGuild.HasAllMembers is false if a user left a guild (47f571e)
+- #1686 Revert PremiumSubscriptionCount type (97e71cd)
+- #1695 Possible NullReferenceException when receiving InvalidSession (5213916)
+- #1702 Rollback Activities to Game (9d7cb39)
+- #1727 Move and fix internal AllowedMentions object (4a7f8fe)
+- limit request members batch size (084db25)
+- UserMentions throwing NullRef (5ed01a3)
+- Wrong author for SocketUserMessage.ReferencedMessage (1e9b252)
+- Discord sends null when there's no team (05a1f0a)
+- IMessage.Embeds docs remarks (a4d32d3)
+- Missing MessageReference when sending files (2095701)
+
+### Misc
+- #1545 MutualGuilds optimization (323a677)
+- #1551 Update webhook regex to support discord.com (7585789)
+- #1556 Add SearchUsersAsync (57880de)
+- #1561 Minor refactor to switch expression (42826df)
+- #1576 Updating comments for privileged intents (c42bfa6)
+- #1678 Change ratelimit messages (47ed806)
+- #1714 Update summary of SocketVoiceChannel.Users (e385c40)
+- #1720 VoiceRegions and related changes (5934c79)
+- Add updated libraries for LastModified (d761846)
+- Add alternative documentation link (accd351)
+- Temporarily disable StyleCops until all the fixes are impl'd (36de7b2)
+- Remove redundant CreateGuildRoleParams (3df0539)
+- Add minor tweaks to DiscordSocketConfig docs strings (2cd1880)
+- Fix MaxWaitBetweenGuildAvailablesBeforeReady docs string (e31cdc7)
+- Missing summary tag for GatewayIntents (3a10018)
+- Add new method of role ID copy (857ef77)
+- Resolve inheritdocs for IAttachment (9ea3291)
+- Mark null as a specific langword in summary (13a41f8)
+- Cleanup GatewayReconnectException docs (833ee42)
+- Update Docfx.Plugins.LastModified to v1.2.4 (28a6f97)
+- Update framework version for tests to Core 3.1 to comply with LTS (4988a07)
+- Move bulk deletes remarks from to (62539f0)
+
## [2.2.0] - 2020-04-16
### Added
- #1247 Implement Client Status Support (9da11b4)
diff --git a/Discord.Net.targets b/Discord.Net.targets
index adb42f7a9..a7e2c8a51 100644
--- a/Discord.Net.targets
+++ b/Discord.Net.targets
@@ -1,15 +1,15 @@
- 2.3.0
+ 2.3.1
dev
latest
Discord.Net Contributors
discord;discordapp
- https://github.com/RogueException/Discord.Net
+ https://github.com/Discord-Net/Discord.Net
http://opensource.org/licenses/MIT
- https://github.com/RogueException/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png
+ https://github.com/Discord-Net/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png
git
- git://github.com/RogueException/Discord.Net
+ git://github.com/Discord-Net/Discord.Net
$(VersionSuffix)-dev
diff --git a/README.md b/README.md
index f4bc5811e..34a633f72 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,16 @@
[](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).
+An unofficial .NET API Wrapper for the Discord client (https://discord.com).
-Check out the [documentation](https://discord.foxbot.me/) or join the [Discord API Chat](https://discord.gg/jkrBmQR).
+## Documentation
+
+- [Stable](https://discord.foxbot.me/)
+ - Hosted by @foxbot
+- [Nightly](https://docs.stillu.cc/)
+ - [Latest CI repo](https://github.com/discord-net/docs-static)
## Installation
### Stable (NuGet)
diff --git a/StyleAnalyzer.targets b/StyleAnalyzer.targets
new file mode 100644
index 000000000..0794cfacb
--- /dev/null
+++ b/StyleAnalyzer.targets
@@ -0,0 +1,9 @@
+
+
+
+
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/_template/last-modified/plugins/LastModifiedPostProcessor.dll b/docs/_template/last-modified/plugins/LastModifiedPostProcessor.dll
index dd790e55e..ccb2b0e37 100644
Binary files a/docs/_template/last-modified/plugins/LastModifiedPostProcessor.dll and b/docs/_template/last-modified/plugins/LastModifiedPostProcessor.dll differ
diff --git a/docs/_template/last-modified/plugins/LibGit2Sharp.dll b/docs/_template/last-modified/plugins/LibGit2Sharp.dll
index 82f214846..316515072 100644
Binary files a/docs/_template/last-modified/plugins/LibGit2Sharp.dll and b/docs/_template/last-modified/plugins/LibGit2Sharp.dll differ
diff --git a/docs/_template/last-modified/plugins/LibGit2Sharp.dll.config b/docs/_template/last-modified/plugins/LibGit2Sharp.dll.config
index ddc821b29..21a2b5601 100644
--- a/docs/_template/last-modified/plugins/LibGit2Sharp.dll.config
+++ b/docs/_template/last-modified/plugins/LibGit2Sharp.dll.config
@@ -1,4 +1,4 @@
-
-
-
+
+
+
diff --git a/docs/_template/last-modified/plugins/lib/alpine-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/alpine-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..793f4483a
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/alpine-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/alpine.3.9-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/alpine.3.9-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..49186df25
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/alpine.3.9-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/debian-arm64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/debian-arm64/libgit2-ef5a385.so
new file mode 100644
index 000000000..11ef799ab
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/debian-arm64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/debian.9-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/debian.9-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..5cd5e46b0
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/debian.9-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/fedora-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/fedora-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..be1be9322
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/fedora-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/linux-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/linux-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..1ec4b01f5
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/linux-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/osx/libgit2-ef5a385.dylib b/docs/_template/last-modified/plugins/lib/osx/libgit2-ef5a385.dylib
new file mode 100644
index 000000000..81f71d6ea
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/osx/libgit2-ef5a385.dylib differ
diff --git a/docs/_template/last-modified/plugins/lib/rhel-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/rhel-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..3d194a97f
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/rhel-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/ubuntu.16.04-arm64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/ubuntu.16.04-arm64/libgit2-ef5a385.so
new file mode 100644
index 000000000..a3282b0d2
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/ubuntu.16.04-arm64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/ubuntu.18.04-x64/libgit2-ef5a385.so b/docs/_template/last-modified/plugins/lib/ubuntu.18.04-x64/libgit2-ef5a385.so
new file mode 100644
index 000000000..0360ce3e0
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/ubuntu.18.04-x64/libgit2-ef5a385.so differ
diff --git a/docs/_template/last-modified/plugins/lib/win32/x64/git2-ef5a385.dll b/docs/_template/last-modified/plugins/lib/win32/x64/git2-ef5a385.dll
new file mode 100644
index 000000000..7ffcdf97f
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/win32/x64/git2-ef5a385.dll differ
diff --git a/docs/_template/last-modified/plugins/lib/win32/x86/git2-ef5a385.dll b/docs/_template/last-modified/plugins/lib/win32/x86/git2-ef5a385.dll
new file mode 100644
index 000000000..9fe2e3e01
Binary files /dev/null and b/docs/_template/last-modified/plugins/lib/win32/x86/git2-ef5a385.dll differ
diff --git a/docs/_template/light-dark-theme/partials/affix.tmpl.partial b/docs/_template/light-dark-theme/partials/affix.tmpl.partial
index aafcdf05b..b3ce60b5c 100644
--- a/docs/_template/light-dark-theme/partials/affix.tmpl.partial
+++ b/docs/_template/light-dark-theme/partials/affix.tmpl.partial
@@ -27,7 +27,8 @@
{{/_disableContribution}}
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/basics/getting-started.md b/docs/faq/basics/getting-started.md
index f38d2cea7..e254226d0 100644
--- a/docs/faq/basics/getting-started.md
+++ b/docs/faq/basics/getting-started.md
@@ -74,6 +74,9 @@ it will return the user ID of the aforementioned user.
Several common ways to do this:
-1. Make the role mentionable and mention the role, and escape it
+1. (Easiest) Right click on the role either in the Server Settings
+ or in the user's role list.
+ 
+2. Make the role mentionable and mention the role, and escape it
using the `\` character in front.
-2. Inspect the roles collection within the guild via your debugger.
\ No newline at end of file
+3. Inspect the roles collection within the guild via your debugger.
\ No newline at end of file
diff --git a/docs/faq/basics/images/role-copy.png b/docs/faq/basics/images/role-copy.png
new file mode 100644
index 000000000..1dbc2982f
Binary files /dev/null and b/docs/faq/basics/images/role-copy.png differ
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.

-[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
[](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?
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.Commands/Builders/ModuleClassBuilder.cs b/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs
index 28037b0fa..7a752090e 100644
--- a/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs
+++ b/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs
@@ -136,7 +136,7 @@ namespace Discord.Commands
builder.Name = typeInfo.Name;
// Get all methods (including from inherited members), that are valid commands
- var validCommands = typeInfo.GetMethods().Where(IsValidCommandDefinition);
+ var validCommands = typeInfo.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(IsValidCommandDefinition);
foreach (var method in validCommands)
{
diff --git a/src/Discord.Net.Commands/Discord.Net.Commands.csproj b/src/Discord.Net.Commands/Discord.Net.Commands.csproj
index 95e7db491..21869d91c 100644
--- a/src/Discord.Net.Commands/Discord.Net.Commands.csproj
+++ b/src/Discord.Net.Commands/Discord.Net.Commands.csproj
@@ -1,5 +1,6 @@
+
Discord.Net.Commands
Discord.Commands
diff --git a/src/Discord.Net.Commands/ModuleBase.cs b/src/Discord.Net.Commands/ModuleBase.cs
index ec1722c70..6ec2db54d 100644
--- a/src/Discord.Net.Commands/ModuleBase.cs
+++ b/src/Discord.Net.Commands/ModuleBase.cs
@@ -35,9 +35,10 @@ namespace Discord.Commands
/// Specifies if notifications are sent for mentioned users and roles in the .
/// If null, all mentioned roles and users will be notified.
///
- protected virtual async Task ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null)
+ /// The message references to be included. Used to reply to specific messages.
+ protected virtual async Task ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null)
{
- return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions).ConfigureAwait(false);
+ return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions, messageReference).ConfigureAwait(false);
}
///
/// The method to execute before executing the command.
diff --git a/src/Discord.Net.Core/Audio/IAudioClient.cs b/src/Discord.Net.Core/Audio/IAudioClient.cs
index 018c8bc05..2fc52a529 100644
--- a/src/Discord.Net.Core/Audio/IAudioClient.cs
+++ b/src/Discord.Net.Core/Audio/IAudioClient.cs
@@ -1,4 +1,5 @@
-using System;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
namespace Discord.Audio
@@ -20,6 +21,9 @@ namespace Discord.Audio
/// Gets the estimated round-trip latency, in milliseconds, to the voice UDP server.
int UdpLatency { get; }
+ /// Gets the current audio streams.
+ IReadOnlyDictionary GetStreams();
+
Task StopAsync();
Task SetSpeakingAsync(bool value);
diff --git a/src/Discord.Net.Core/CDN.cs b/src/Discord.Net.Core/CDN.cs
index 32ffbba90..e1e8e5e1a 100644
--- a/src/Discord.Net.Core/CDN.cs
+++ b/src/Discord.Net.Core/CDN.cs
@@ -7,6 +7,17 @@ namespace Discord
///
public static class CDN
{
+ ///
+ /// Returns a team icon URL.
+ ///
+ /// The team identifier.
+ /// The icon identifier.
+ ///
+ /// A URL pointing to the team's icon.
+ ///
+ public static string GetTeamIconUrl(ulong teamId, string iconId)
+ => iconId != null ? $"{DiscordConfig.CDNUrl}team-icons/{teamId}/{iconId}.jpg" : null;
+
///
/// Returns an application icon URL.
///
@@ -62,11 +73,21 @@ namespace Discord
/// The guild snowflake identifier.
/// The splash icon identifier.
///
- /// A URL pointing to the guild's icon.
+ /// A URL pointing to the guild's splash.
///
public static string GetGuildSplashUrl(ulong guildId, string splashId)
=> splashId != null ? $"{DiscordConfig.CDNUrl}splashes/{guildId}/{splashId}.jpg" : null;
///
+ /// Returns a guild discovery splash URL.
+ ///
+ /// The guild snowflake identifier.
+ /// The discovery splash icon identifier.
+ ///
+ /// A URL pointing to the guild's discovery splash.
+ ///
+ public static string GetGuildDiscoverySplashUrl(ulong guildId, string discoverySplashId)
+ => discoverySplashId != null ? $"{DiscordConfig.CDNUrl}discovery-splashes/{guildId}/{discoverySplashId}.jpg" : null;
+ ///
/// Returns a channel icon URL.
///
/// The channel snowflake identifier.
diff --git a/src/Discord.Net.Core/Discord.Net.Core.csproj b/src/Discord.Net.Core/Discord.Net.Core.csproj
index dd2f2afe3..bc513390c 100644
--- a/src/Discord.Net.Core/Discord.Net.Core.csproj
+++ b/src/Discord.Net.Core/Discord.Net.Core.csproj
@@ -1,5 +1,6 @@
+
Discord.Net.Core
Discord
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/Entities/Channels/GuildChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
index 9552b0a60..339d6fffd 100644
--- a/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
+++ b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
@@ -1,3 +1,5 @@
+using System.Collections.Generic;
+
namespace Discord
{
///
@@ -26,9 +28,13 @@ namespace Discord
///
///
/// Setting this value to a category's snowflake identifier will change or set this channel's parent to the
- /// specified channel; setting this value to 0 will detach this channel from its parent if one
+ /// specified channel; setting this value to will detach this channel from its parent if one
/// is set.
///
public Optional CategoryId { get; set; }
+ ///
+ /// Gets or sets the permission overwrites for this channel.
+ ///
+ public Optional> PermissionOverwrites { get; set; }
}
}
diff --git a/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs b/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
index 030a278bc..abd20e4f0 100644
--- a/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
+++ b/src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
@@ -27,11 +27,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null);
+ Task SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Sends a file to this message channel with an optional caption.
///
@@ -63,11 +64,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
+ Task SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Sends a file to this message channel with an optional caption.
///
@@ -96,11 +98,12 @@ namespace Discord
/// Specifies if notifications are sent for mentioned users and roles in the message .
/// If null, all mentioned roles and users will be notified.
///
+ /// The message references to be included. Used to reply to specific messages.
///
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
///
- Task SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
+ Task SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
///
/// Gets a message from this message channel.
diff --git a/src/Discord.Net.Core/Entities/Channels/INewsChannel.cs b/src/Discord.Net.Core/Entities/Channels/INewsChannel.cs
new file mode 100644
index 000000000..a1223b48b
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Channels/INewsChannel.cs
@@ -0,0 +1,9 @@
+namespace Discord
+{
+ ///
+ /// Represents a generic news channel in a guild that can send and receive messages.
+ ///
+ public interface INewsChannel : ITextChannel
+ {
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Gateway/BotGateway.cs b/src/Discord.Net.Core/Entities/Gateway/BotGateway.cs
new file mode 100644
index 000000000..c9be0ac1f
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Gateway/BotGateway.cs
@@ -0,0 +1,22 @@
+namespace Discord
+{
+ ///
+ /// Stores the gateway information related to the current bot.
+ ///
+ public class BotGateway
+ {
+ ///
+ /// Gets the WSS URL that can be used for connecting to the gateway.
+ ///
+ public string Url { get; internal set; }
+ ///
+ /// Gets the recommended number of shards to use when connecting.
+ ///
+ public int Shards { get; internal set; }
+ ///
+ /// Gets the that contains the information
+ /// about the current session start limit.
+ ///
+ public SessionStartLimit SessionStartLimit { get; internal set; }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Gateway/SessionStartLimit.cs b/src/Discord.Net.Core/Entities/Gateway/SessionStartLimit.cs
new file mode 100644
index 000000000..74ae96af1
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Gateway/SessionStartLimit.cs
@@ -0,0 +1,38 @@
+namespace Discord
+{
+ ///
+ /// Stores the information related to the gateway identify request.
+ ///
+ public class SessionStartLimit
+ {
+ ///
+ /// Gets the total number of session starts the current user is allowed.
+ ///
+ ///
+ /// The maximum amount of session starts the current user is allowed.
+ ///
+ public int Total { get; internal set; }
+ ///
+ /// Gets the remaining number of session starts the current user is allowed.
+ ///
+ ///
+ /// The remaining amount of session starts the current user is allowed.
+ ///
+ public int Remaining { get; internal set; }
+ ///
+ /// Gets the number of milliseconds after which the limit resets.
+ ///
+ ///
+ /// The milliseconds until the limit resets back to the .
+ ///
+ public int ResetAfter { get; internal set; }
+ ///
+ /// Gets the maximum concurrent identify requests in a time window.
+ ///
+ ///
+ /// The maximum concurrent identify requests in a time window,
+ /// limited to the same rate limit key.
+ ///
+ public int MaxConcurrency { get; internal set; }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Guilds/GuildWidgetProperties.cs b/src/Discord.Net.Core/Entities/Guilds/GuildWidgetProperties.cs
new file mode 100644
index 000000000..842bb7f3e
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Guilds/GuildWidgetProperties.cs
@@ -0,0 +1,21 @@
+namespace Discord
+{
+ ///
+ /// Provides properties that are used to modify the widget of an with the specified changes.
+ ///
+ public class GuildWidgetProperties
+ {
+ ///
+ /// Sets whether the widget should be enabled.
+ ///
+ public Optional Enabled { get; set; }
+ ///
+ /// Sets the channel that the invite should place its users in, if not .
+ ///
+ public Optional Channel { get; set; }
+ ///
+ /// Sets the channel that the invite should place its users in, if not .
+ ///
+ public Optional ChannelId { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs
index 81b5e8dd9..6283508e5 100644
--- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs
+++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs
@@ -23,7 +23,7 @@ namespace Discord
/// automatically moved to the AFK voice channel.
///
///
- /// An representing the amount of time in seconds for a user to be marked as inactive
+ /// An representing the amount of time in seconds for a user to be marked as inactive
/// and moved into the AFK voice channel.
///
int AFKTimeout { get; }
@@ -31,10 +31,17 @@ namespace Discord
/// Gets a value that indicates whether this guild is embeddable (i.e. can use widget).
///
///
- /// true if this guild can be embedded via widgets; otherwise false.
+ /// if this guild has a widget enabled; otherwise .
///
bool IsEmbeddable { get; }
///
+ /// Gets a value that indicates whether this guild has the widget enabled.
+ ///
+ ///
+ /// if this guild has a widget enabled; otherwise .
+ ///
+ bool IsWidgetEnabled { get; }
+ ///
/// Gets the default message notifications for users who haven't explicitly set their notification settings.
///
DefaultMessageNotifications DefaultMessageNotifications { get; }
@@ -64,31 +71,45 @@ namespace Discord
/// Gets the ID of this guild's icon.
///
///
- /// An identifier for the splash image; null if none is set.
+ /// An identifier for the splash image; if none is set.
///
string IconId { get; }
///
/// Gets the URL of this guild's icon.
///
///
- /// A URL pointing to the guild's icon; null if none is set.
+ /// A URL pointing to the guild's icon; if none is set.
///
string IconUrl { get; }
///
/// Gets the ID of this guild's splash image.
///
///
- /// An identifier for the splash image; null if none is set.
+ /// An identifier for the splash image; if none is set.
///
string SplashId { get; }
///
/// Gets the URL of this guild's splash image.
///
///
- /// A URL pointing to the guild's splash image; null if none is set.
+ /// A URL pointing to the guild's splash image; if none is set.
///
string SplashUrl { get; }
///
+ /// Gets the ID of this guild's discovery splash image.
+ ///
+ ///
+ /// An identifier for the discovery splash image; if none is set.
+ ///
+ string DiscoverySplashId { get; }
+ ///
+ /// Gets the URL of this guild's discovery splash image.
+ ///
+ ///
+ /// A URL pointing to the guild's discovery splash image; if none is set.
+ ///
+ string DiscoverySplashUrl { get; }
+ ///
/// Determines if this guild is currently connected and ready to be used.
///
///
@@ -98,7 +119,7 @@ namespace Discord
/// This boolean is used to determine if the guild is currently connected to the WebSocket and is ready to be used/accessed.
///
///
- /// true if this guild is currently connected and ready to be used; otherwise false.
+ /// true if this guild is currently connected and ready to be used; otherwise .
///
bool Available { get; }
@@ -106,7 +127,7 @@ namespace Discord
/// Gets the ID of the AFK voice channel for this guild.
///
///
- /// A representing the snowflake identifier of the AFK voice channel; null if
+ /// A representing the snowflake identifier of the AFK voice channel; if
/// none is set.
///
ulong? AFKChannelId { get; }
@@ -121,7 +142,7 @@ namespace Discord
///
///
///
- /// A representing the snowflake identifier of the default text channel; 0 if
+ /// A representing the snowflake identifier of the default text channel; 0 if
/// none can be found.
///
ulong DefaultChannelId { get; }
@@ -129,30 +150,54 @@ namespace Discord
/// Gets the ID of the widget embed channel of this guild.
///
///
- /// A representing the snowflake identifier of the embedded channel found within the
- /// widget settings of this guild; null if none is set.
+ /// A representing the snowflake identifier of the embedded channel found within the
+ /// widget settings of this guild; if none is set.
///
ulong? EmbedChannelId { get; }
///
+ /// Gets the ID of the channel assigned to the widget of this guild.
+ ///
+ ///
+ /// A representing the snowflake identifier of the channel assigned to the widget found
+ /// within the widget settings of this guild; if none is set.
+ ///
+ ulong? WidgetChannelId { get; }
+ ///
/// Gets the ID of the channel where randomized welcome messages are sent.
///
///
- /// A representing the snowflake identifier of the system channel where randomized
- /// welcome messages are sent; null if none is set.
+ /// A representing the snowflake identifier of the system channel where randomized
+ /// welcome messages are sent; if none is set.
///
ulong? SystemChannelId { get; }
///
+ /// Gets the ID of the channel with the rules.
+ ///
+ ///
+ /// A representing the snowflake identifier of the channel that contains the rules;
+ /// if none is set.
+ ///
+ ulong? RulesChannelId { get; }
+ ///
+ /// Gets the ID of the channel where admins and moderators of Community guilds receive notices from Discord.
+ ///
+ ///
+ /// A representing the snowflake identifier of the channel where admins and moderators
+ /// of Community guilds receive notices from Discord; if none is set.
+ ///
+ ulong? PublicUpdatesChannelId { get; }
+ ///
/// Gets the ID of the user that owns this guild.
///
///
- /// A representing the snowflake identifier of the user that owns this guild.
+ /// A representing the snowflake identifier of the user that owns this guild.
///
ulong OwnerId { get; }
///
/// Gets the application ID of the guild creator if it is bot-created.
///
///
- /// A representing the snowflake identifier of the application ID that created this guild, or null if it was not bot-created.
+ /// A representing the snowflake identifier of the application ID that created this guild, or if it was not bot-created.
///
ulong? ApplicationId { get; }
///
@@ -208,21 +253,21 @@ namespace Discord
/// Gets the identifier for this guilds banner image.
///
///
- /// An identifier for the banner image; null if none is set.
+ /// An identifier for the banner image; if none is set.
///
string BannerId { get; }
///
/// Gets the URL of this guild's banner image.
///
///
- /// A URL pointing to the guild's banner image; null if none is set.
+ /// A URL pointing to the guild's banner image; if none is set.
///
string BannerUrl { get; }
///
/// Gets the code for this guild's vanity invite URL.
///
///
- /// A string containing the vanity invite code for this guild; null if none is set.
+ /// A string containing the vanity invite code for this guild; if none is set.
///
string VanityURLCode { get; }
///
@@ -236,7 +281,7 @@ namespace Discord
/// Gets the description for the guild.
///
///
- /// The description for the guild; null if none is set.
+ /// The description for the guild; if none is set.
///
string Description { get; }
///
@@ -246,9 +291,50 @@ namespace Discord
/// This is the number of users who have boosted this guild.
///
///
- /// The number of premium subscribers of this guild.
+ /// The number of premium subscribers of this guild; if not available.
///
int PremiumSubscriptionCount { get; }
+ ///
+ /// Gets the maximum number of presences for the guild.
+ ///
+ ///
+ /// The maximum number of presences for the guild.
+ ///
+ int? MaxPresences { get; }
+ ///
+ /// Gets the maximum number of members for the guild.
+ ///
+ ///
+ /// The maximum number of members for the guild.
+ ///
+ int? MaxMembers { get; }
+ ///
+ /// Gets the maximum amount of users in a video channel.
+ ///
+ ///
+ /// The maximum amount of users in a video channel.
+ ///
+ int? MaxVideoChannelUsers { get; }
+ ///
+ /// Gets the approximate number of members in this guild.
+ ///
+ ///
+ /// Only available when getting a guild via REST when `with_counts` is true.
+ ///
+ ///
+ /// The approximate number of members in this guild.
+ ///
+ int? ApproximateMemberCount { get; }
+ ///
+ /// Gets the approximate number of non-offline members in this guild.
+ ///
+ ///
+ /// Only available when getting a guild via REST when `with_counts` is true.
+ ///
+ ///
+ /// The approximate number of non-offline members in this guild.
+ ///
+ int? ApproximatePresenceCount { get; }
///
/// Gets the preferred locale of this guild in IETF BCP 47
@@ -285,8 +371,18 @@ namespace Discord
///
/// A task that represents the asynchronous modification operation.
///
+ [Obsolete("This endpoint is deprecated, use ModifyWidgetAsync instead.")]
Task ModifyEmbedAsync(Action func, RequestOptions options = null);
///
+ /// Modifies this guild's widget.
+ ///
+ /// The delegate containing the properties to modify the guild widget with.
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous modification operation.
+ ///
+ Task ModifyWidgetAsync(Action func, RequestOptions options = null);
+ ///
/// Bulk-modifies the order of channels in this guild.
///
/// The properties used to modify the channel positions with.
@@ -336,7 +432,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains a ban object, which
- /// contains the user information and the reason for the ban; null if the ban entry cannot be found.
+ /// contains the user information and the reason for the ban; if the ban entry cannot be found.
///
Task GetBanAsync(IUser user, RequestOptions options = null);
///
@@ -346,7 +442,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains a ban object, which
- /// contains the user information and the reason for the ban; null if the ban entry cannot be found.
+ /// contains the user information and the reason for the ban; if the ban entry cannot be found.
///
Task GetBanAsync(ulong userId, RequestOptions options = null);
///
@@ -410,7 +506,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the generic channel
- /// associated with the specified ; null if none is found.
+ /// associated with the specified ; if none is found.
///
Task GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -431,7 +527,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the text channel
- /// associated with the specified ; null if none is found.
+ /// associated with the specified ; if none is found.
///
Task GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -462,7 +558,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the voice channel associated
- /// with the specified ; null if none is found.
+ /// with the specified ; if none is found.
///
Task GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -472,7 +568,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the voice channel that the
- /// AFK users will be moved to after they have idled for too long; null if none is set.
+ /// AFK users will be moved to after they have idled for too long; if none is set.
///
Task GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -482,7 +578,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the text channel where
- /// randomized welcome messages will be sent to; null if none is set.
+ /// randomized welcome messages will be sent to; if none is set.
///
Task GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -492,7 +588,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the first viewable text
- /// channel in this guild; null if none is found.
+ /// channel in this guild; if none is found.
///
Task GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -502,9 +598,40 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the embed channel set
- /// within the server's widget settings; null if none is set.
+ /// within the server's widget settings; if none is set.
///
+ [Obsolete("This endpoint is deprecated, use GetWidgetChannelAsync instead.")]
Task GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
+ ///
+ /// Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
+ ///
+ /// The that determines whether the object should be fetched from cache.
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous get operation. The task result contains the widget channel set
+ /// within the server's widget settings; if none is set.
+ ///
+ Task GetWidgetChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
+ ///
+ /// Gets the text channel where Community guilds can display rules and/or guidelines.
+ ///
+ /// The that determines whether the object should be fetched from cache.
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous get operation. The task result contains the text channel
+ /// where Community guilds can display rules and/or guidelines; if none is set.
+ ///
+ Task GetRulesChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
+ ///
+ /// Gets the text channel channel where admins and moderators of Community guilds receive notices from Discord.
+ ///
+ /// The that determines whether the object should be fetched from cache.
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous get operation. The task result contains the text channel channel where
+ /// admins and moderators of Community guilds receive notices from Discord; if none is set.
+ ///
+ Task GetPublicUpdatesChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
/// Creates a new text channel in this guild.
@@ -573,7 +700,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the partial metadata of
- /// the vanity invite found within this guild; null if none is found.
+ /// the vanity invite found within this guild; if none is found.
///
Task GetVanityInviteAsync(RequestOptions options = null);
@@ -582,7 +709,7 @@ namespace Discord
///
/// The snowflake identifier for the role.
///
- /// A role that is associated with the specified ; null if none is found.
+ /// A role that is associated with the specified ; if none is found.
///
IRole GetRole(ulong id);
///
@@ -624,7 +751,7 @@ namespace Discord
/// The OAuth2 access token for the user, requested with the guilds.join scope.
/// The delegate containing the properties to be applied to the user upon being added to the guild.
/// The options to be used when sending the request.
- /// A guild user associated with the specified ; null if the user is already in the guild.
+ /// A guild user associated with the specified ; if the user is already in the guild.
Task AddGuildUserAsync(ulong userId, string accessToken, Action func = null, RequestOptions options = null);
///
/// Gets a collection of all users in this guild.
@@ -649,7 +776,7 @@ namespace Discord
///
/// This method retrieves a user found within this guild.
///
- /// This may return null in the WebSocket implementation due to incomplete user collection in
+ /// This may return in the WebSocket implementation due to incomplete user collection in
/// large guilds.
///
///
@@ -658,7 +785,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the guild user
- /// associated with the specified ; null if none is found.
+ /// associated with the specified ; if none is found.
///
Task GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
///
@@ -705,11 +832,12 @@ namespace Discord
/// The number of days required for the users to be kicked.
/// Whether this prune action is a simulation.
/// The options to be used when sending the request.
+ /// An array of role IDs to be included in the prune of users who do not have any additional roles.
///
/// A task that represents the asynchronous prune operation. The task result contains the number of users to
/// be or has been removed from this guild.
///
- Task PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null);
+ Task PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable includeRoleIds = null);
///
/// Gets a collection of users in this guild that the name or nickname starts with the
/// provided at .
@@ -751,7 +879,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the webhook with the
- /// specified ; null if none is found.
+ /// specified ; if none is found.
///
Task GetWebhookAsync(ulong id, RequestOptions options = null);
///
@@ -771,7 +899,7 @@ namespace Discord
/// The options to be used when sending the request.
///
/// A task that represents the asynchronous get operation. The task result contains the emote found with the
- /// specified ; null if none is found.
+ /// specified ; if none is found.
///
Task GetEmoteAsync(ulong id, RequestOptions options = null);
///
diff --git a/src/Discord.Net.Core/Entities/IApplication.cs b/src/Discord.Net.Core/Entities/IApplication.cs
index 78a87dc19..2174baff9 100644
--- a/src/Discord.Net.Core/Entities/IApplication.cs
+++ b/src/Discord.Net.Core/Entities/IApplication.cs
@@ -22,6 +22,18 @@ namespace Discord
/// Gets the icon URL of the application.
///
string IconUrl { get; }
+ ///
+ /// Gets if the bot is public.
+ ///
+ bool IsBotPublic { get; }
+ ///
+ /// Gets if the bot requires code grant.
+ ///
+ bool BotRequiresCodeGrant { get; }
+ ///
+ /// Gets the team associated with this application if there is one.
+ ///
+ ITeam Team { get; }
///
/// Gets the partial user object containing info on the owner of the application.
diff --git a/src/Discord.Net.Core/Entities/IUpdateable.cs b/src/Discord.Net.Core/Entities/IUpdateable.cs
index 3ae4613f5..d561e57a6 100644
--- a/src/Discord.Net.Core/Entities/IUpdateable.cs
+++ b/src/Discord.Net.Core/Entities/IUpdateable.cs
@@ -10,6 +10,7 @@ namespace Discord
///
/// Updates this object's properties with its current state.
///
+ /// The options to be used when sending the request.
Task UpdateAsync(RequestOptions options = null);
}
}
diff --git a/src/Discord.Net.Core/Entities/Invites/IInvite.cs b/src/Discord.Net.Core/Entities/Invites/IInvite.cs
index 993f1f047..47ffffacb 100644
--- a/src/Discord.Net.Core/Entities/Invites/IInvite.cs
+++ b/src/Discord.Net.Core/Entities/Invites/IInvite.cs
@@ -20,6 +20,13 @@ namespace Discord
///
string Url { get; }
+ ///
+ /// Gets the user that created this invite.
+ ///
+ ///
+ /// A user that created this invite.
+ ///
+ IUser Inviter { get; }
///
/// Gets the channel this invite is linked to.
///
@@ -83,5 +90,19 @@ namespace Discord
/// invite points to; null if one cannot be obtained.
///
int? MemberCount { get; }
+ ///
+ /// Gets the user this invite is linked to via .
+ ///
+ ///
+ /// A user that is linked to this invite.
+ ///
+ IUser TargetUser { get; }
+ ///
+ /// Gets the type of the linked for this invite.
+ ///
+ ///
+ /// The type of the linked user that is linked to this invite.
+ ///
+ TargetUserType TargetUserType { get; }
}
}
diff --git a/src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs b/src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs
index 471dc377f..c64b3205b 100644
--- a/src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs
+++ b/src/Discord.Net.Core/Entities/Invites/IInviteMetadata.cs
@@ -8,28 +8,22 @@ namespace Discord
public interface IInviteMetadata : IInvite
{
///
- /// Gets the user that created this invite.
+ /// Gets a value that indicates whether the invite is a temporary one.
///
///
- /// A user that created this invite.
+ /// true if users accepting this invite will be removed from the guild when they log off; otherwise
+ /// false.
///
- IUser Inviter { get; }
+ bool IsTemporary { get; }
///
/// Gets a value that indicates whether the invite has been revoked.
///
///
/// true if this invite was revoked; otherwise false.
///
+ [Obsolete("This property doesn't exist anymore and shouldn't be used.")]
bool IsRevoked { get; }
///
- /// Gets a value that indicates whether the invite is a temporary one.
- ///
- ///
- /// true if users accepting this invite will be removed from the guild when they log off; otherwise
- /// false.
- ///
- bool IsTemporary { get; }
- ///
/// Gets the time (in seconds) until the invite expires.
///
///
diff --git a/src/Discord.Net.Core/Entities/Invites/TargetUserType.cs b/src/Discord.Net.Core/Entities/Invites/TargetUserType.cs
new file mode 100644
index 000000000..74263b888
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Invites/TargetUserType.cs
@@ -0,0 +1,14 @@
+namespace Discord
+{
+ public enum TargetUserType
+ {
+ ///
+ /// The invite whose target user type is not defined.
+ ///
+ Undefined = 0,
+ ///
+ /// The invite is for a Go Live stream.
+ ///
+ Stream = 1
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs b/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
index d52feaa7d..0206ad7b1 100644
--- a/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
+++ b/src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs
@@ -49,6 +49,14 @@ namespace Discord
///
public List UserIds { get; set; } = new List();
+ ///
+ /// Gets or sets whether to mention the author of the message you are replying to or not.
+ ///
+ ///
+ /// Specifically for inline replies.
+ ///
+ public bool? MentionRepliedUser { get; set; } = null;
+
///
/// Initializes a new instance of the class.
///
diff --git a/src/Discord.Net.Core/Entities/Messages/IMessage.cs b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
index 530c1cd82..80b1ffa68 100644
--- a/src/Discord.Net.Core/Entities/Messages/IMessage.cs
+++ b/src/Discord.Net.Core/Entities/Messages/IMessage.cs
@@ -39,6 +39,13 @@ namespace Discord
///
bool IsSuppressed { get; }
///
+ /// Gets the value that indicates whether this message mentioned everyone.
+ ///
+ ///
+ /// true if this message mentioned everyone; otherwise false.
+ ///
+ bool MentionedEveryone { get; }
+ ///
/// Gets the content for this message.
///
///
@@ -85,10 +92,10 @@ namespace Discord
/// Gets all embeds included in this message.
///
///
- ///
/// This property gets a read-only collection of embeds associated with this message. Depending on the
/// message, a sent message may contain one or more embeds. This is usually true when multiple link previews
/// are generated; however, only one can be featured.
+ ///
///
/// A read-only collection of embed objects.
///
@@ -141,11 +148,11 @@ namespace Discord
MessageApplication Application { get; }
///
- /// Gets the reference to the original message if it was crossposted.
+ /// Gets the reference to the original message if it is a crosspost, channel follow add, pin, or reply message.
///
///
- /// Sent with Cross-posted messages, meaning they were published from news channels
- /// and received by subscriber channels.
+ /// Sent with cross-posted messages, meaning they were published from news channels
+ /// and received by subscriber channels, channel follow adds, pins, and message replies.
///
///
/// A message's reference, if any is associated.
@@ -157,6 +164,17 @@ namespace Discord
///
IReadOnlyDictionary Reactions { get; }
+ ///
+ /// Gets the flags related to this message.
+ ///
+ ///
+ /// This value is determined by bitwise OR-ing values together.
+ ///
+ ///
+ /// A message's flags, if any is associated.
+ ///
+ MessageFlags? Flags { get; }
+
///
/// Adds a reaction to this message.
///
diff --git a/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs b/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
index e2fb25aae..1589e2ae5 100644
--- a/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
+++ b/src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Threading.Tasks;
namespace Discord
@@ -9,6 +8,14 @@ namespace Discord
///
public interface IUserMessage : IMessage
{
+ ///
+ /// Gets the referenced message if it is a crosspost, channel follow add, pin, or reply message.
+ ///
+ ///
+ /// The referenced message, if any is associated and still exists.
+ ///
+ IUserMessage ReferencedMessage { get; }
+
///
/// Modifies this message.
///
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageFlags.cs b/src/Discord.Net.Core/Entities/Messages/MessageFlags.cs
new file mode 100644
index 000000000..52d0f0e9e
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Messages/MessageFlags.cs
@@ -0,0 +1,36 @@
+using System;
+
+namespace Discord
+{
+ [Flags]
+ public enum MessageFlags
+ {
+ ///
+ /// Default value for flags, when none are given to a message.
+ ///
+ None = 0,
+ ///
+ /// Flag given to messages that have been published to subscribed
+ /// channels (via Channel Following).
+ ///
+ Crossposted = 1 << 0,
+ ///
+ /// Flag given to messages that originated from a message in another
+ /// channel (via Channel Following).
+ ///
+ IsCrosspost = 1 << 1,
+ ///
+ /// Flag given to messages that do not display any embeds.
+ ///
+ SuppressEmbeds = 1 << 2,
+ ///
+ /// Flag given to messages that the source message for this crosspost
+ /// has been deleted (via Channel Following).
+ ///
+ SourceMessageDeleted = 1 << 3,
+ ///
+ /// Flag given to messages that came from the urgent message system.
+ ///
+ Urgent = 1 << 4,
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs b/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
index b632d6a18..9504e04cb 100644
--- a/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
+++ b/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
@@ -21,5 +21,17 @@ namespace Discord
/// Gets or sets the embed the message should display.
///
public Optional
ChannelFollowAdd = 12,
+ ///
+ /// The message is an inline reply.
+ ///
+ ///
+ /// Only available in API v8.
+ ///
+ Reply = 19,
}
}
diff --git a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
index 99885b070..ed675b5f3 100644
--- a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
@@ -17,7 +17,7 @@ namespace Discord
/// Gets a that grants all permissions for category channels.
public static readonly ChannelPermissions Category = new ChannelPermissions(0b01100_1111110_1111111110001_010001);
/// Gets a that grants all permissions for direct message channels.
- public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110000_000000);
+ public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110001_000000);
/// Gets a that grants all permissions for group channels.
public static readonly ChannelPermissions Group = new ChannelPermissions(0b00000_1000110_0001101100000_000000);
/// Gets a that grants all permissions for a given channel type.
diff --git a/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs b/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
index 3c8a5e810..645b67489 100644
--- a/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
@@ -51,6 +51,10 @@ namespace Discord
/// authentication when used on a guild that has server-wide 2FA enabled.
///
ManageGuild = 0x00_00_00_20,
+ ///
+ /// Allows for viewing of guild insights
+ ///
+ ViewGuildInsights = 0x00_08_00_00,
// Text
///
diff --git a/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs
index a5adad47c..ba6757fc6 100644
--- a/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/GuildPermissions.cs
@@ -12,7 +12,7 @@ namespace Discord
/// Gets a that grants all guild permissions for webhook users.
public static readonly GuildPermissions Webhook = new GuildPermissions(0b00000_0000000_0001101100000_000000);
/// Gets a that grants all guild permissions.
- public static readonly GuildPermissions All = new GuildPermissions(0b11111_1111110_1111111111111_111111);
+ public static readonly GuildPermissions All = new GuildPermissions(0b11111_1111111_1111111111111_111111);
/// Gets a packed value representing all the permissions in this .
public ulong RawValue { get; }
@@ -34,6 +34,8 @@ namespace Discord
public bool AddReactions => Permissions.GetValue(RawValue, GuildPermission.AddReactions);
/// If true, a user may view the audit log.
public bool ViewAuditLog => Permissions.GetValue(RawValue, GuildPermission.ViewAuditLog);
+ /// If true, a user may view the guild insights.
+ public bool ViewGuildInsights => Permissions.GetValue(RawValue, GuildPermission.ViewGuildInsights);
/// If True, a user may join channels.
[Obsolete("Use ViewChannel instead.")]
@@ -97,6 +99,7 @@ namespace Discord
bool? manageGuild = null,
bool? addReactions = null,
bool? viewAuditLog = null,
+ bool? viewGuildInsights = null,
bool? viewChannel = null,
bool? sendMessages = null,
bool? sendTTSMessages = null,
@@ -130,6 +133,7 @@ namespace Discord
Permissions.SetValue(ref value, manageGuild, GuildPermission.ManageGuild);
Permissions.SetValue(ref value, addReactions, GuildPermission.AddReactions);
Permissions.SetValue(ref value, viewAuditLog, GuildPermission.ViewAuditLog);
+ Permissions.SetValue(ref value, viewGuildInsights, GuildPermission.ViewGuildInsights);
Permissions.SetValue(ref value, viewChannel, GuildPermission.ViewChannel);
Permissions.SetValue(ref value, sendMessages, GuildPermission.SendMessages);
Permissions.SetValue(ref value, sendTTSMessages, GuildPermission.SendTTSMessages);
@@ -166,6 +170,7 @@ namespace Discord
bool manageGuild = false,
bool addReactions = false,
bool viewAuditLog = false,
+ bool viewGuildInsights = false,
bool viewChannel = false,
bool sendMessages = false,
bool sendTTSMessages = false,
@@ -198,6 +203,7 @@ namespace Discord
manageGuild: manageGuild,
addReactions: addReactions,
viewAuditLog: viewAuditLog,
+ viewGuildInsights: viewGuildInsights,
viewChannel: viewChannel,
sendMessages: sendMessages,
sendTTSMessages: sendTTSMessages,
@@ -231,6 +237,7 @@ namespace Discord
bool? manageGuild = null,
bool? addReactions = null,
bool? viewAuditLog = null,
+ bool? viewGuildInsights = null,
bool? viewChannel = null,
bool? sendMessages = null,
bool? sendTTSMessages = null,
@@ -254,7 +261,7 @@ namespace Discord
bool? manageWebhooks = null,
bool? manageEmojis = null)
=> new GuildPermissions(RawValue, createInstantInvite, kickMembers, banMembers, administrator, manageChannels, manageGuild, addReactions,
- viewAuditLog, viewChannel, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles,
+ viewAuditLog, viewGuildInsights, viewChannel, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles,
readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers,
useVoiceActivation, prioritySpeaker, stream, changeNickname, manageNicknames, manageRoles, manageWebhooks, manageEmojis);
diff --git a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
index 04bb2f668..7876d49ff 100644
--- a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
@@ -76,6 +76,10 @@ namespace Discord
public PermValue MoveMembers => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.MoveMembers);
/// If Allowed, a user may use voice-activity-detection rather than push-to-talk.
public PermValue UseVAD => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.UseVAD);
+ /// If Allowed, a user may use priority speaker in a voice channel.
+ public PermValue PrioritySpeaker => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.PrioritySpeaker);
+ /// If Allowed, a user may go live in a voice channel.
+ public PermValue Stream => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.Stream);
/// If Allowed, a user may adjust role permissions. This also implicitly grants all other permissions.
public PermValue ManageRoles => Permissions.GetValue(AllowValue, DenyValue, ChannelPermission.ManageRoles);
@@ -109,7 +113,9 @@ namespace Discord
PermValue? moveMembers = null,
PermValue? useVoiceActivation = null,
PermValue? manageRoles = null,
- PermValue? manageWebhooks = null)
+ PermValue? manageWebhooks = null,
+ PermValue? prioritySpeaker = null,
+ PermValue? stream = null)
{
Permissions.SetValue(ref allowValue, ref denyValue, createInstantInvite, ChannelPermission.CreateInstantInvite);
Permissions.SetValue(ref allowValue, ref denyValue, manageChannel, ChannelPermission.ManageChannels);
@@ -129,6 +135,8 @@ namespace Discord
Permissions.SetValue(ref allowValue, ref denyValue, deafenMembers, ChannelPermission.DeafenMembers);
Permissions.SetValue(ref allowValue, ref denyValue, moveMembers, ChannelPermission.MoveMembers);
Permissions.SetValue(ref allowValue, ref denyValue, useVoiceActivation, ChannelPermission.UseVAD);
+ Permissions.SetValue(ref allowValue, ref denyValue, prioritySpeaker, ChannelPermission.PrioritySpeaker);
+ Permissions.SetValue(ref allowValue, ref denyValue, stream, ChannelPermission.Stream);
Permissions.SetValue(ref allowValue, ref denyValue, manageRoles, ChannelPermission.ManageRoles);
Permissions.SetValue(ref allowValue, ref denyValue, manageWebhooks, ChannelPermission.ManageWebhooks);
@@ -159,10 +167,12 @@ namespace Discord
PermValue moveMembers = PermValue.Inherit,
PermValue useVoiceActivation = PermValue.Inherit,
PermValue manageRoles = PermValue.Inherit,
- PermValue manageWebhooks = PermValue.Inherit)
+ PermValue manageWebhooks = PermValue.Inherit,
+ PermValue prioritySpeaker = PermValue.Inherit,
+ PermValue stream = PermValue.Inherit)
: this(0, 0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
- moveMembers, useVoiceActivation, manageRoles, manageWebhooks) { }
+ moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream) { }
///
/// Initializes a new from the current one, changing the provided
@@ -188,10 +198,12 @@ namespace Discord
PermValue? moveMembers = null,
PermValue? useVoiceActivation = null,
PermValue? manageRoles = null,
- PermValue? manageWebhooks = null)
+ PermValue? manageWebhooks = null,
+ PermValue? prioritySpeaker = null,
+ PermValue? stream = null)
=> new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
- moveMembers, useVoiceActivation, manageRoles, manageWebhooks);
+ moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream);
///
/// Creates a of all the values that are allowed.
diff --git a/src/Discord.Net.Core/Entities/Roles/IRole.cs b/src/Discord.Net.Core/Entities/Roles/IRole.cs
index 66556fc2c..c02322be9 100644
--- a/src/Discord.Net.Core/Entities/Roles/IRole.cs
+++ b/src/Discord.Net.Core/Entities/Roles/IRole.cs
@@ -65,6 +65,13 @@ namespace Discord
/// An representing the position of the role in the role list of the guild.
///
int Position { get; }
+ ///
+ /// Gets the tags related to this role.
+ ///
+ ///
+ /// A object containing all tags related to this role.
+ ///
+ RoleTags Tags { get; }
///
/// Modifies this role.
diff --git a/src/Discord.Net.Core/Entities/Roles/RoleTags.cs b/src/Discord.Net.Core/Entities/Roles/RoleTags.cs
new file mode 100644
index 000000000..d0cbd3580
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Roles/RoleTags.cs
@@ -0,0 +1,40 @@
+namespace Discord
+{
+ ///
+ /// Provides tags related to a discord role.
+ ///
+ public class RoleTags
+ {
+ ///
+ /// Gets the identifier of the bot that this role belongs to, if it does.
+ ///
+ ///
+ /// A if this role belongs to a bot; otherwise
+ /// .
+ ///
+ public ulong? BotId { get; }
+ ///
+ /// Gets the identifier of the integration that this role belongs to, if it does.
+ ///
+ ///
+ /// A if this role belongs to an integration; otherwise
+ /// .
+ ///
+ public ulong? IntegrationId { get; }
+ ///
+ /// Gets if this role is the guild's premium subscriber (booster) role.
+ ///
+ ///
+ /// if this role is the guild's premium subscriber role;
+ /// otherwise .
+ ///
+ public bool IsPremiumSubscriberRole { get; }
+
+ internal RoleTags(ulong? botId, ulong? integrationId, bool isPremiumSubscriber)
+ {
+ BotId = botId;
+ IntegrationId = integrationId;
+ IsPremiumSubscriberRole = isPremiumSubscriber;
+ }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Teams/ITeam.cs b/src/Discord.Net.Core/Entities/Teams/ITeam.cs
new file mode 100644
index 000000000..5ef3e4253
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Teams/ITeam.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+
+namespace Discord
+{
+ ///
+ /// Represents a Discord Team.
+ ///
+ public interface ITeam
+ {
+ ///
+ /// Gets the team icon url.
+ ///
+ string IconUrl { get; }
+ ///
+ /// Gets the team unique identifier.
+ ///
+ ulong Id { get; }
+ ///
+ /// Gets the members of this team.
+ ///
+ IReadOnlyList TeamMembers { get; }
+ ///
+ /// Gets the user identifier that owns this team.
+ ///
+ ulong OwnerUserId { get; }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Teams/ITeamMember.cs b/src/Discord.Net.Core/Entities/Teams/ITeamMember.cs
new file mode 100644
index 000000000..fe0e499e5
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Teams/ITeamMember.cs
@@ -0,0 +1,25 @@
+namespace Discord
+{
+ ///
+ /// Represents a Discord Team member.
+ ///
+ public interface ITeamMember
+ {
+ ///
+ /// Gets the membership state of this team member.
+ ///
+ MembershipState MembershipState { get; }
+ ///
+ /// Gets the permissions of this team member.
+ ///
+ string[] Permissions { get; }
+ ///
+ /// Gets the team unique identifier for this team member.
+ ///
+ ulong TeamId { get; }
+ ///
+ /// Gets the Discord user of this team member.
+ ///
+ IUser User { get; }
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Teams/MembershipState.cs b/src/Discord.Net.Core/Entities/Teams/MembershipState.cs
new file mode 100644
index 000000000..45b1693b0
--- /dev/null
+++ b/src/Discord.Net.Core/Entities/Teams/MembershipState.cs
@@ -0,0 +1,11 @@
+namespace Discord
+{
+ ///
+ /// Represents the membership state of a team member.
+ ///
+ public enum MembershipState
+ {
+ Invited,
+ Accepted,
+ }
+}
diff --git a/src/Discord.Net.Core/Entities/Users/IGuildUser.cs b/src/Discord.Net.Core/Entities/Users/IGuildUser.cs
index 92b146e05..582e9e7a7 100644
--- a/src/Discord.Net.Core/Entities/Users/IGuildUser.cs
+++ b/src/Discord.Net.Core/Entities/Users/IGuildUser.cs
@@ -68,12 +68,17 @@ namespace Discord
///
IReadOnlyCollection RoleIds { get; }
+ ///
+ /// Whether the user has passed the guild's Membership Screening requirements.
+ ///
+ bool? IsPending { get; }
+
///
/// Gets the level permissions granted to this user to a given channel.
///
///
/// The following example checks if the current user has the ability to send a message with attachment in
- /// this channel; if so, uploads a file via .
+ /// this channel; if so, uploads a file via .
///
/// if (currentUser?.GetPermissions(targetChannel)?.AttachFiles)
/// await targetChannel.SendFileAsync("fortnite.png");
diff --git a/src/Discord.Net.Core/Entities/Users/IPresence.cs b/src/Discord.Net.Core/Entities/Users/IPresence.cs
index 620eb907c..a17ac0df2 100644
--- a/src/Discord.Net.Core/Entities/Users/IPresence.cs
+++ b/src/Discord.Net.Core/Entities/Users/IPresence.cs
@@ -19,5 +19,9 @@ namespace Discord
/// Gets the set of clients where this user is currently active.
///
IImmutableSet ActiveClients { get; }
+ ///
+ /// Gets the list of activities that this user currently has available.
+ ///
+ IImmutableList Activities { get; }
}
}
diff --git a/src/Discord.Net.Core/Entities/Users/IUser.cs b/src/Discord.Net.Core/Entities/Users/IUser.cs
index c36fb2326..e6008aab6 100644
--- a/src/Discord.Net.Core/Entities/Users/IUser.cs
+++ b/src/Discord.Net.Core/Entities/Users/IUser.cs
@@ -75,6 +75,16 @@ namespace Discord
/// Gets the username for this user.
///
string Username { get; }
+ ///
+ /// Gets the public flags that are applied to this user's account.
+ ///
+ ///
+ /// This value is determined by bitwise OR-ing values together.
+ ///
+ ///
+ /// The value of public flags for this user.
+ ///
+ UserProperties? PublicFlags { get; }
///
/// Gets the direct message channel of this user, or create one if it does not already exist.
diff --git a/src/Discord.Net.Core/Entities/Users/UserProperties.cs b/src/Discord.Net.Core/Entities/Users/UserProperties.cs
index 4f7272daa..b6deb744b 100644
--- a/src/Discord.Net.Core/Entities/Users/UserProperties.cs
+++ b/src/Discord.Net.Core/Entities/Users/UserProperties.cs
@@ -10,32 +10,62 @@ namespace Discord
///
None = 0,
///
- /// Flag given to Discord staff.
+ /// Flag given to users who are a Discord employee.
///
- Staff = 0b1,
+ Staff = 1 << 0,
///
- /// Flag given to Discord partners.
+ /// Flag given to users who are owners of a partnered Discord server.
///
- Partner = 0b10,
+ Partner = 1 << 1,
+ ///
+ /// Flag given to users in HypeSquad events.
+ ///
+ HypeSquadEvents = 1 << 2,
///
/// Flag given to users who have participated in the bug report program.
+ /// This flag is obsolete, use instead.
+ ///
+ [Obsolete("Use BugHunterLevel1 instead.")]
+ BugHunter = 1 << 3,
+ ///
+ /// Flag given to users who have participated in the bug report program and are level 1.
///
- BugHunter = 0b1000,
+ BugHunterLevel1 = 1 << 3,
///
/// Flag given to users who are in the HypeSquad House of Bravery.
///
- HypeSquadBravery = 0b100_0000,
+ HypeSquadBravery = 1 << 6,
///
/// Flag given to users who are in the HypeSquad House of Brilliance.
///
- HypeSquadBrilliance = 0b1000_0000,
+ HypeSquadBrilliance = 1 << 7,
///
/// Flag given to users who are in the HypeSquad House of Balance.
///
- HypeSquadBalance = 0b1_0000_0000,
+ HypeSquadBalance = 1 << 8,
///
/// Flag given to users who subscribed to Nitro before games were added.
///
- EarlySupporter = 0b10_0000_0000,
+ EarlySupporter = 1 << 9,
+ ///
+ /// Flag given to users who are part of a team.
+ ///
+ TeamUser = 1 << 10,
+ ///
+ /// Flag given to users who represent Discord (System).
+ ///
+ System = 1 << 12,
+ ///
+ /// Flag given to users who have participated in the bug report program and are level 2.
+ ///
+ BugHunterLevel2 = 1 << 14,
+ ///
+ /// Flag given to users who are verified bots.
+ ///
+ VerifiedBot = 1 << 16,
+ ///
+ /// Flag given to users that developed bots and early verified their accounts.
+ ///
+ EarlyVerifiedBotDeveloper = 1 << 17,
}
}
diff --git a/src/Discord.Net.Core/Extensions/MessageExtensions.cs b/src/Discord.Net.Core/Extensions/MessageExtensions.cs
index 64a1d89ab..b043d7b77 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}";
}
///
@@ -71,5 +71,25 @@ namespace Discord
foreach (var rxn in reactions)
await msg.RemoveReactionAsync(rxn, user, options).ConfigureAwait(false);
}
+
+ ///
+ /// Sends an inline reply that references a message.
+ ///
+ /// The message to be sent.
+ /// Determines whether the message should be read aloud by Discord or not.
+ /// The to be sent.
+ ///
+ /// Specifies if notifications are sent for mentioned users and roles in the message .
+ /// If null, all mentioned roles and users will be notified.
+ ///
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents an asynchronous send operation for delivering the message. The task result
+ /// contains the sent message.
+ ///
+ public static async Task ReplyAsync(this IUserMessage msg, string text = null, bool isTTS = false, Embed embed = null, AllowedMentions allowedMentions = null, RequestOptions options = null)
+ {
+ return await msg.Channel.SendMessageAsync(text, isTTS, embed, options, allowedMentions, new MessageReference(messageId: msg.Id)).ConfigureAwait(false);
+ }
}
}
diff --git a/src/Discord.Net.Core/IDiscordClient.cs b/src/Discord.Net.Core/IDiscordClient.cs
index f972cd71d..d7d6d2856 100644
--- a/src/Discord.Net.Core/IDiscordClient.cs
+++ b/src/Discord.Net.Core/IDiscordClient.cs
@@ -274,5 +274,15 @@ namespace Discord
/// that represents the number of shards that should be used with this account.
///
Task GetRecommendedShardCountAsync(RequestOptions options = null);
+
+ ///
+ /// Gets the gateway information related to the bot.
+ ///
+ /// The options to be used when sending the request.
+ ///
+ /// A task that represents the asynchronous get operation. The task result contains a
+ /// that represents the gateway information related to the bot.
+ ///
+ Task GetBotGatewayAsync(RequestOptions options = null);
}
}
diff --git a/src/Discord.Net.Core/Net/BucketId.cs b/src/Discord.Net.Core/Net/BucketId.cs
new file mode 100644
index 000000000..96281a0ed
--- /dev/null
+++ b/src/Discord.Net.Core/Net/BucketId.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+
+namespace Discord.Net
+{
+ ///
+ /// Represents a ratelimit bucket.
+ ///
+ public class BucketId : IEquatable
+ {
+ ///
+ /// Gets the http method used to make the request if available.
+ ///
+ public string HttpMethod { get; }
+ ///
+ /// Gets the endpoint that is going to be requested if available.
+ ///
+ public string Endpoint { get; }
+ ///
+ /// Gets the major parameters of the route.
+ ///
+ public IOrderedEnumerable> MajorParameters { get; }
+ ///
+ /// Gets the hash of this bucket.
+ ///
+ ///
+ /// The hash is provided by Discord to group ratelimits.
+ ///
+ public string BucketHash { get; }
+ ///
+ /// Gets if this bucket is a hash type.
+ ///
+ public bool IsHashBucket { get => BucketHash != null; }
+
+ private BucketId(string httpMethod, string endpoint, IEnumerable> majorParameters, string bucketHash)
+ {
+ HttpMethod = httpMethod;
+ Endpoint = endpoint;
+ MajorParameters = majorParameters.OrderBy(x => x.Key);
+ BucketHash = bucketHash;
+ }
+
+ ///
+ /// Creates a new based on the
+ /// and .
+ ///
+ /// Http method used to make the request.
+ /// Endpoint that is going to receive requests.
+ /// Major parameters of the route of this endpoint.
+ ///
+ /// A based on the
+ /// and the with the provided data.
+ ///
+ public static BucketId Create(string httpMethod, string endpoint, Dictionary majorParams)
+ {
+ Preconditions.NotNullOrWhitespace(endpoint, nameof(endpoint));
+ majorParams ??= new Dictionary();
+ return new BucketId(httpMethod, endpoint, majorParams, null);
+ }
+
+ ///
+ /// Creates a new based on a
+ /// and a previous .
+ ///
+ /// Bucket hash provided by Discord.
+ /// that is going to be upgraded to a hash type.
+ ///
+ /// A based on the
+ /// and .
+ ///
+ public static BucketId Create(string hash, BucketId oldBucket)
+ {
+ Preconditions.NotNullOrWhitespace(hash, nameof(hash));
+ Preconditions.NotNull(oldBucket, nameof(oldBucket));
+ return new BucketId(null, null, oldBucket.MajorParameters, hash);
+ }
+
+ ///
+ /// Gets the string that will define this bucket as a hash based one.
+ ///
+ ///
+ /// A that defines this bucket as a hash based one.
+ ///
+ public string GetBucketHash()
+ => IsHashBucket ? $"{BucketHash}:{string.Join("/", MajorParameters.Select(x => x.Value))}" : null;
+
+ ///
+ /// Gets the string that will define this bucket as an endpoint based one.
+ ///
+ ///
+ /// A that defines this bucket as an endpoint based one.
+ ///
+ public string GetUniqueEndpoint()
+ => HttpMethod != null ? $"{HttpMethod} {Endpoint}" : Endpoint;
+
+ public override bool Equals(object obj)
+ => Equals(obj as BucketId);
+
+ public override int GetHashCode()
+ => IsHashBucket ? (BucketHash, string.Join("/", MajorParameters.Select(x => x.Value))).GetHashCode() : (HttpMethod, Endpoint).GetHashCode();
+
+ public override string ToString()
+ => GetBucketHash() ?? GetUniqueEndpoint();
+
+ public bool Equals(BucketId other)
+ {
+ if (other is null)
+ return false;
+ if (ReferenceEquals(this, other))
+ return true;
+ if (GetType() != other.GetType())
+ return false;
+ return ToString() == other.ToString();
+ }
+ }
+}
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.Core/RequestOptions.cs b/src/Discord.Net.Core/RequestOptions.cs
index 1b05df2a3..dbb240273 100644
--- a/src/Discord.Net.Core/RequestOptions.cs
+++ b/src/Discord.Net.Core/RequestOptions.cs
@@ -1,3 +1,4 @@
+using Discord.Net;
using System.Threading;
namespace Discord
@@ -57,9 +58,10 @@ namespace Discord
public bool? UseSystemClock { get; set; }
internal bool IgnoreState { get; set; }
- internal string BucketId { get; set; }
+ internal BucketId BucketId { get; set; }
internal bool IsClientBucket { get; set; }
internal bool IsReactionBucket { get; set; }
+ internal bool IsGatewayBucket { get; set; }
internal static RequestOptions CreateOrClone(RequestOptions options)
{
diff --git a/src/Discord.Net.Rest/Entities/Messages/AllowedMentions.cs b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs
similarity index 73%
rename from src/Discord.Net.Rest/Entities/Messages/AllowedMentions.cs
rename to src/Discord.Net.Rest/API/Common/AllowedMentions.cs
index 5ab96032f..7737a464f 100644
--- a/src/Discord.Net.Rest/Entities/Messages/AllowedMentions.cs
+++ b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs
@@ -2,7 +2,7 @@ using Newtonsoft.Json;
namespace Discord.API
{
- public class AllowedMentions
+ internal class AllowedMentions
{
[JsonProperty("parse")]
public Optional Parse { get; set; }
@@ -11,5 +11,7 @@ namespace Discord.API
public Optional Roles { get; set; }
[JsonProperty("users")]
public Optional Users { get; set; }
+ [JsonProperty("replied_user")]
+ public Optional RepliedUser { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/Application.cs b/src/Discord.Net.Rest/API/Common/Application.cs
index ca4c443f1..aba3e524b 100644
--- a/src/Discord.Net.Rest/API/Common/Application.cs
+++ b/src/Discord.Net.Rest/API/Common/Application.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
@@ -15,6 +15,12 @@ namespace Discord.API
public ulong Id { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
+ [JsonProperty("bot_public")]
+ public bool IsBotPublic { get; set; }
+ [JsonProperty("bot_require_code_grant")]
+ public bool BotRequiresCodeGrant { get; set; }
+ [JsonProperty("team")]
+ public Team Team { get; set; }
[JsonProperty("flags"), Int53]
public Optional Flags { get; set; }
diff --git a/src/Discord.Net.Rest/API/Common/Guild.cs b/src/Discord.Net.Rest/API/Common/Guild.cs
index 56bd841ea..46075ce4d 100644
--- a/src/Discord.Net.Rest/API/Common/Guild.cs
+++ b/src/Discord.Net.Rest/API/Common/Guild.cs
@@ -13,6 +13,8 @@ namespace Discord.API
public string Icon { get; set; }
[JsonProperty("splash")]
public string Splash { get; set; }
+ [JsonProperty("discovery_splash")]
+ public string DiscoverySplash { get; set; }
[JsonProperty("owner_id")]
public ulong OwnerId { get; set; }
[JsonProperty("region")]
@@ -22,9 +24,9 @@ namespace Discord.API
[JsonProperty("afk_timeout")]
public int AFKTimeout { get; set; }
[JsonProperty("embed_enabled")]
- public bool EmbedEnabled { get; set; }
+ public Optional EmbedEnabled { get; set; }
[JsonProperty("embed_channel_id")]
- public ulong? EmbedChannelId { get; set; }
+ public Optional EmbedChannelId { get; set; }
[JsonProperty("verification_level")]
public VerificationLevel VerificationLevel { get; set; }
[JsonProperty("default_message_notifications")]
@@ -43,6 +45,10 @@ namespace Discord.API
public MfaLevel MfaLevel { get; set; }
[JsonProperty("application_id")]
public ulong? ApplicationId { get; set; }
+ [JsonProperty("widget_enabled")]
+ public Optional WidgetEnabled { get; set; }
+ [JsonProperty("widget_channel_id")]
+ public Optional WidgetChannelId { get; set; }
[JsonProperty("system_channel_id")]
public ulong? SystemChannelId { get; set; }
[JsonProperty("premium_tier")]
@@ -56,9 +62,23 @@ namespace Discord.API
// this value is inverted, flags set will turn OFF features
[JsonProperty("system_channel_flags")]
public SystemChannelMessageDeny SystemChannelFlags { get; set; }
+ [JsonProperty("rules_channel_id")]
+ public ulong? RulesChannelId { get; set; }
+ [JsonProperty("max_presences")]
+ public Optional MaxPresences { get; set; }
+ [JsonProperty("max_members")]
+ public Optional MaxMembers { get; set; }
[JsonProperty("premium_subscription_count")]
public int? PremiumSubscriptionCount { get; set; }
[JsonProperty("preferred_locale")]
public string PreferredLocale { get; set; }
+ [JsonProperty("public_updates_channel_id")]
+ public ulong? PublicUpdatesChannelId { get; set; }
+ [JsonProperty("max_video_channel_users")]
+ public Optional MaxVideoChannelUsers { get; set; }
+ [JsonProperty("approximate_member_count")]
+ public Optional ApproximateMemberCount { get; set; }
+ [JsonProperty("approximate_presence_count")]
+ public Optional ApproximatePresenceCount { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/GuildEmbed.cs b/src/Discord.Net.Rest/API/Common/GuildEmbed.cs
index ff8b8e180..d81632181 100644
--- a/src/Discord.Net.Rest/API/Common/GuildEmbed.cs
+++ b/src/Discord.Net.Rest/API/Common/GuildEmbed.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
@@ -8,6 +8,6 @@ namespace Discord.API
[JsonProperty("enabled")]
public bool Enabled { get; set; }
[JsonProperty("channel_id")]
- public ulong ChannelId { get; set; }
+ public ulong? ChannelId { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/GuildMember.cs b/src/Discord.Net.Rest/API/Common/GuildMember.cs
index 940eb925a..fc2092d6c 100644
--- a/src/Discord.Net.Rest/API/Common/GuildMember.cs
+++ b/src/Discord.Net.Rest/API/Common/GuildMember.cs
@@ -18,6 +18,8 @@ namespace Discord.API
public Optional Deaf { get; set; }
[JsonProperty("mute")]
public Optional Mute { get; set; }
+ [JsonProperty("pending")]
+ public Optional Pending { get; set; }
[JsonProperty("premium_since")]
public Optional PremiumSince { get; set; }
}
diff --git a/src/Discord.Net.Rest/API/Common/GuildWidget.cs b/src/Discord.Net.Rest/API/Common/GuildWidget.cs
new file mode 100644
index 000000000..c15ad8aac
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/GuildWidget.cs
@@ -0,0 +1,13 @@
+#pragma warning disable CS1591
+using Newtonsoft.Json;
+
+namespace Discord.API
+{
+ internal class GuildWidget
+ {
+ [JsonProperty("enabled")]
+ public bool Enabled { get; set; }
+ [JsonProperty("channel_id")]
+ public ulong? ChannelId { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/Invite.cs b/src/Discord.Net.Rest/API/Common/Invite.cs
index 649bc37ec..aba267f34 100644
--- a/src/Discord.Net.Rest/API/Common/Invite.cs
+++ b/src/Discord.Net.Rest/API/Common/Invite.cs
@@ -11,9 +11,15 @@ namespace Discord.API
public Optional Guild { get; set; }
[JsonProperty("channel")]
public InviteChannel Channel { get; set; }
+ [JsonProperty("inviter")]
+ public Optional Inviter { get; set; }
[JsonProperty("approximate_presence_count")]
public Optional PresenceCount { get; set; }
[JsonProperty("approximate_member_count")]
public Optional MemberCount { get; set; }
+ [JsonProperty("target_user")]
+ public Optional TargetUser { get; set; }
+ [JsonProperty("target_user_type")]
+ public Optional TargetUserType { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/InviteMetadata.cs b/src/Discord.Net.Rest/API/Common/InviteMetadata.cs
index ca019b79b..f818de699 100644
--- a/src/Discord.Net.Rest/API/Common/InviteMetadata.cs
+++ b/src/Discord.Net.Rest/API/Common/InviteMetadata.cs
@@ -6,19 +6,15 @@ namespace Discord.API
{
internal class InviteMetadata : Invite
{
- [JsonProperty("inviter")]
- public User Inviter { get; set; }
[JsonProperty("uses")]
- public Optional Uses { get; set; }
+ public int Uses { get; set; }
[JsonProperty("max_uses")]
- public Optional MaxUses { get; set; }
+ public int MaxUses { get; set; }
[JsonProperty("max_age")]
- public Optional MaxAge { get; set; }
+ public int MaxAge { get; set; }
[JsonProperty("temporary")]
public bool Temporary { get; set; }
[JsonProperty("created_at")]
- public Optional CreatedAt { get; set; }
- [JsonProperty("revoked")]
- public bool Revoked { get; set; }
+ public DateTimeOffset CreatedAt { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/MembershipState.cs b/src/Discord.Net.Rest/API/Common/MembershipState.cs
new file mode 100644
index 000000000..67fcc8908
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/MembershipState.cs
@@ -0,0 +1,9 @@
+namespace Discord.API
+{
+ internal enum MembershipState
+ {
+ None = 0,
+ Invited = 1,
+ Accepted = 2,
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/Message.cs b/src/Discord.Net.Rest/API/Common/Message.cs
index b4529d457..b781de346 100644
--- a/src/Discord.Net.Rest/API/Common/Message.cs
+++ b/src/Discord.Net.Rest/API/Common/Message.cs
@@ -56,5 +56,7 @@ namespace Discord.API
public Optional Flags { get; set; }
[JsonProperty("allowed_mentions")]
public Optional AllowedMentions { get; set; }
+ [JsonProperty("referenced_message")]
+ public Optional ReferencedMessage { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/MessageFlags.cs b/src/Discord.Net.Rest/API/Common/MessageFlags.cs
deleted file mode 100644
index ebe4e80ca..000000000
--- a/src/Discord.Net.Rest/API/Common/MessageFlags.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace Discord.API
-{
- [Flags]
- internal enum MessageFlags : byte // probably safe to constrain this to 8 values, if not, it's internal so who cares
- {
- Suppressed = 0x04,
- }
-}
diff --git a/src/Discord.Net.Rest/API/Common/MessageReference.cs b/src/Discord.Net.Rest/API/Common/MessageReference.cs
index 8c0f8fe14..6cc7603e0 100644
--- a/src/Discord.Net.Rest/API/Common/MessageReference.cs
+++ b/src/Discord.Net.Rest/API/Common/MessageReference.cs
@@ -8,7 +8,7 @@ namespace Discord.API
public Optional MessageId { get; set; }
[JsonProperty("channel_id")]
- public ulong ChannelId { get; set; }
+ public Optional ChannelId { get; set; } // Optional when sending, always present when receiving
[JsonProperty("guild_id")]
public Optional GuildId { get; set; }
diff --git a/src/Discord.Net.Rest/API/Common/Presence.cs b/src/Discord.Net.Rest/API/Common/Presence.cs
index 22526e8ac..b37ad4229 100644
--- a/src/Discord.Net.Rest/API/Common/Presence.cs
+++ b/src/Discord.Net.Rest/API/Common/Presence.cs
@@ -1,5 +1,6 @@
#pragma warning disable CS1591
using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
namespace Discord.API
@@ -26,5 +27,9 @@ namespace Discord.API
// "client_status": { "desktop": "dnd", "mobile": "dnd" }
[JsonProperty("client_status")]
public Optional> ClientStatus { get; set; }
+ [JsonProperty("activities")]
+ public List Activities { get; set; }
+ [JsonProperty("premium_since")]
+ public Optional PremiumSince { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/Role.cs b/src/Discord.Net.Rest/API/Common/Role.cs
index 856a8695f..190ae25c0 100644
--- a/src/Discord.Net.Rest/API/Common/Role.cs
+++ b/src/Discord.Net.Rest/API/Common/Role.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
@@ -21,5 +21,7 @@ namespace Discord.API
public ulong Permissions { get; set; }
[JsonProperty("managed")]
public bool Managed { get; set; }
+ [JsonProperty("tags")]
+ public Optional Tags { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/RoleTags.cs b/src/Discord.Net.Rest/API/Common/RoleTags.cs
new file mode 100644
index 000000000..6446f2037
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/RoleTags.cs
@@ -0,0 +1,15 @@
+#pragma warning disable CS1591
+using Newtonsoft.Json;
+
+namespace Discord.API
+{
+ internal class RoleTags
+ {
+ [JsonProperty("bot_id")]
+ public Optional BotId { get; set; }
+ [JsonProperty("integration_id")]
+ public Optional IntegrationId { get; set; }
+ [JsonProperty("premium_subscriber")]
+ public Optional IsPremiumSubscriber { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs b/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs
new file mode 100644
index 000000000..29d5ddf85
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/SessionStartLimit.cs
@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+
+namespace Discord.API.Rest
+{
+ internal class SessionStartLimit
+ {
+ [JsonProperty("total")]
+ public int Total { get; set; }
+ [JsonProperty("remaining")]
+ public int Remaining { get; set; }
+ [JsonProperty("reset_after")]
+ public int ResetAfter { get; set; }
+ [JsonProperty("max_concurrency")]
+ public int MaxConcurrency { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/Team.cs b/src/Discord.Net.Rest/API/Common/Team.cs
new file mode 100644
index 000000000..4910f43f7
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/Team.cs
@@ -0,0 +1,17 @@
+#pragma warning disable CS1591
+using Newtonsoft.Json;
+
+namespace Discord.API
+{
+ internal class Team
+ {
+ [JsonProperty("icon")]
+ public Optional Icon { get; set; }
+ [JsonProperty("id")]
+ public ulong Id { get; set; }
+ [JsonProperty("members")]
+ public TeamMember[] TeamMembers { get; set; }
+ [JsonProperty("owner_user_id")]
+ public ulong OwnerUserId { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/TeamMember.cs b/src/Discord.Net.Rest/API/Common/TeamMember.cs
new file mode 100644
index 000000000..788f73b61
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/TeamMember.cs
@@ -0,0 +1,17 @@
+#pragma warning disable CS1591
+using Newtonsoft.Json;
+
+namespace Discord.API
+{
+ internal class TeamMember
+ {
+ [JsonProperty("membership_state")]
+ public MembershipState MembershipState { get; set; }
+ [JsonProperty("permissions")]
+ public string[] Permissions { get; set; }
+ [JsonProperty("team_id")]
+ public ulong TeamId { get; set; }
+ [JsonProperty("user")]
+ public User User { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Common/User.cs b/src/Discord.Net.Rest/API/Common/User.cs
index 2eff3753d..d1f436afb 100644
--- a/src/Discord.Net.Rest/API/Common/User.cs
+++ b/src/Discord.Net.Rest/API/Common/User.cs
@@ -29,5 +29,7 @@ namespace Discord.API
public Optional PremiumType { get; set; }
[JsonProperty("locale")]
public Optional Locale { get; set; }
+ [JsonProperty("public_flags")]
+ public Optional PublicFlags { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
index a102bd38d..aec43dbef 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
@@ -14,12 +14,16 @@ namespace Discord.API.Rest
public Optional CategoryId { get; set; }
[JsonProperty("position")]
public Optional Position { get; set; }
+ [JsonProperty("permission_overwrites")]
+ public Optional Overwrites { get; set; }
//Text channels
[JsonProperty("topic")]
public Optional Topic { get; set; }
[JsonProperty("nsfw")]
public Optional IsNsfw { get; set; }
+ [JsonProperty("rate_limit_per_user")]
+ public Optional SlowModeInterval { get; set; }
//Voice channels
[JsonProperty("bitrate")]
diff --git a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
index 4b56658d6..e64532864 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
@@ -17,6 +17,8 @@ namespace Discord.API.Rest
public Optional