Skip to content

Implement Video Quality Mode

Created by: DWaffles

Summary

Implements voice quality modes for voice channels, as listed in #825.

Details

Added an enum, ChannelQualityMode, to store the quality modes a channel can have and added that to DiscordChannel. Tried to remain locally consistent with the rest of library with the names and XML comments where possible.

I modified functions that edit or create channels to account for the new property where applicable. I might have missed some, please let me know if I did.

Changes proposed

  • Added new enum, ChannelQualityMode
  • Added enum as parameter to DiscordChannel
  • Updated ChannelEditModel
  • Updated CloneAsync() and ModifyAsync() in DiscordChannel.cs
  • Updated CreateGuildChannelAsync() and both ModifyChannelAsync() methods in DiscordRestClient.cs
  • Updated CreateVoiceChannelAsync() and CreateChannelAsync() in DiscordGuild.cs
  • Updated CreateGuildChannelAsync() and ModifyChannelAsync() in DiscordApiClient.cs
  • Updated OnChannelUpdateEventAsync() in DiscordClient.Dispatch.cs
  • Updated RestChannelCreatePayload and RestChannelModifyPayload classes in RestChannelPayloads.cs

Notes

  • It seems Discord returns a value of 0 for video_quality_mode until a voice channel's quality mode setting is touched (not even changed). This is the same value it returns for text channels.
  • I have not touched anything relating to audit log or audit log objects (like DiscordAuditLogChannelEntry ) as I do not quite understand how they work. If anyone could give me pointers or advice on this it would be appreciated.
  • I've done testing to check that the create and modify methods work as intended, I would appreciate if someone else also tested them on their machine.

Merge request reports

Loading