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/Discord.Net.targets b/Discord.Net.targets
index adb42f7a9..9502e91dd 100644
--- a/Discord.Net.targets
+++ b/Discord.Net.targets
@@ -5,11 +5,11 @@
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 1d9235331..9ace4f22e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[](https://dev.azure.com/discord-net/Discord.Net/_build/latest?definitionId=1&branchName=dev)
[](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).
diff --git a/StyleAnalyzer.targets b/StyleAnalyzer.targets
new file mode 100644
index 000000000..bbb90b800
--- /dev/null
+++ b/StyleAnalyzer.targets
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+ true
+
+
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/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/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/Entities/Channels/GuildChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
index 93ca2e59a..339d6fffd 100644
--- a/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
+++ b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
@@ -28,7 +28,7 @@ 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; }
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/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..35458d87d 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.
///
///
@@ -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.
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/MessageReference.cs b/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
index 57a508a7c..029910e56 100644
--- a/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
+++ b/src/Discord.Net.Core/Entities/Messages/MessageReference.cs
@@ -3,7 +3,7 @@ using System.Diagnostics;
namespace Discord
{
///
- /// Contains the IDs sent from a crossposted message.
+ /// Contains the IDs sent from a crossposted message or inline reply.
///
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class MessageReference
@@ -16,13 +16,36 @@ namespace Discord
///
/// Gets the Channel ID of the original message.
///
- public ulong ChannelId { get; internal set; }
+ ///
+ /// It only will be the default value (zero) if it was instantiated with a in the constructor.
+ ///
+ public ulong ChannelId { get => InternalChannelId.GetValueOrDefault(); }
+ internal Optional InternalChannelId;
///
/// Gets the Guild ID of the original message.
///
public Optional GuildId { get; internal set; }
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The ID of the message that will be referenced. Used to reply to specific messages and the only parameter required for it.
+ ///
+ ///
+ /// The ID of the channel that will be referenced. It will be validated if sent.
+ ///
+ ///
+ /// The ID of the guild that will be referenced. It will be validated if sent.
+ ///
+ public MessageReference(ulong? messageId = null, ulong? channelId = null, ulong? guildId = null)
+ {
+ MessageId = messageId ?? Optional.Create();
+ InternalChannelId = channelId ?? Optional.Create();
+ GuildId = guildId ?? Optional.Create();
+ }
+
private string DebuggerDisplay
=> $"Channel ID: ({ChannelId}){(GuildId.IsSpecified ? $", Guild ID: ({GuildId.Value})" : "")}" +
$"{(MessageId.IsSpecified ? $", Message ID: ({MessageId.Value})" : "")}";
diff --git a/src/Discord.Net.Core/Entities/Messages/MessageType.cs b/src/Discord.Net.Core/Entities/Messages/MessageType.cs
index ee5f4fb4d..ad1f3a3cd 100644
--- a/src/Discord.Net.Core/Entities/Messages/MessageType.cs
+++ b/src/Discord.Net.Core/Entities/Messages/MessageType.cs
@@ -57,5 +57,12 @@ namespace Discord
/// The message for when a news channel subscription is added to a text channel.
///
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/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..0e4004c46 100644
--- a/src/Discord.Net.Core/Entities/Users/IGuildUser.cs
+++ b/src/Discord.Net.Core/Entities/Users/IGuildUser.cs
@@ -73,7 +73,7 @@ namespace Discord
///
///
/// 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/Extensions/MessageExtensions.cs b/src/Discord.Net.Core/Extensions/MessageExtensions.cs
index e44e397fa..b043d7b77 100644
--- a/src/Discord.Net.Core/Extensions/MessageExtensions.cs
+++ b/src/Discord.Net.Core/Extensions/MessageExtensions.cs
@@ -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/RequestOptions.cs b/src/Discord.Net.Core/RequestOptions.cs
index ad0a4e33f..dbb240273 100644
--- a/src/Discord.Net.Core/RequestOptions.cs
+++ b/src/Discord.Net.Core/RequestOptions.cs
@@ -61,6 +61,7 @@ namespace Discord
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/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/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/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/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/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/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