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.7 kB

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