Example #1
0
 /// <summary>
 /// Converts an existing <see cref="RestInviteMetadata"/> to an abstracted <see cref="IRestInviteMetadata"/> value.
 /// </summary>
 /// <param name="restInviteMetadata">The existing <see cref="RestInviteMetadata"/> to be abstracted.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restInviteMetadata"/>.</exception>
 /// <returns>An <see cref="IRestInviteMetadata"/> that abstracts <paramref name="restInviteMetadata"/>.</returns>
 public static IRestInviteMetadata Abstract(this RestInviteMetadata restInviteMetadata)
 => new RestInviteMetadataAbstraction(restInviteMetadata);
Example #2
0
 //Invites
 public static async Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(IGuildChannel channel, BaseDiscordClient client,
     RequestOptions options)
 {
     var models = await client.ApiClient.GetChannelInvitesAsync(channel.Id, options).ConfigureAwait(false);
     return models.Select(x => RestInviteMetadata.Create(client, null, channel, x)).ToImmutableArray();
 }
Example #3
0
 /// <summary>
 /// Constructs a new <see cref="RestInviteMetadataAbstraction"/> around an existing <see cref="Rest.RestInviteMetadata"/>.
 /// </summary>
 /// <param name="restInviteMetadata">The value to use for <see cref="Rest.RestInviteMetadata"/>.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restInviteMetadata"/>.</exception>
 public RestInviteMetadataAbstraction(RestInviteMetadata restInviteMetadata)
     : base(restInviteMetadata)
 {
 }