You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

IPublicChannel.cs 2.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. namespace Discord
  4. {
  5. public struct PermissionOverwriteEntry
  6. {
  7. public PermissionTarget TargetType { get; }
  8. public ulong TargetId { get; }
  9. public OverwritePermissions Permissions { get; }
  10. }
  11. public interface IPublicChannel : IChannel
  12. {
  13. /// <summary> Gets the server this channel is a member of. </summary>
  14. Server Server { get; }
  15. /// <summary> Gets a collection of permission overwrites for this channel. </summary>
  16. IEnumerable<PermissionOverwriteEntry> PermissionOverwrites { get; }
  17. /// <summary> Gets the name of this public channel. </summary>
  18. string Name { get; }
  19. /// <summary> Gets the position of this public channel relative to others of the same type. </summary>
  20. int Position { get; }
  21. /// <summary> Gets the permission overwrite for a specific user, or null if one does not exist. </summary>
  22. OverwritePermissions? GetPermissionOverwrite(User user);
  23. /// <summary> Gets the permission overwrite for a specific role, or null if one does not exist. </summary>
  24. OverwritePermissions? GetPermissionOverwrite(Role role);
  25. /// <summary> Downloads a collection of all invites to this server. </summary>
  26. Task<IEnumerable<Invite>> GetInvites();
  27. /// <summary> Adds or updates the permission overwrite for the given user. </summary>
  28. Task UpdatePermissionOverwrite(User user, OverwritePermissions permissions);
  29. /// <summary> Adds or updates the permission overwrite for the given role. </summary>
  30. Task UpdatePermissionOverwrite(Role role, OverwritePermissions permissions);
  31. /// <summary> Removes the permission overwrite for the given user, if one exists. </summary>
  32. Task RemovePermissionOverwrite(User user);
  33. /// <summary> Removes the permission overwrite for the given role, if one exists. </summary>
  34. Task RemovePermissionOverwrite(Role role);
  35. /// <summary> Creates a new invite to this channel. </summary>
  36. /// <param name="maxAge"> Time (in seconds) until the invite expires. Set to null to never expire. </param>
  37. /// <param name="maxUses"> The max amount of times this invite may be used. Set to null to have unlimited uses. </param>
  38. /// <param name="tempMembership"> If true, a user accepting this invite will be kicked from the server after closing their client. </param>
  39. /// <param name="withXkcd"> If true, creates a human-readable link. Not supported if maxAge is set to null. </param>
  40. Task<Invite> CreateInvite(int? maxAge = 1800, int? maxUses = null, bool tempMembership = false, bool withXkcd = false);
  41. }
  42. }