Package com.rodiconmc.rodicord
Class Bot
- java.lang.Object
-
- com.rodiconmc.rodicord.Bot
-
public class Bot extends java.lang.ObjectA class for manipulating Bot endpoints. For bots, see theBearerclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DmChannelcreateDm(@NotNull java.lang.String recipientId)Create a new DM channel with a user.ChannelgetChannel(@NotNull java.lang.String id)Get a channel by ID.GuildgetGuild(@NotNull java.lang.String id)Get a Guild by ID.java.net.http.HttpRequest.BuildergetHttpBuilder()PartialGuild[]getOwnGuilds()Gets an array ofPartialGuildobjects the current agent is a member of.UsergetSelf()Gets the discord user object for the current agent.UsergetUser(@NotNull java.lang.String id)Gets the discord user object for a given user ID.java.net.http.HttpResponse<java.lang.String>makeRequest(java.net.http.HttpRequest request)UsermodifySelf(@Nullable java.lang.String username, @Nullable java.lang.String avatarData)Modify the bot's user account settings.
-
-
-
Constructor Detail
-
Bot
public Bot(BotToken token)
-
-
Method Detail
-
getUser
public User getUser(@NotNull @NotNull java.lang.String id) throws DiscordException
Gets the discord user object for a given user ID.- Parameters:
id- Snowflake id of the requested user- Returns:
Userobject from given id- Throws:
DiscordException- See Also:
- Discord Get User
-
modifySelf
public User modifySelf(@Nullable @Nullable java.lang.String username, @Nullable @Nullable java.lang.String avatarData) throws DiscordException
Modify the bot's user account settings. Returns aUserobject on success. All parameters are optional, and can be omitted by providing a null pointer- Parameters:
username- New UsernameavatarData- New avatar data- Returns:
- New
Userobject - Throws:
DiscordException- See Also:
- Discord Modify Current User
-
createDm
public DmChannel createDm(@NotNull @NotNull java.lang.String recipientId) throws DiscordException
Create a new DM channel with a user. Returns aDmChannelobject.- Parameters:
recipientId- the snowflake id of the user to DM with- Returns:
- the
DmChannel - Throws:
DiscordException- See Also:
- Discord Create DM
-
getChannel
public Channel getChannel(@NotNull @NotNull java.lang.String id)
Get a channel by ID. Returns a subclass of theChannelobject- Parameters:
id- Snowflake id of the channel- Returns:
- A subclass of the
Channelobject
-
getGuild
public Guild getGuild(@NotNull @NotNull java.lang.String id)
Get a Guild by ID. Returns aGuildobject- Parameters:
id- Snowflake id of the guild- Returns:
- A
Guildobject
-
getHttpBuilder
public java.net.http.HttpRequest.Builder getHttpBuilder()
-
makeRequest
public java.net.http.HttpResponse<java.lang.String> makeRequest(java.net.http.HttpRequest request) throws DiscordException- Throws:
DiscordException
-
getSelf
public User getSelf() throws DiscordException
Gets the discord user object for the current agent.- Returns:
- Current
Userobject - Throws:
DiscordException- See Also:
- Discord Get Current User
-
getOwnGuilds
public PartialGuild[] getOwnGuilds() throws DiscordException
Gets an array ofPartialGuildobjects the current agent is a member of.- Returns:
- Array of
PartialGuildwhich the current agent is a part of. - Throws:
DiscordException
-
-