Ejemplo n.º 1
0
 /// <summary>
 /// Creates a guild
 /// </summary>
 /// <param name="properties">Options for creating the guild</param>
 /// <returns>The created <see cref="DiscordGuild"/></returns>
 public static DiscordGuild CreateGuild(this DiscordClient client, string name, DiscordImage icon = null, string region = null)
 {
     return(client.CreateGuildAsync(name, icon, region).GetAwaiter().GetResult());
 }
Ejemplo n.º 2
0
 public static async Task <DiscordGuild> CreateGuildAsync(this DiscordClient client, string name, DiscordImage icon = null, string region = null)
 {
     return((await client.HttpClient.PostAsync("/guilds", new GuildCreationProperties()
     {
         Name = name,
         Icon = icon,
         Region = region
     })).Deserialize <DiscordGuild>().SetClient(client));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a guild
        /// </summary>
        /// <param name="properties">Options for creating the guild</param>
        /// <returns>The created <see cref="DiscordGuild"/></returns>
        public static DiscordGuild CreateGuild(this DiscordClient client, string name, DiscordImage icon = null, string region = null)
        {
            GuildCreationProperties properties = new GuildCreationProperties()
            {
                Name = name, Icon = icon, Region = region
            };

            return(client.HttpClient.Post("/guilds", properties).Deserialize <DiscordGuild>().SetClient(client));
        }
Ejemplo n.º 4
0
 public static async Task <IReadOnlyList <DiscordGuild> > CreateTemplatedGuildAsync(this DiscordClient client, string templateCode, string name, DiscordImage icon = null)
 {
     return((await client.HttpClient.PostAsync("/guilds/templates/" + templateCode, new GuildCreationProperties()
     {
         Name = name,
         Icon = icon
     })).Deserialize <IReadOnlyList <DiscordGuild> >().SetClientsInList(client));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a guild from a template
 /// </summary>
 public static IReadOnlyList <DiscordGuild> CreateTemplatedGuild(this DiscordClient client, string templateCode, string name, DiscordImage icon = null)
 {
     return(client.CreateTemplatedGuildAsync(templateCode, name, icon).GetAwaiter().GetResult());
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a guild from a template
        /// </summary>
        public static IReadOnlyList <DiscordGuild> CreateTemplatedGuild(this DiscordClient client, string templateCode, string name, DiscordImage icon = null)
        {
            GuildCreationProperties properties = new GuildCreationProperties()
            {
                Name = name,
                Icon = icon
            };

            return(client.HttpClient.Post("/guilds/templates/" + templateCode, properties).Deserialize <IReadOnlyList <DiscordGuild> >().SetClientsInList(client));
        }