From 5a824a5695d72a62e28e0a307a5be446557291be Mon Sep 17 00:00:00 2001
From: Still Hsu <341464@gmail.com>
Date: Sat, 5 May 2018 15:44:15 +0800
Subject: [PATCH] Add missing exceptions
---
.../Entities/Channels/RestGroupChannel.cs | 26 +++++++++++++++++++
.../Entities/Channels/SocketDMChannel.cs | 2 ++
2 files changed, 28 insertions(+)
diff --git a/src/Discord.Net.Rest/Entities/Channels/RestGroupChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestGroupChannel.cs
index d9a6c1a31..34346555f 100644
--- a/src/Discord.Net.Rest/Entities/Channels/RestGroupChannel.cs
+++ b/src/Discord.Net.Rest/Entities/Channels/RestGroupChannel.cs
@@ -84,14 +84,40 @@ namespace Discord.Rest
=> ChannelHelper.GetPinnedMessagesAsync(this, Discord, options);
///
+ /// Message content is too long, length must be less or equal to .
public Task SendMessageAsync(string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendMessageAsync(this, Discord, text, isTTS, embed, options);
#if FILESYSTEM
///
+ ///
+ /// is a zero-length string, contains only white space, or contains one or more
+ /// invalid characters as defined by .
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// The specified path, file name, or both exceed the system-defined maximum length. For example, on
+ /// Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260
+ /// characters.
+ ///
+ ///
+ /// The specified path is invalid, (for example, it is on an unmapped drive).
+ ///
+ ///
+ /// specified a directory.-or- The caller does not have the required permission.
+ ///
+ ///
+ /// The file specified in was not found.
+ ///
+ /// is in an invalid format.
+ /// An I/O error occurred while opening the file.
+ /// Message content is too long, length must be less or equal to .
public Task SendFileAsync(string filePath, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendFileAsync(this, Discord, filePath, text, isTTS, embed, options);
#endif
///
+ /// Message content is too long, length must be less or equal to .
public Task SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendFileAsync(this, Discord, stream, filename, text, isTTS, embed, options);
diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
index eab60f6c9..763296590 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs
@@ -78,6 +78,7 @@ namespace Discord.WebSocket
=> ChannelHelper.GetPinnedMessagesAsync(this, Discord, options);
///
+ /// Message content is too long, length must be less or equal to .
public Task SendMessageAsync(string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendMessageAsync(this, Discord, text, isTTS, embed, options);
#if FILESYSTEM
@@ -86,6 +87,7 @@ namespace Discord.WebSocket
=> ChannelHelper.SendFileAsync(this, Discord, filePath, text, isTTS, embed, options);
#endif
///
+ /// Message content is too long, length must be less or equal to .
public Task SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null)
=> ChannelHelper.SendFileAsync(this, Discord, stream, filename, text, isTTS, embed, options);