Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVoiceChannel implements IMentionable #1896

Merged
merged 1 commit into from
Aug 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Discord.Net.Core/Entities/Channels/IVoiceChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Discord
/// <summary>
/// Represents a generic voice channel in a guild.
/// </summary>
public interface IVoiceChannel : INestedChannel, IAudioChannel
public interface IVoiceChannel : INestedChannel, IAudioChannel, IMentionable
{
/// <summary>
/// Gets the bit-rate that the clients in this voice channel are requested to use.
Expand Down
5 changes: 4 additions & 1 deletion src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class RestVoiceChannel : RestGuildChannel, IVoiceChannel, IRestAudioChann
/// <inheritdoc />
public ulong? CategoryId { get; private set; }

/// <inheritdoc />
public string Mention => MentionUtils.MentionChannel(Id);

internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id)
: base(discord, guild, id)
{
Expand Down Expand Up @@ -60,7 +63,7 @@ public Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null)
/// <inheritdoc />
public Task SyncPermissionsAsync(RequestOptions options = null)
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);

//Invites
/// <inheritdoc />
public async Task<IInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class SocketVoiceChannel : SocketGuildChannel, IVoiceChannel, ISocketAudi
public int Bitrate { get; private set; }
/// <inheritdoc />
public int? UserLimit { get; private set; }

/// <inheritdoc />
public ulong? CategoryId { get; private set; }
/// <summary>
Expand All @@ -30,6 +31,10 @@ public class SocketVoiceChannel : SocketGuildChannel, IVoiceChannel, ISocketAudi
/// </returns>
public ICategoryChannel Category
=> CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null;

/// <inheritdoc />
public string Mention => MentionUtils.MentionChannel(Id);

/// <inheritdoc />
public Task SyncPermissionsAsync(RequestOptions options = null)
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ internal sealed class MockedVoiceChannel : IVoiceChannel

public int? UserLimit => throw new NotImplementedException();

public string Mention => throw new NotImplementedException();

public ulong? CategoryId => throw new NotImplementedException();

public int Position => throw new NotImplementedException();
Expand Down