/// <inheritdoc /> public virtual async Task <IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null) { var args = new CreateGuildParams(); var model = await ApiClient.CreateGuildAsync(args).ConfigureAwait(false); return(new Guild(this, model)); }
public static async Task <RestGuild> CreateGuildAsync(BaseDiscordClient client, string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options) { var args = new CreateGuildParams(name, region.Id); var model = await client.ApiClient.CreateGuildAsync(args, options).ConfigureAwait(false); return(RestGuild.Create(client, model)); }
public static async Task <RestGuild> CreateGuildAsync(BaseDiscordClient client, string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options) { CreateGuildParams args = new CreateGuildParams(name, region.Id); if (jpegIcon != null) { args.Icon = new API.Image(jpegIcon); } API.GuildJson model = await client.ApiClient.CreateGuildAsync(args, options).ConfigureAwait(false); return(RestGuild.Create(client, model)); }
/// <inheritdoc /> async Task <IGuild> IDiscordClient.CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options) => await CreateGuildAsync(name, region, jpegIcon, options).ConfigureAwait(false);
public Task <RestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null) => ClientHelper.CreateGuildAsync(this, name, region, jpegIcon, options);
Task <IGuild> IDiscordClient.CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon) { throw new NotSupportedException(); }
/// <inheritdoc /> public async Task <IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null) => (await(BaseDiscordClient as IDiscordClient).CreateGuildAsync(name, region, jpegIcon, options)) .Abstract();
/// <summary> /// Converts an existing <see cref="IVoiceRegion"/> to an abstracted <see cref="IVoiceRegion"/> value. /// </summary> /// <param name="voiceRegion">The existing <see cref="IVoiceRegion"/> to be abstracted.</param> /// <exception cref="ArgumentNullException">Throws for <paramref name="voiceRegion"/>.</exception> /// <returns>An <see cref="IVoiceRegion"/> that abstracts <paramref name="voiceRegion"/>.</returns> public static IVoiceRegion Abstract(this IVoiceRegion voiceRegion) => voiceRegion switch { null => throw new ArgumentNullException(nameof(voiceRegion)),
public static string GetString(this IVoiceRegion region) => $"'{region.Name}' ({region.Id})";
public Task <IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null) { throw new System.NotImplementedException(); }
/// <inheritdoc /> new public async Task <IRestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options) => RestGuildAbstractionExtensions.Abstract( await BaseSocketClient.CreateGuildAsync(name, region, jpegIcon, options));
/// <inheritdoc /> new public async Task <IRestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options) => (await DiscordRestClient.CreateGuildAsync(name, region, jpegIcon, options)) .Abstract();
public Task <IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null) { throw new InvalidOperationException(); }
public virtual Task <IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream?jpegIcon = null, RequestOptions?options = null) { return(((IDiscordClient)_baseDiscordClient).CreateGuildAsync(name, region, jpegIcon, options)); }