Browse Source

Add XMLDocs for some channel entities

pull/988/head
Hsu Still 7 years ago
parent
commit
897676c5b0
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
3 changed files with 13 additions and 3 deletions
  1. +2
    -1
      src/Discord.Net.Core/Entities/Channels/IChannel.cs
  2. +3
    -2
      src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
  3. +8
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs

+ 2
- 1
src/Discord.Net.Core/Entities/Channels/IChannel.cs View File

@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents a generic Discord channel. </summary>
public interface IChannel : ISnowflakeEntity
{
/// <summary> Gets the name of this channel. </summary>


+ 3
- 2
src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs View File

@@ -1,9 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents a guild channel. This includes a text channel, voice channel, and category channel. </summary>
public interface IGuildChannel : IChannel, IDeletable
{
/// <summary> Gets the position of this channel in the guild's channel list, relative to others of the same type. </summary>
@@ -49,4 +50,4 @@ namespace Discord
/// <summary> Gets a user in this channel with the provided id.</summary>
new Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
}
}
}

+ 8
- 0
src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs View File

@@ -15,13 +15,18 @@ namespace Discord.WebSocket
{
private readonly MessageCache _messages;

/// <inheritdoc />
public string Topic { get; private set; }

private bool _nsfw;
/// <inheritdoc />
public bool IsNsfw => _nsfw || ChannelHelper.IsNsfw(this);

/// <inheritdoc />
public string Mention => MentionUtils.MentionChannel(Id);
/// <inheritdoc />
public IReadOnlyCollection<SocketMessage> CachedMessages => _messages?.Messages ?? ImmutableArray.Create<SocketMessage>();
/// <inheritdoc />
public override IReadOnlyCollection<SocketGuildUser> Users
=> Guild.Users.Where(x => Permissions.GetValue(
Permissions.ResolveChannel(Guild, x, this, Permissions.ResolveGuild(Guild, x)),
@@ -47,10 +52,12 @@ namespace Discord.WebSocket
_nsfw = model.Nsfw.GetValueOrDefault();
}

/// <inheritdoc />
public Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
=> ChannelHelper.ModifyAsync(this, Discord, func, options);

//Messages
/// <inheritdoc />
public SocketMessage GetCachedMessage(ulong id)
=> _messages?.Get(id);
public async Task<IMessage> GetMessageAsync(ulong id, RequestOptions options = null)
@@ -100,6 +107,7 @@ namespace Discord.WebSocket
=> _messages?.Remove(id);

//Users
/// <inheritdoc />
public override SocketGuildUser GetUser(ulong id)
{
var user = Guild.GetUser(id);


Loading…
Cancel
Save