Browse Source

Add remark instead of exception

pull/1774/head
Paulo 4 years ago
parent
commit
6b2b9db980
2 changed files with 10 additions and 2 deletions
  1. +10
    -0
      src/Discord.Net.WebSocket/BaseSocketClient.cs
  2. +0
    -2
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 10
- 0
src/Discord.Net.WebSocket/BaseSocketClient.cs View File

@@ -209,6 +209,12 @@ namespace Discord.WebSocket
/// <param name="name">The name of the game.</param> /// <param name="name">The name of the game.</param>
/// <param name="streamUrl">If streaming, the URL of the stream. Must be a valid Twitch URL.</param> /// <param name="streamUrl">If streaming, the URL of the stream. Must be a valid Twitch URL.</param>
/// <param name="type">The type of the game.</param> /// <param name="type">The type of the game.</param>
/// <remarks>
/// <note type="warning">
/// Bot accounts cannot use <see cref="ActivityType.CustomStatus"/> as their activity
/// and it will have no effect.
/// </note>
/// </remarks>
/// <returns> /// <returns>
/// A task that represents the asynchronous set operation. /// A task that represents the asynchronous set operation.
/// </returns> /// </returns>
@@ -222,6 +228,10 @@ namespace Discord.WebSocket
/// Discord will only accept setting of name and the type of activity. /// Discord will only accept setting of name and the type of activity.
/// </note> /// </note>
/// <note type="warning"> /// <note type="warning">
/// Bot accounts cannot use <see cref="ActivityType.CustomStatus"/> as their activity
/// and it will have no effect.
/// </note>
/// <note type="warning">
/// Rich Presence cannot be set via this method or client. Rich Presence is strictly limited to RPC /// Rich Presence cannot be set via this method or client. Rich Presence is strictly limited to RPC
/// clients only. /// clients only.
/// </note> /// </note>


+ 0
- 2
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -450,8 +450,6 @@ namespace Discord.WebSocket
/// </example> /// </example>
public override async Task SetGameAsync(string name, string streamUrl = null, ActivityType type = ActivityType.Playing) public override async Task SetGameAsync(string name, string streamUrl = null, ActivityType type = ActivityType.Playing)
{ {
if (type == ActivityType.CustomStatus)
throw new InvalidOperationException("Only user accounts can use CustomStatus as their activity.");
if (!string.IsNullOrEmpty(streamUrl)) if (!string.IsNullOrEmpty(streamUrl))
Activity = new StreamingGame(name, streamUrl); Activity = new StreamingGame(name, streamUrl);
else if (!string.IsNullOrEmpty(name)) else if (!string.IsNullOrEmpty(name))


Loading…
Cancel
Save