Class GuildCreateSpec

    • Constructor Detail

      • GuildCreateSpec

        public GuildCreateSpec()
    • Method Detail

      • setName

        public GuildCreateSpec setName​(String name)
        Sets the name for the created Guild.
        Parameters:
        name - The name of the guild.
        Returns:
        This spec.
      • setRegion

        public GuildCreateSpec setRegion​(Region.Id regionId)
        Sets the voice region id for the created Guild.
        Parameters:
        regionId - The voice region id for the guild.
        Returns:
        This spec.
      • setRegion

        public GuildCreateSpec setRegion​(@Nullable
                                         String regionId)
        Sets the voice region id for the created Guild, automatic if null.
        Parameters:
        regionId - The voice region id for the guild, automatic if null.
        Returns:
        This spec.
      • setIcon

        public GuildCreateSpec setIcon​(@Nullable
                                       Image icon)
        Sets the image icon to display for the created Guild.
        Parameters:
        icon - The icon for the guild.
        Returns:
        This spec.
      • setVerificationLevel

        public GuildCreateSpec setVerificationLevel​(@Nullable
                                                    Guild.VerificationLevel verificationLevel)
        Sets the verification level required before a member can send messages in the created Guild.
        Parameters:
        verificationLevel - The verification level for the guild.
        Returns:
        This spec.
      • setDefaultMessageNotificationLevel

        public GuildCreateSpec setDefaultMessageNotificationLevel​(@Nullable
                                                                  Guild.NotificationLevel notificationLevel)
        Sets the default message notification level for the created Guild.
        Parameters:
        notificationLevel - The default notification level for the guild.
        Returns:
        This spec.
      • setExplicitContentFilter

        public GuildCreateSpec setExplicitContentFilter​(@Nullable
                                                        Guild.ContentFilterLevel explicitContentFilter)
        Sets the explicit content filter level for the created Guild.
        Parameters:
        explicitContentFilter - The explicit content filter level for the guild.
        Returns:
        This spec.
      • addRole

        public GuildCreateSpec addRole​(Consumer<? super RoleCreateSpec> roleSpec)
        Adds the role spec to the list of roles for the created Guild.
        Parameters:
        roleSpec - The role spec to add to the list of roles.
        Returns:
        This spec.
      • addEveryoneRole

        public GuildCreateSpec addEveryoneRole​(Consumer<? super RoleCreateSpec> roleSpec)
        Sets the default @everyone role for the created Guild. This shifts all other roles in the list, if present, down by one. It does not replace other @everyone roles already set.

        When creating a guild, Discord automatically takes the first role in the role array as the default @everyone role. See this limitation and others at GuildCreateSpec.

        Parameters:
        roleSpec - The default @everyone role spec to add to the list of roles.
        Returns:
        This spec.
      • addChannel

        public GuildCreateSpec addChannel​(String name,
                                          Channel.Type type)
        Adds the channel to the list of channels for the created Guild.
        Parameters:
        name - The name of the channel.
        type - The type of the channel.
        Returns:
        This spec.
      • setAfkChannelId

        public GuildCreateSpec setAfkChannelId​(@Nullable
                                               Snowflake id)
        Sets the ID of the AFK channel for the created Guild.
        Parameters:
        id - id for afk channel
        Returns:
        This spec.
      • setAfkTimeout

        public GuildCreateSpec setAfkTimeout​(@Nullable
                                             Integer afkTimeout)
        Sets the AFK timeout, in seconds, for the created Guild.
        Parameters:
        afkTimeout - The AFK timeout, in seconds.
        Returns:
        This spec.
      • setSystemChannelId

        public GuildCreateSpec setSystemChannelId​(@Nullable
                                                  Snowflake id)
        Sets the id of the channel where guild notices such as welcome messages and boost events are posted for the created Guild.
        Parameters:
        id - The id of the channel where guild notices such as welcome messages and boost events are posted.
        Returns:
        This spec.
      • asRequest

        public discord4j.discordjson.json.GuildCreateRequest asRequest()
        Specified by:
        asRequest in interface Spec<discord4j.discordjson.json.GuildCreateRequest>