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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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<PermissionOverwrite> PermissionOverwrites { get; }
  11. /// <summary> Gets the name of this public channel. </summary>
  12. string Name { get; }
  13. /// <summary> Gets the position of this public channel relative to others of the same type. </summary>
  14. int Position { get; }
  15. /// <summary> Gets the permission overwrite for a specific user, or null if one does not exist. </summary>
  16. Task<PermissionOverwrite?> GetPermissionOverwrite(User user);
  17. /// <summary> Gets the permission overwrite for a specific role, or null if one does not exist. </summary>
  18. Task<PermissionOverwrite?> GetPermissionOverwrite(Role role);
  19. /// <summary> Downloads a collection of all invites to this server. </summary>
  20. Task<IEnumerable<Invite>> GetInvites();
  21. /// <summary> Adds or updates the permission overwrite for the given user. </summary>
  22. Task UpdatePermissionOverwrite(User user, ChannelPermissions allow, ChannelPermissions deny);
  23. /// <summary> Adds or updates the permission overwrite for the given user. </summary>
  24. Task UpdatePermissionOverwrite(User user, TriStateChannelPermissions permissions);
  25. /// <summary> Adds or updates the permission overwrite for the given role. </summary>
  26. Task UpdatePermissionOverwrite(Role role, ChannelPermissions allow, ChannelPermissions deny);
  27. /// <summary> Adds or updates the permission overwrite for the given role. </summary>
  28. Task UpdatePermissionOverwrite(Role role, TriStateChannelPermissions permissions);
  29. /// <summary> Removes the permission overwrite for the given user, if one exists. </summary>
  30. Task RemovePermissionOverwrite(User user);
  31. /// <summary> Removes the permission overwrite for the given role, if one exists. </summary>
  32. Task RemovePermissionOverwrite(Role role);
  33. /// <summary> Creates a new invite to this channel. </summary>
  34. /// <param name="maxAge"> Time (in seconds) until the invite expires. Set to null to never expire. </param>
  35. /// <param name="maxUses"> The max amount of times this invite may be used. Set to null to have unlimited uses. </param>
  36. /// <param name="tempMembership"> If true, a user accepting this invite will be kicked from the server after closing their client. </param>
  37. /// <param name="withXkcd"> If true, creates a human-readable link. Not supported if maxAge is set to null. </param>
  38. Task<Invite> CreateInvite(int? maxAge = 1800, int? maxUses = null, bool tempMembership = false, bool withXkcd = false);
  39. }
  40. }