Modifier | Constructor and Description |
---|---|
protected |
RestClient(Router router)
Create a new
RestClient using the given Router as connector to perform requests. |
Modifier and Type | Method and Description |
---|---|
static RestClient |
create(String token)
Create a
RestClient with default options, using the given token for authentication. |
Mono<discord4j.discordjson.json.GuildUpdateData> |
createGuild(discord4j.discordjson.json.GuildCreateRequest request)
Requests to create a guild.
|
Mono<discord4j.discordjson.json.UserData> |
edit(discord4j.discordjson.json.UserModifyRequest request)
Requests to edit this client (i.e., modify the current bot user).
|
Mono<discord4j.discordjson.json.ApplicationInfoData> |
getApplicationInfo()
Requests to retrieve the application info.
|
ApplicationService |
getApplicationService()
Access a low-level representation of the API endpoints for the Application resource.
|
AuditLogService |
getAuditLogService()
Access a low-level representation of the API endpoints for the Audit Log resource.
|
RestChannel |
getChannelById(Snowflake channelId)
Requests to retrieve the channel represented by the supplied ID.
|
ChannelService |
getChannelService()
Access a low-level representation of the API endpoints for the Channel resource.
|
EmojiService |
getEmojiService()
Access a low-level representation of the API endpoints for the Guild Emoji resource.
|
GatewayService |
getGatewayService()
Access a low-level representation of the API endpoints for the Gateway resource.
|
RestGuild |
getGuildById(Snowflake guildId)
Requests to retrieve the guild represented by the supplied ID.
|
RestEmoji |
getGuildEmojiById(Snowflake guildId,
Snowflake emojiId)
Requests to retrieve the guild emoji represented by the supplied IDs.
|
Flux<discord4j.discordjson.json.UserGuildData> |
getGuilds()
Requests to retrieve the guilds the current client is in.
|
GuildService |
getGuildService()
Access a low-level representation of the API endpoints for the Guild resource.
|
Mono<discord4j.discordjson.json.InviteData> |
getInvite(String inviteCode)
Requests to retrieve an invite.
|
InviteService |
getInviteService()
Access a low-level representation of the API endpoints for the Invite resource.
|
RestMember |
getMemberById(Snowflake guildId,
Snowflake userId)
Requests to retrieve the member represented by the supplied IDs.
|
RestMessage |
getMessageById(Snowflake channelId,
Snowflake messageId)
Requests to retrieve the message represented by the supplied IDs.
|
Flux<discord4j.discordjson.json.RegionData> |
getRegions()
Requests to retrieve the voice regions that are available.
|
RestRole |
getRoleById(Snowflake guildId,
Snowflake roleId)
Requests to retrieve the role represented by the supplied IDs.
|
Mono<discord4j.discordjson.json.UserData> |
getSelf()
Requests to retrieve the bot user.
|
RestUser |
getUserById(Snowflake userId)
Requests to retrieve the user represented by the supplied ID.
|
UserService |
getUserService()
Access a low-level representation of the API endpoints for the User resource.
|
VoiceService |
getVoiceService()
Access a low-level representation of the API endpoints for the Voice Region resource.
|
RestWebhook |
getWebhookById(Snowflake webhookId)
Requests to retrieve the webhook represented by the supplied ID.
|
WebhookService |
getWebhookService()
Access a low-level representation of the API endpoints for the Webhook resource.
|
static RestClientBuilder<RestClient,RouterOptions> |
restBuilder(String token)
Obtain a
RestClientBuilder able to create RestClient instances, using the given token for
authentication. |
RestChannel |
restChannel(discord4j.discordjson.json.ChannelData data)
Requests to retrieve the channel represented by the supplied
ChannelData . |
RestGuild |
restGuild(discord4j.discordjson.json.GuildData data)
Requests to retrieve the guild represented by the supplied
GuildData . |
RestEmoji |
restGuildEmoji(Snowflake guildId,
discord4j.discordjson.json.EmojiData data)
Requests to retrieve the guild emoji represented by the supplied ID and
EmojiData . |
RestMember |
restMember(Snowflake guildId,
discord4j.discordjson.json.MemberData data)
Requests to retrieve the member represented by the supplied ID and
MemberData |
RestMessage |
restMessage(discord4j.discordjson.json.MessageData data)
Requests to retrieve the message represented by the supplied
MessageData . |
RestRole |
restRole(Snowflake guildId,
discord4j.discordjson.json.RoleData data)
Requests to retrieve the role represented by the supplied ID and
RoleData . |
RestUser |
restUser(discord4j.discordjson.json.UserData data)
Requests to retrieve the user represented by the supplied
UserData . |
RestWebhook |
restWebhook(discord4j.discordjson.json.WebhookData data)
Requests to retrieve the webhook represented by the supplied
WebhookData . |
protected RestClient(Router router)
RestClient
using the given Router
as connector to perform requests.router
- a connector to perform requestspublic static RestClient create(String token)
RestClient
with default options, using the given token for authentication.token
- the bot token used for authenticationRestClient
configured with the default optionspublic static RestClientBuilder<RestClient,RouterOptions> restBuilder(String token)
RestClientBuilder
able to create RestClient
instances, using the given token for
authentication.token
- the bot token used for authenticationRestClientBuilder
public RestChannel getChannelById(Snowflake channelId)
channelId
- The ID of the channel.RestChannel
as represented by the supplied ID.public RestChannel restChannel(discord4j.discordjson.json.ChannelData data)
ChannelData
.data
- The data of the channel.RestChannel
as represented by the supplied data.public RestGuild getGuildById(Snowflake guildId)
guildId
- The ID of the guild.RestGuild
as represented by the supplied ID.public RestGuild restGuild(discord4j.discordjson.json.GuildData data)
GuildData
.data
- The data of the guild.RestGuild
as represented by the supplied data.public RestEmoji getGuildEmojiById(Snowflake guildId, Snowflake emojiId)
guildId
- The ID of the guild.emojiId
- The ID of the emoji.RestEmoji
as represented by the supplied IDs.public RestEmoji restGuildEmoji(Snowflake guildId, discord4j.discordjson.json.EmojiData data)
EmojiData
.guildId
- The ID of the guild.data
- The data of the emoji.RestEmoji
as represented by the supplied parameters.public RestMember getMemberById(Snowflake guildId, Snowflake userId)
guildId
- The ID of the guild.userId
- The ID of the user.RestMember
as represented by the supplied IDs.public RestMember restMember(Snowflake guildId, discord4j.discordjson.json.MemberData data)
MemberData
guildId
- The ID of the guild.data
- The data of the user.RestMember
as represented by the supplied parameters.public RestMessage getMessageById(Snowflake channelId, Snowflake messageId)
channelId
- The ID of the channel.messageId
- The ID of the message.RestMessage
as represented by the supplied IDs.public RestMessage restMessage(discord4j.discordjson.json.MessageData data)
MessageData
.data
- The data of the channel.RestMessage
as represented by the supplied data.public RestRole getRoleById(Snowflake guildId, Snowflake roleId)
guildId
- The ID of the guild.roleId
- The ID of the role.RestRole
as represented by the supplied IDs.public RestRole restRole(Snowflake guildId, discord4j.discordjson.json.RoleData data)
RoleData
.guildId
- The ID of the guild.data
- The data of the role.RestRole
as represented by the supplied parameters.public RestUser getUserById(Snowflake userId)
userId
- The ID of the user.RestUser
as represented by the supplied ID.public RestUser restUser(discord4j.discordjson.json.UserData data)
UserData
.data
- The data of the user.RestUser
as represented by the supplied data.public RestWebhook getWebhookById(Snowflake webhookId)
webhookId
- The ID of the webhook.RestWebhook
as represented by the supplied ID.public RestWebhook restWebhook(discord4j.discordjson.json.WebhookData data)
WebhookData
.data
- The data of the webhook.RestWebhook
as represented by the supplied ID.public Mono<discord4j.discordjson.json.ApplicationInfoData> getApplicationInfo()
Mono
where, upon successful completion, emits the ApplicationInfoData
. If
an error is received, it is emitted through the Mono
.public Flux<discord4j.discordjson.json.UserGuildData> getGuilds()
Flux
that continually emits the guilds
that the current client is
in. If an error is received, it is emitted through the Flux
.public Flux<discord4j.discordjson.json.RegionData> getRegions()
Flux
that continually emits the regions
that are available. If an error is
received, it is emitted through the Flux
.public Mono<discord4j.discordjson.json.UserData> getSelf()
Mono
where, upon successful completion, emits the bot user
. If an error is
received, it is emitted through the Mono
.public Mono<discord4j.discordjson.json.GuildUpdateData> createGuild(discord4j.discordjson.json.GuildCreateRequest request)
request
- A GuildCreateRequest
as request body.Mono
where, upon successful completion, emits the created GuildUpdateData
. If an
error is received, it is emitted through the Mono
.public Mono<discord4j.discordjson.json.InviteData> getInvite(String inviteCode)
inviteCode
- The code for the invite (e.g. "xdYkpp").Mono
where, upon successful completion, emits the InviteData
as represented by the
supplied invite code. If an error is received, it is emitted through the Mono
.public Mono<discord4j.discordjson.json.UserData> edit(discord4j.discordjson.json.UserModifyRequest request)
request
- A UserModifyRequest
as request body.Mono
where, upon successful completion, emits the edited UserData
. If an error is
received, it is emitted through the Mono
.public ApplicationService getApplicationService()
public AuditLogService getAuditLogService()
public ChannelService getChannelService()
getChannelById(Snowflake)
, restChannel(ChannelData)
or
RestChannel.create(RestClient, Snowflake)
.public EmojiService getEmojiService()
getGuildEmojiById(Snowflake, Snowflake)
, restGuildEmoji(Snowflake, EmojiData)
or
RestEmoji.create(RestClient, Snowflake, Snowflake)
.public GatewayService getGatewayService()
public GuildService getGuildService()
getGuildById(Snowflake)
, restGuild(GuildData)
or
RestGuild.create(RestClient, Snowflake)
.public InviteService getInviteService()
getInvite(String)
, or RestInvite.create(RestClient, String)
.public UserService getUserService()
getUserById(Snowflake)
, restUser(UserData)
or
RestUser.create(RestClient, Snowflake)
.public VoiceService getVoiceService()
public WebhookService getWebhookService()
getWebhookById(Snowflake)
, restWebhook(WebhookData)
or
RestWebhook.create(RestClient, Snowflake)
.