Browse Source

Move Name property from IChannel to IGuildChannel

pull/1194/head
Alex Gravely 6 years ago
parent
commit
cac7ce3a68
7 changed files with 9 additions and 17 deletions
  1. +0
    -8
      src/Discord.Net.Core/Entities/Channels/IChannel.cs
  2. +8
    -0
      src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
  3. +1
    -1
      src/Discord.Net.Core/Utils/MentionUtils.cs
  4. +0
    -2
      src/Discord.Net.Rest/Entities/Channels/RestChannel.cs
  5. +0
    -2
      src/Discord.Net.Rest/Entities/Channels/RestDMChannel.cs
  6. +0
    -2
      src/Discord.Net.WebSocket/Entities/Channels/SocketChannel.cs
  7. +0
    -2
      src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs

+ 0
- 8
src/Discord.Net.Core/Entities/Channels/IChannel.cs View File

@@ -8,14 +8,6 @@ namespace Discord
/// </summary>
public interface IChannel : ISnowflakeEntity
{
/// <summary>
/// Gets the name of this channel.
/// </summary>
/// <returns>
/// A string containing the name of this channel.
/// </returns>
string Name { get; }

/// <summary>
/// Gets a collection of all users in this channel.
/// </summary>


+ 8
- 0
src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs View File

@@ -12,6 +12,14 @@ namespace Discord
/// <seealso cref="ICategoryChannel"/>
public interface IGuildChannel : IChannel, IDeletable
{
/// <summary>
/// Gets the name of this channel.
/// </summary>
/// <returns>
/// A string containing the name of this channel.
/// </returns>
string Name { get; }

/// <summary>
/// Gets the position of this channel.
/// </summary>


+ 1
- 1
src/Discord.Net.Core/Utils/MentionUtils.cs View File

@@ -204,7 +204,7 @@ namespace Discord
{
if (mode != TagHandling.Remove)
{
var channel = tag.Value as IChannel;
var channel = tag.Value as IGuildChannel;
switch (mode)
{
case TagHandling.Name:


+ 0
- 2
src/Discord.Net.Rest/Entities/Channels/RestChannel.cs View File

@@ -54,8 +54,6 @@ namespace Discord.Rest
public virtual Task UpdateAsync(RequestOptions options = null) => Task.Delay(0);

//IChannel
/// <inheritdoc />
string IChannel.Name => null;

/// <inheritdoc />
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


+ 0
- 2
src/Discord.Net.Rest/Entities/Channels/RestDMChannel.cs View File

@@ -210,8 +210,6 @@ namespace Discord.Rest
=> await SendMessageAsync(text, isTTS, embed, options).ConfigureAwait(false);

//IChannel
/// <inheritdoc />
string IChannel.Name => $"@{Recipient}";

/// <inheritdoc />
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


+ 0
- 2
src/Discord.Net.WebSocket/Entities/Channels/SocketChannel.cs View File

@@ -58,8 +58,6 @@ namespace Discord.WebSocket
internal SocketChannel Clone() => MemberwiseClone() as SocketChannel;

//IChannel
/// <inheritdoc />
string IChannel.Name => null;

/// <inheritdoc />
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


+ 0
- 2
src/Discord.Net.WebSocket/Entities/Channels/SocketDMChannel.cs View File

@@ -300,8 +300,6 @@ namespace Discord.WebSocket
=> await SendMessageAsync(text, isTTS, embed, options).ConfigureAwait(false);

//IChannel
/// <inheritdoc />
string IChannel.Name => $"@{Recipient}";

/// <inheritdoc />
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


Loading…
Cancel
Save