Package discord4j.rest.entity
Class RestGuild
java.lang.Object
discord4j.rest.entity.RestGuild
Represents a guild entity in Discord. Guilds in Discord represent an isolated collection of users and channels,
and are often referred to as "servers" in the UI.
-
Method Summary
Modifier and TypeMethodDescriptionMono<discord4j.discordjson.json.MemberData>addMemberRole(Snowflake userId, Snowflake roleId, String reason) Mono<discord4j.discordjson.json.PruneData>beginGuildPrune(Integer days, Boolean computePruneCount, String reason) Mono<discord4j.discordjson.json.BulkBanResponseData>bulkGuildBan(discord4j.discordjson.json.BulkBanRequest request, String reason) static RestGuildcreate(RestClient restClient, Snowflake id) Create aRestGuildfor a given ID.Mono<discord4j.discordjson.json.ChannelData>createChannel(discord4j.discordjson.json.ChannelCreateRequest request, String reason) Create a new channel object for the guild.Mono<discord4j.discordjson.json.EmojiData>createEmoji(discord4j.discordjson.json.GuildEmojiCreateRequest request, String reason) createIntegration(discord4j.discordjson.json.IntegrationCreateRequest request) Mono<discord4j.discordjson.json.RoleData>createRole(discord4j.discordjson.json.RoleCreateRequest request, String reason) Mono<discord4j.discordjson.json.GuildScheduledEventData>createScheduledEvent(discord4j.discordjson.json.GuildScheduledEventCreateRequest request) Create a new scheduled event for the guild.delete()Delete a guild permanently.deleteIntegration(Snowflake integrationId) deleteRole(Snowflake roleId, String reason) deleteScheduledEvent(Snowflake eventId, String reason) Requests to delete a scheduled event.Return aRestEmojirepresentation under this guild.booleanMono<discord4j.discordjson.json.ListThreadsData>Mono<discord4j.discordjson.json.BanData>Flux<discord4j.discordjson.json.BanData>getBans()Flux<discord4j.discordjson.json.ChannelData>Return aFluxof guild channels.Mono<discord4j.discordjson.json.GuildUpdateData>getData()Retrieve this guild's data upon subscription.Mono<discord4j.discordjson.json.GuildUpdateData>Retrieve this guild's data upon subscription.Flux<discord4j.discordjson.json.EmojiData>getId()Returns the ID of this guild.Flux<discord4j.discordjson.json.IntegrationData>Flux<discord4j.discordjson.json.InviteData>Mono<discord4j.discordjson.json.MemberData>Flux<discord4j.discordjson.json.MemberData>Mono<discord4j.discordjson.json.OnboardingData>Request to retrieve the onboarding of the guild.Mono<discord4j.discordjson.json.GuildPreviewData>Mono<discord4j.discordjson.json.PruneData>getPruneCount(Integer days) Flux<discord4j.discordjson.json.RegionData>Flux<discord4j.discordjson.json.RoleData>getRoles()Mono<discord4j.discordjson.json.GuildScheduledEventData>getScheduledEvent(Snowflake eventId, Boolean withUserCount) Requests to retrieve the scheduled event under this guild.Flux<discord4j.discordjson.json.GuildScheduledEventData>getScheduledEvents(Boolean withUserCount) Requests to retrieve the scheduled events under this guild.Mono<discord4j.discordjson.json.MemberData>Flux<discord4j.discordjson.json.TemplateData>Flux<discord4j.discordjson.json.WebhookData>Mono<discord4j.discordjson.json.GuildWidgetData>inthashCode()Return aRestMemberrepresentation under this guild.Mono<discord4j.discordjson.json.GuildUpdateData>Modify a guild's settings.modifyChannelPositions(List<discord4j.discordjson.json.ChannelPositionModifyRequest> requests) Mono<discord4j.discordjson.json.MemberData>modifyCurrentMember(discord4j.discordjson.json.CurrentMemberModifyData request) Mono<discord4j.discordjson.json.MemberData>modifyCurrentMember(discord4j.discordjson.json.CurrentMemberModifyData request, String reason) modifyIntegration(Snowflake integrationId, discord4j.discordjson.json.IntegrationModifyRequest request) Mono<discord4j.discordjson.json.MemberData>modifyMember(Snowflake userId, discord4j.discordjson.json.GuildMemberModifyRequest request, String reason) Mono<discord4j.discordjson.json.OnboardingData>modifyOnboarding(discord4j.discordjson.json.OnboardingEditData request, String reason) Request to modify the onboarding of the guild.Mono<discord4j.discordjson.json.RoleData>modifyRole(Snowflake roleId, discord4j.discordjson.json.RoleModifyRequest request, String reason) Flux<discord4j.discordjson.json.RoleData>modifyRolePositions(List<discord4j.discordjson.json.RolePositionModifyRequest> requests) Flux<discord4j.discordjson.json.RoleData>modifyRolePositions(List<discord4j.discordjson.json.RolePositionModifyRequest> requests, String reason) Mono<discord4j.discordjson.json.GuildScheduledEventData>modifyScheduledEvent(Snowflake eventId, discord4j.discordjson.json.GuildScheduledEventModifyRequest request, String reason) Requests to modify a scheduled event.Mono<discord4j.discordjson.json.GuildWidgetData>modifyWidget(discord4j.discordjson.json.GuildWidgetModifyRequest request) removeGuildBan(Snowflake userId, String reason) removeGuildMember(Snowflake userId, String reason) removeMemberRole(Snowflake userId, Snowflake roleId, String reason) Return aRestRolerepresentation under this guild.scheduledEvent(Snowflake eventId) Returns aRestScheduledEventrepresentation under this guild.Flux<discord4j.discordjson.json.MemberData>searchMembers(Map<String, Object> queryParams) syncIntegration(Snowflake integrationId)
-
Method Details
-
create
Create aRestGuildfor a given ID. This method does not perform any API request.- Parameters:
restClient- the client to make API requestsid- the ID of this entity- Returns:
- a
RestGuildrepresented by thisid.
-
getId
Returns the ID of this guild.- Returns:
- The ID of this guild
-
getData
Retrieve this guild's data upon subscription.- Parameters:
withCounts- when true, will return approximate member and presence counts for the guild too. otherwise approximate member and presence counts will be null inGuildUpdateData.- Returns:
- a
Monowhere, upon successful completion, emits theGuildUpdateDatabelonging to this entity. If an error is received, it is emitted through theMono.
-
getData
Retrieve this guild's data upon subscription.- Returns:
- a
Monowhere, upon successful completion, emits theGuildUpdateDatabelonging to this entity. If an error is received, it is emitted through theMono.
-
emoji
Return aRestEmojirepresentation under this guild. This method does not perform any API request.- Parameters:
emojiId- the entity ID- Returns:
- a
RestEmojiwith the given ID, under this guild
-
member
Return aRestMemberrepresentation under this guild. This method does not perform any API request.- Parameters:
memberId- the entity ID- Returns:
- a
RestMemberwith the given ID, under this guild
-
role
Return aRestRolerepresentation under this guild. This method does not perform any API request.- Parameters:
roleId- the entity ID- Returns:
- a
RestRolewith the given ID, under this guild
-
scheduledEvent
Returns aRestScheduledEventrepresentation under this guild. This method does not perform any API request.- Parameters:
eventId- The entity ID- Returns:
- a
RestGuildScheduledEventwith the given ID, under this guild
-
modify
public Mono<discord4j.discordjson.json.GuildUpdateData> modify(discord4j.discordjson.json.GuildModifyRequest request, @Nullable String reason) Modify a guild's settings. Requires thePermission.MANAGE_GUILDpermission. Returns the updated guild object on success.- Parameters:
request- the modify request bodyreason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits the updatedGuildUpdateDataon success. If an error is received, it is emitted through theMono.
-
delete
Delete a guild permanently. Requires thePermission.MANAGE_GUILDpermission. Returns empty on success.- Returns:
- a
Monowhere, upon subscription, emits a complete signal on success. If an error is received, it is emitted through theMono.
-
getChannels
Return aFluxof guild channels.- Returns:
- a sequence of this guild channels
-
createChannel
public Mono<discord4j.discordjson.json.ChannelData> createChannel(discord4j.discordjson.json.ChannelCreateRequest request, @Nullable String reason) Create a new channel object for the guild. Requires thePermission.MANAGE_CHANNELSpermission. Returns the new channel object on success.- Parameters:
request- the request bodyreason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits the createdChannelDataon success. If an error is received, it is emitted through theMono.
-
modifyChannelPositions
-
getMember
-
getSelfMember
-
getMembers
-
searchMembers
-
addMember
-
modifyMember
-
modifyCurrentMember
-
modifyCurrentMember
public Mono<discord4j.discordjson.json.MemberData> modifyCurrentMember(discord4j.discordjson.json.CurrentMemberModifyData request) -
addMemberRole
-
removeMemberRole
-
removeGuildMember
-
getBans
-
getBan
-
createBan
-
removeGuildBan
-
bulkGuildBan
-
getRoles
-
createRole
-
modifyRolePositions
-
modifyRolePositions
-
modifyRole
-
deleteRole
-
getPruneCount
-
beginGuildPrune
-
getRegions
-
getInvites
-
getIntegrations
-
createIntegration
-
modifyIntegration
-
deleteIntegration
-
syncIntegration
-
getWidget
-
modifyWidget
public Mono<discord4j.discordjson.json.GuildWidgetData> modifyWidget(discord4j.discordjson.json.GuildWidgetModifyRequest request) -
getEmojis
-
createEmoji
-
getWebhooks
-
getPreview
-
getTemplates
-
getActiveThreads
-
getScheduledEvent
public Mono<discord4j.discordjson.json.GuildScheduledEventData> getScheduledEvent(Snowflake eventId, @Nullable Boolean withUserCount) Requests to retrieve the scheduled event under this guild.- Parameters:
eventId- The ID of the eventwithUserCount- Whether to optionally include the number of subscribed users- Returns:
- A
Monowhere, upon successful completion, emits theGuildScheduledEventData. If an error is received, it is emitted through theMono.
-
getScheduledEvents
public Flux<discord4j.discordjson.json.GuildScheduledEventData> getScheduledEvents(@Nullable Boolean withUserCount) Requests to retrieve the scheduled events under this guild.- Parameters:
withUserCount- Whether to optionally include the number of subscribed users for each event- Returns:
- A
Fluxthat continually emits all theGuildScheduledEventDataassociated with this guild. If an error is received, it is emitted through theFlux.
-
createScheduledEvent
public Mono<discord4j.discordjson.json.GuildScheduledEventData> createScheduledEvent(discord4j.discordjson.json.GuildScheduledEventCreateRequest request) Create a new scheduled event for the guild. Requires thePermission.MANAGE_EVENTSpermission. Returns the new event object on success.- Parameters:
request- the request body- Returns:
- A
Monowhere, upon subscription, emits the createdGuildScheduledEventDataon success. If an error is received, it is emitted through theMono.
-
modifyScheduledEvent
public Mono<discord4j.discordjson.json.GuildScheduledEventData> modifyScheduledEvent(Snowflake eventId, discord4j.discordjson.json.GuildScheduledEventModifyRequest request, @Nullable String reason) Requests to modify a scheduled event. Requires thePermission.MANAGE_EVENTSpermission. Returns the modified event object on success.- Parameters:
eventId- The ID of the eventrequest- the request bodyreason- an optional reason for the audit log- Returns:
- A
Monowhere, upon subscription, emits the modifiedGuildScheduledEventDataon success. If an error is received, it is emitted through theMono.
-
deleteScheduledEvent
Requests to delete a scheduled event. Requires thePermission.MANAGE_EVENTSpermission.- Parameters:
eventId- The ID of the eventreason- an optional reason for the audit log- Returns:
- A
Monowhere, upon successful completion, emits nothing; indicating the event has been deleted. If an error is received, it is emitted through theMono.
-
getOnboarding
Request to retrieve the onboarding of the guild.- Returns:
- A
Monowhere, upon successful completion, emits theOnboardingData. If an error is received, it is emitted through theMono.
-
modifyOnboarding
public Mono<discord4j.discordjson.json.OnboardingData> modifyOnboarding(discord4j.discordjson.json.OnboardingEditData request, @Nullable String reason) Request to modify the onboarding of the guild. Requires thePermission.MANAGE_GUILDandPermission.MANAGE_ROLESpermissions.- Parameters:
request- the request bodyreason- an optional reason for the audit log- Returns:
- A
Monowhere, upon successful completion, emits the modifiedOnboardingData. If an error is received, it is emitted through theMono.
-
equals
-
hashCode
public int hashCode()
-