Class GuildEditSpec

  • All Implemented Interfaces:
    AuditSpec<discord4j.discordjson.json.GuildModifyRequest>, Spec<discord4j.discordjson.json.GuildModifyRequest>

    public class GuildEditSpec
    extends Object
    implements AuditSpec<discord4j.discordjson.json.GuildModifyRequest>
    A spec used to selectively modify properties from a Guild.
    See Also:
    Modify Guild
    • Constructor Detail

      • GuildEditSpec

        public GuildEditSpec()
    • Method Detail

      • setName

        public GuildEditSpec setName​(String name)
        Sets the modified Guild name.
        Parameters:
        name - the guild name
        Returns:
        this spec
      • setRegion

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

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

        public GuildEditSpec setVerificationLevel​(Guild.VerificationLevel verificationLevel)
        Sets the verification level required before a member can send messages in the modified Guild.
        Parameters:
        verificationLevel - The verification level for the guild.
        Returns:
        This spec.
      • setDefaultMessageNotificationsLevel

        public GuildEditSpec setDefaultMessageNotificationsLevel​(Guild.NotificationLevel notificationsLevel)
        Sets the default message notification level for the modified Guild.
        Parameters:
        notificationsLevel - The default notification level for the guild.
        Returns:
        This spec.
      • setExplicitContentFilter

        public GuildEditSpec setExplicitContentFilter​(Guild.ContentFilterLevel level)
        Sets the explicit content filter level for the modified Guild.
        Parameters:
        level - The explicit content filter level for the guild.
        Returns:
        This spec.
      • setAfkChannelId

        public GuildEditSpec setAfkChannelId​(@Nullable
                                             Snowflake afkChannelId)
        Sets the Snowflake identifier for the channel designated as AFK channel in this Guild.
        Parameters:
        afkChannelId - The identifier for the AFK channel.
        Returns:
        This spec.
      • setAfkTimeout

        public GuildEditSpec setAfkTimeout​(int afkTimeout)
        Sets the AFK timeout, in seconds, for this Guild.
        Parameters:
        afkTimeout - The AFK timeout, in seconds.
        Returns:
        This spec.
      • setIcon

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

        public GuildEditSpec setOwnerId​(Snowflake ownerId)
        Sets the new owner ID for this Guild. Used to transfer guild ownership if this client is the owner.
        Parameters:
        ownerId - The identifier for the new guild owner.
        Returns:
        This spec.
      • setSplash

        public GuildEditSpec setSplash​(@Nullable
                                       Image splash)
        Sets the image for the guild splash (when the server has the INVITE_SPLASH feature).
        Parameters:
        splash - The image for the guild splash.
        Returns:
        This spec.
      • setDiscoverySplash

        public GuildEditSpec setDiscoverySplash​(@Nullable
                                                Image discoverySplash)
        Sets the image for the guild discovery splash (when the server has the DISCOVERABLE feature).
        Parameters:
        discoverySplash - The image for the guild discovery splash.
        Returns:
        This spec.
      • setBanner

        public GuildEditSpec setBanner​(@Nullable
                                       Image banner)
        Sets the image for the guild banner (when the server has the BANNER feature).
        Parameters:
        banner - The image for the guild banner.
        Returns:
        This spec.
      • setSystemChannelId

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

        public GuildEditSpec setRulesChannelId​(@Nullable
                                               Snowflake rulesChannelId)
        Sets the id of the channel where Community guilds display rules and/or guidelines.
        Parameters:
        rulesChannelId - The id of the channel where Community guilds display rules and/or guidelines.
        Returns:
        This spec.
      • setPublicUpdatesChannelId

        public GuildEditSpec setPublicUpdatesChannelId​(@Nullable
                                                       Snowflake publicUpdatesChannelId)
        Sets the id of the channel where admins and moderators of Community guilds receive notices from Discord.
        Parameters:
        publicUpdatesChannelId - The id of the channel where admins and moderators of Community guilds receive notices from Discord.
        Returns:
        This spec.
      • setPreferredLocale

        public GuildEditSpec setPreferredLocale​(@Nullable
                                                Locale preferredLocale)
        Sets the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".
        Parameters:
        preferredLocale - The preferred locale of a Community guild used in server discovery and notices from Discord.
        Returns:
        This spec.
      • setFeatures

        public GuildEditSpec setFeatures​(Set<String> features)
        Sets the enabled guild features.
        You can see the available guild features
        Parameters:
        features - Enabled guild features.
        Returns:
        This spec.
      • setDescription

        public GuildEditSpec setDescription​(@Nullable
                                            String description)
        Sets the description for the guild, if the guild is discoverable.
        Parameters:
        description - The description for the guild.
        Returns:
        This spec.
      • setReason

        public GuildEditSpec setReason​(@Nullable
                                       String reason)
        Description copied from interface: AuditSpec
        Sets the reason to show in the audit logs when the spec is built.
        Specified by:
        setReason in interface AuditSpec<discord4j.discordjson.json.GuildModifyRequest>
        Parameters:
        reason - The audit log reason.
        Returns:
        This spec.
      • getReason

        @Nullable
        public String getReason()
        Description copied from interface: AuditSpec
        Returns the current audit log reason set on the spec.
        Specified by:
        getReason in interface AuditSpec<discord4j.discordjson.json.GuildModifyRequest>
        Returns:
        The current audit log reason.
      • asRequest

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